Closed janbkrejci closed 2 months ago
I'm not a Node dev any more but I'm sure its on the Node side. What does profiling and flame graphs tell you about the backend?
Yeah! This library is really neat! I'd like to get the NodeJS demo fixed up to allow us "normal" JS devs to come onboard with this refreshing approach.
I'm looking into why the default NodeJS example causes this lockup. It's all related to the /feed
demo endpoint in the browser. If that is not invoked on the page, the demo works as expected.
The code repo is here: https://github.com/matt-dale/datastar-node-example
Profiling the node process shows no issues at all, but I guess it could be related to how we are using the sendSSE
method?
Meanwhile, the browser slowly get's very bogged down.
Inspecting the flamegraph here shows that applyPlugins > walkDownDOM
normally completes extremely fast, but can take almost 1 second during the lockup period.
The comparison between the different calls are below.
Profiling the node process shows no issues at all, but I guess it could be related to how we are using the sendSSE method?
:100: it could be the problem. That code was provide by the community. It's either that or that writeable
section of the /feed
handler is leaking memory. I don't know enough to be useful but wonder if trying deno or bun would help figure out what the underlying issue is. I know that my Go helpers are pretty solid.
Definitely want useable tooling for JS/TS devs and would love the help.
@matt-dale any luck with this?
I ran out of time looking into it. 😔
I'll close for now, I really think it's a backend issue. Please reopen if you can create a reproducible code example
Hello,
I tried the getting started example and dressed it to Shoelace. When I run it, the server feed starts, and after a while, it slows down until the browser tab freezes. Maybe I am doing something wrong. It seems that the heap grows indefinitely. Would you please take a look at the code?
Thanks and thumbs up for this awesome library.
Jan
...and here is the code: