4 ms·
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 cre
by wsatb 3y ago
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.
- satvikpendem 3y agoInteresting, 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.
- earthboundkid 3y agoBut 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.
- spankalee 3y agoYou 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.
- earthboundkid 3y agoEach 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.
- satvikpendem 3y agoI honestly don't know how WCs got through the standards process successfully, they're so bad.
- earthboundkid 3y agoThe 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.