Live data from Hacker News

Datastar: Web Framework for the Future?

chrismalek.me

41–50 of 161 posts

Re: Datastar: Web Framework for the Future?

#41

If you want a solid demo of what you can do with datastar. You can checkout this naive multiplayer game of life I wrote earlier in the week. Sends down 2500 divs every 200ms to all connected cliends via compressed SSE. https://example.andersmurphy.com/

Wow, I've never done multiplayer GoL. Simple yet addictively fun. LONG LIVE THE ORANGE CIVILIZATION!! edit: damn, purple civilization got hands

May the Yellows never forget

Re: Datastar: Web Framework for the Future?

#42

Earlier quoted context omitted.

a signal is not a single event but rather a stream of events at given timestamps (or, if you wish, a stream where you have an Option at each timestamp)

I googled this and got a few different answers, but not this one. Is there a particular implementation you’re referring to?

this is how signals are described in the functional reactive programming world. here is the paper by the guy http://conal.net/papers/push-pull-frp/push-pull-frp.pdf

Re: Datastar: Web Framework for the Future?

#43

If you want a solid demo of what you can do with datastar. You can checkout this naive multiplayer game of life I wrote earlier in the week. Sends down 2500 divs every 200ms to all connected cliends via compressed SSE. https://example.andersmurphy.com/

"Sends down 2500 divs every 200ms to all connected cliends via compressed SSE." If I didn't know better, I'd say this was an April Fool's joke.

It's a DOM render stress test. It's trying to show the network is not the bottleneck. TL;DR do this in React or any other framework compared to a one time tiny shim and see if you get better results.

Re: Datastar: Web Framework for the Future?

#44
post #2

The TODOS mini application at data-star.dev is slow and doesn't work correctly for me (checking/unchecking items isn't reliable). To me, this highlights one common problem I've seen with frameworks that insist on doing everything on the server.

UPDATE: I have no idea why fly.io hate the TODO, but https://example.andersmurphy.com/ is a decent example (that's way more fun) that's running now. I'm commenting out that demo until I have more time to investigate. If y'all find other ones that are acting up please let me know. Looks likes it might be time to actual host this thing on a real server.

Re: Datastar: Web Framework for the Future?

#46
post #3

Earlier quoted context omitted.

Agreed, I have gig internet and a hardwire connection and still get more lag than I'd want from a web app. Potentially could be solved with some client side cache but still..

Yeah something is DEFINITELY up. This is not the norm, we haven't seen this before. Fly.io free tier is not happy and I'm not sure why (we've been on it for years at this point). I'm gonna disable until I can dig deeper. Have day job stuff to attend to, this is not my ideal Friday afternoon :P

If you're on shared CPU you probably got throttled. Dig into the grafana dashboard and you'll see it somewhere...it's not nearly prominent enough in their UI.

Re: Datastar: Web Framework for the Future?

#47
post #45

The future is frameworkless.

I agree! That's kinda the point with Datastar. EVERYTHING is a plugin, the core is a < 300 LOC engine for parsing data-* attributes and making available to plugins. You can pick and choose what makes sense for you. If you want to have declarative spec compliant interfaces, it can't get any smaller from what I've seen in the wild. Happy to get help to shrink it even more!

Re: Datastar: Web Framework for the Future?

#48

Earlier quoted context omitted.

Is sending 10,000 divs/sec the right solution for this problem, or is this an "everything looks like a nail" solution?

This is a Wirth's Law solution - the reasoning goes: "computers are fast enough to deal with it, so why not?"

I'm am not of that opinion at all. I'm all about optimization but then people will say "that's not how web pages are made". Can't win opinions but can say, Datastar is not the bottleneck. You send as much, as often as you choose.

Re: Datastar: Web Framework for the Future?

#50
The section on the author's background could have almost been written by me. I'm also a PeopleSoft developer, and the ability to build fully-functional CRUD apps without needing to know about HTML, JavaScript, Browsers, etc, is severely underappreciated. For very simple CRUD pages, no code is required. For developing line-of-business apps it's actually an incredible toolset.
Post reply on HN