Lurker News

Comments (319) 80 threads

Earlier comments
redbell1 reply#
Ah, Puter! That fascinating project surfaced on HN about a year ago, claiming the top spot for most of the day. I'm delighted to witness its transition to open source, allowing us to glean insights from the creator. Gracias for sharing!

The emergence of such front-end projects provides a profound glimpse into the maturation of front-end development and showcasing the incredible possibilities it offers today.
Another really cool project, somehow related, is DaedalOS [2].
Honorable mention, Windows 11 in Svelte [3]
1. https://news.ycombinator.com/item?id=33838179
2. https://news.ycombinator.com/item?id=38830132 & https://news.ycombinator.com/item?id=29779753
3.https://news.ycombinator.com/item?id=35896505

DustinBrett#
Thanks for the mention for daedalOS! I agree that when done well these projects can help demonstrate the maturity of the web as a platform. For anyone interested in checking out mine, it's on my personal website @ https://dustinbrett.com/
pdntspa5 replies#
I hate that these guys have to justify using jQuery. Too many of you have been seduced by all these bullshit javascript stacks that just add a seemingly infinite amount of complexity to something that is already almost too complicated.
danielovichdk#
Amen!
dartos1 reply#
Ah, jQuery, that cute little artifact from web development's stone age, where manipulating the DOM directly was the height of innovation. How quaint it seems now, in the shining era of React, where state management is not just a task but, once it gets its hooks in you, evolves to a transcendent experience. To cling to jQuery is like insisting on using a typewriter in a world of voice-to-text AI, but adorably obsolete. React, with its majestic state orchestration, makes jQuery's efforts look like child's play. It's like comparing the glow of a firefly to the brilliance of a laser beam. Truly, we React devotees can only chuckle at the notion of jQuery, for we have tasted the future, and its name has and always will be React.

/s

lioeters#
> state management..gets its hooks in you

Pun appreciated.

ent101#
Yes, I've been asked why we use jQuery many times so I had to put it in the FAQ. I think we have solid reasons for it but it is controversial sometimes.
saidinesh51 reply#
Does jQuery by itself offer any value these days compared to plain Javascript though?

I was under the impression jQuery was for the IE5 days where not all browsers provided the same javascript APIs and doing an xmlhttprequest was more clunky than doing a fetch() call these days.
At least for my personal Jekyll based blog, I was able to replace 40-45 lines of jQuery with 50 lines of plain Javascript and was able to get rid of 33kb of jquery dependency.

QuadrupleA#
jQuery is still great. Just take this site (which is ironically arguing the opposite viewpoint) https://youmightnotneedjquery.com/ and notice how all the "modern" (tech's vaguest and most meaningless adjective) code is 2-3x as verbose and complicated.

And 33kb, you can probably gain that by changing your jpeg compresion level from 80 to 79.

niels_bom#
I think there are valuable positions to take in between “let’s manipulate the DOM by hand” and “React Server Components, NextJS and the kitchen sink”.

I personally think there’s great value in the pattern of reactivity where parts of your DOM update based on bits of data. Developing, designing and testing components like this becomes way simpler.

ashishb3 replies#
The JSX syntax makes React hard to read due to multiple layers of nesting.

IMHO, Vue is superior for both maintainability and readability than React. Especially because CSS, JS anda HTML are largely in separate blocks of the same file.

benatkin2 replies#
You can see this in that Flutter didn't copy JSX and its usability seems better.

Not that I'm confident Flutter is worth the trade-offs.

pmarreck#
narrator:

It's not.

mightyham#
I'm confused about what you mean by this. There's nothing about Flutter's API that encourages less nesting, In fact, it's the exact opposite. Plenty of layout and styling that takes a number of nested widgets in Flutter can be achieved using a single div in React.
CharlieDigital#
I can understand some of the benefits of JSX, but compared to Vue SFC's, it's a mess to read.

React CSS modules feel so unwieldy compared to Vue SFC's inline `scoped` CSS.
Vue's approach to templating using `v-for` and `v-if` means that you won't end up with a big block of logic mixed in with the template (you can still do it, but Vue's nature steers you away from it).

noduerme#
Arguably they should all be in external files. HTML in one, CSS in another, and Javascript to load and cache them without any embedded strings. That's how I prefer to write. For one thing, it lets me choose which things I want to cache and which I don't. I can compile from SCSS and deploy without changing any JS or HTML files. Usually my rollups are just the JS.
jahewson#
Because it’s trivial?
ent1011 reply#
I'm sorry XD
pcloadletter_#
Ha, I am not criticizing your work at all. It's nothing short of jaw-dropping.
divbzero1 reply#
I guess “React makes sense for more complex UIs” is not hard-and-fast rule. jQuery, apparently, is more than enough for clean working frontend code.
omeid24 replies#
It is not about complex UI per se, it is about complex state. With jQuery, the State is duplicated in the DOM instead of mirrored and is very hard to keep in sync.
FpUser3 replies#
>"State is duplicated in the DOM instead of mirrored"

And the difference between duplicated and mirrored is ...

Continue this thread — 3 replies

djbusby7 replies#
Write state to DOM, read state from DOM.

Continue this thread — 7 replies

rtcoms#
Why not use a state management library like xstate with jQuery ?
xorcist#
There is no sync if the state is the DOM.
blackoil#
This component has no state, no data fetch or transitions. It doesn't even have any dynamic part.
raggi#
Despite being asynchronous it contains a single linear schedule and two callbacks. The obvious outcome is two layered constructors, and a single top level API object with two custom events.

You couldn't describe what was going on in an equivalent functional construction of a react version unless you first head off on a diatribe about signals/hooks/state-management-disaster-du-jour, the choice of use of which would have implications to both the event handlers in some way - though they likely couldn't be in-place here, they'd have to be passed down from parent context in a giant dance of inversion of control. At runtime the outcome would likely get parsed twice (once for shadow, once for insertion) if not more times under certain compositions. Here the jquery is almost incidental, and could be quickly replaced by something else - for example want to swap out htmx here, well, just add the markers to the DOM, delete the jquery lines and you're done. You'd probably need to spend at least an hour figuring out if you could fit something independent and platform-native into your react code base, hell I've seen people burn weeks on it.

Load more comments