Lurker News

Comments (568) 81 threads

Earlier comments
bryanhogan2 replies#
Yes, React is huge, but I also see it used for everything and everyone when it's really not the right tech-stack in many situations.

Just need a simple interaction free site? Use Astro.
Need some interaction? Use Svelte. Larger project? SvelteKit.
Need a more established solution? Use Vue.
Working in a huge team and need a highly opinionated framework with strict conventions? Use Angular.
More than 99% of websites would be sufficient with Astro though. And when just some interactivity is needed it is always possible to add Svelte / Vue / Solid / Alpine / HTMX on top of Astro.

klysm#
React itself is not huge
mplanchard#
Weird that the current state of things for a simple, noninteractive site is some kind of framework and not just “write the HTML with a little JS where needed,” which works perfectly well and requires no additional baggage.
imiric#
I really like how Nue is shaping up! Having a clear MVC separation, leveraging modern web standards, semantic markup—all great things. Kudos!

Seeing the .dhtml extension certainly brings back memories... One thing I dislike is that the HTML is still parsed and converted into JS, which is then evaluated at runtime, correct? I realize that this is required to support templating and a nicer syntax for binding and such, but my ideal "framework" would support plain HTML files that are not converted to JS, but used very lightweight syntax (essentially custom data attributes, and `` elements) to make the page dynamic. In fact, I'm experimenting with such a library right now[1]. This approach is likely more difficult to manage when building large web apps, but for simple UIs as used in browser extensions, it's fairly sufficient.
Frontend web development has been stuck in a pit of complexity for well over a decade now, and it's about time we go back to basics. There are new generations of frontend developers who only know this way of working, which is a shame. They're not really _web_ developers, but React, Vue, or whatever the popular framework is, developers. Web standards are far along now that there is very little additional glue and sugar needed to build modern web applications. React ushered in a new way of building UIs, but it also spawned dozens of copycats and frameworks that are downright developer-hostile beyond their shiny exterior. Not to mention the security nightmare of an incomprehensibly large dependency tree. Let's actively reject this madness.
[1]: https://github.com/hackfixme/miu

vanderZwan1 reply#
> Using Rust and Event Sourcing for instant UX over 150,000 records — far past where JavaScript crashes with a stack overflow error.

Nit: while I fully support making the web more efficient and hope that Nue is successful in promoting that, I'm skeptical of the "crashing" JS claim here. You can do amazingly efficient things with TypedArrays, the forgotten middle child between JavaScript and WASM.
Having said that, this requires building a few clever data structures on top (I've gotten a lot of mileage out of "typed" dequeues, and (sparse) bitmaps myself), often emulating structs in a language unable to express them properly. So the resulting code is not exactly idiomatic JavaScript — which I presume is what they implied here. Plus in this case it probably still wouldn't be as fast as a well-written WASM implementation, since almost all of the work is likely spent searching with only a little bit of DOM manipulation at the end.
So I'm both agreeing and feeling like it slightly overgeneralizes. I guess my point is: yes, let's be critical of bloated web frameworks, but let's not equate React with JavaScript either.

tipiirai2 replies#
Author here. You’re spot on. I took away the React association and added a direct link to the JS code [1] that hit the ‘Maximum call stack size exceeded’ wall. TypedArrays can do wild stuff, no doubt, but yeah, it’s not exactly vanilla JS—and still lags a tight WASM setup. Appreciating the nuance here!

[1]: https://github.com/nuejs/nue/blob/master/packages/examples/s...

vanderZwan1 reply#
The new wording is much more nuanced, appreciated! Also the fact that you link to the actual code that broke down, making it possible to verify the claim. Less ammunition for the people who actually are skeptical of the project instead of just nitpicky like me ;)

Speaking of the code in question, it looks pretty sensible - there's a bit of low-hanging fruit where one could avoid creating redundant arrays by turning chained calls to map and filter into one for-loop and such, but that's about it.
What confuses me is that there's no point in the code where I see any recursion, here or in the other JS files that seem relevant, so how does one end up with a call stack overflow?
(not questioning that it crashed for you, it's just that I don't see any obvious flaws in the implementation, so I'm curious to lean what the "gotcha" is in case I ever bump into something like it myself)

akx5 replies#
The stack overflow is caused by an `arr=[...]; events.push(...arr)` in `add_events`. Replacing that with `for(const x of [...]) events.push(x)` gets rid of that issue, and the JS-backed build is then snappier to search & filter than the WASM/Rust version.

Continue this thread — 5 replies

mexicocitinluez#
What does event sourcing have to do with searching or "instant keypresses"? It's a storage pattern for recording events, not a way to search.

Like, you're searching a single table for text messages, not a stream of events.

zol1 reply#
Today it’s Nue. Tomorrow it’ll be Olde and we’ll complain about all the boilerplate or repetitive update logic we now have to write.
tipiirai#
Fair point—new tools pop up constantly, often just piling more layers on React’s bloated stack. Nue’s not that. It’s a fresh start, built on web standards and closer to the metal, not another abstraction treadmill. That’s why a button can be lighter than a whole app—less cruft, not more boilerplate. Tomorrow’s Olde might still fight yesterday’s bloat; Nue’s dodging that trap from day one

Load more comments