Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by wsatb on Thursday June 15, 2023 @06:46PM
(#36347811)
You can use lit components within Next, or within anything really. If you’re building a single app, use what you’re comfortable with. At my job, we’re often creating components that need to be used within an increasing number of frameworks because every client is using something different. Having a custom element instead of needing to load React on every client’s website is huge.
[ Parent
| on HN ]
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by satvikpendem on Thursday June 15, 2023 @06:54PM
(#36347902)
Interesting, at the workplaces I've been at, we only used React, nothing else, in order to make the code-sharing problem much easier, as well as not have developers learning many different frameworks just to get work done.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by earthboundkid on Thursday June 15, 2023 @10:52PM
(#36350478)
But wouldn’t you be happier if each and every component on the page paid the price of a full templating system?
No?
Oh yeah, I forgot that Web Components are a terrible idea that are only marginally successful because they can claim to be a “standard” when they’re not any more standard than any other JavaScript.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by satvikpendem on Thursday June 15, 2023 @10:56PM
(#36350516)
I honestly don't know how WCs got through the standards process successfully, they're so bad.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by earthboundkid on Friday June 16, 2023 @12:20PM
(#36359228)
The answer is that they're from ~2013: before React etc. taught us how to make SPAs. It was an early attempt, so it sucks. JS is best when it "paves the cowpath" and takes something we could already do slowly in browser and gives us a better native API for same thing, like querySelector or IntersectionObserver or how there was no built in way to parse a query string before URLSearchParams. Anytime JS goes first, the API is crap, like the DOM Node APIs themselves.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by spankalee on Thursday June 15, 2023 @11:52PM
(#36350971)
You only "pay" for as many template systems as you use, not one for every component, and modern template systems are far smaller than the major frameworks.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by earthboundkid on Friday June 16, 2023 @12:24PM
(#36359307)
Each independent script you import is another load blocker. You could have scripts A and B both import template C, but then you're slowing things down even more, and no "HTTP2 push!" is not the answer.