Earlier quoted context omitted.
> animations are done in JS instead of smooth CSS transitions, drag and drop support is manually rewritten in JS... I mean... maybe in some legacy plugins that budget-shops drop into a Wordpress site without thinking. This stuff doesn't really happen anymore in real projects; there's not much point. > Whenever a feature gets added to standard HTML, web frameworks and "polyfills" keep implementing their own versions b…
> I think you misunderstand what polyfills are. [..] They get stripped out when possible. In no way are they "their own version" of the standard. That's the idea, but many projects never actually remove the polyfills once browsers catch up to a given standard. In theory they solve the problem, but in practice I'm still ending up downloading polyfills on Firefox and Chrome because Safari doesn't support a particular A…
The Failed Promise of Web Components
111–120 of 235 posts
Re: The Failed Promise of Web Components
#112https://news.ycombinator.com/item?id=24581439
https://news.ycombinator.com/item?id=24587413
https://news.ycombinator.com/item?id=24587413
and a response post: https://news.ycombinator.com/item?id=24606342
Re: The Failed Promise of Web Components
#113Earlier quoted context omitted.
> I think you misunderstand what polyfills are. [..] They get stripped out when possible. In no way are they "their own version" of the standard. That's the idea, but many projects never actually remove the polyfills once browsers catch up to a given standard. In theory they solve the problem, but in practice I'm still ending up downloading polyfills on Firefox and Chrome because Safari doesn't support a particular A…
Please learn how to properly quote things, all of your replies are showing up as part of what you quoted
Re: The Failed Promise of Web Components
#114What's so embarrassing is that the HTML/CSS/Javascript mess does roughly the job Visual Basic did. But worse.
Is that true? If I download Visual Basic right now, could I make a sensible visual app vs React? I’m tempted to see if the truth is really out there.
It's pretty terrible unless you want to make UIs with a fixed size and set of controls.
Re: The Failed Promise of Web Components
#115Earlier quoted context omitted.
> To me, it represents a huge failure on the part of the developer community not to make publishing web components the standard The problem is that if you're writing a Vue app, and you import a web component that was written in Preact, you're now loading both Vue and Preact onto your page. That means your app will take twice as long to load. That is a huge downside to weigh against the inconvenience of having to find…
The webcomponents supporters seem hell bent on placing the blame somewhere other than webcomponents themselves. In the “truckload of dependencies” they fail to ask why those dependencies are really there, and in that required JS they fail to ask why its really needed. The webcomponents model isn’t just broken, its thoroughly broken, and I actually hold the opinion that it was never even a good idea, because it’s simp…
Re: The Failed Promise of Web Components
#116Earlier quoted context omitted.
(Disclaimer: author and editor of the modern custom elements spec here.) The specific "failed promise" that I see is largely this positioning of web components vs. frameworks. How web components was originally envisioned was as leaf-node or light-DOM-using components, of the sort HTML already has. For example, , , , etc. Web components was supposed to give you the tools to create your own components of this sort, suc…
Agree with this 100%. It's called Web Components since it's best used for writing individual components that be dropped into larger apps. I did a side project with LitElement recently, and just could not find the value add over React. That's when I realized that was never the intention anyways. I think the desire to make Web Components a React competitor also comes in part from the movement towards 100% static sites,…
I see web components as a compositional approach for dealing with complexity.
Something else that is extremely powerful that people seem to forget is that you can add a src attribute to your web component that links to JSON data, or HTML fragements on a server. It can give you a lot of caching and concurrency opportunities, browser engines are extremely efficient dealing with this. For most people an src attribute feels really obvious for an img tag, but apparently less so in other contexts.
Re: The Failed Promise of Web Components
#117Earlier quoted context omitted.
React is a nightmare when it comes to performance or energy efficiency... Downloading 500kb of js and processing this is just a nogo. The best advice to anyone interested in page speed, dont use this crap. https://youtu.be/plt-iH_47GE
My website which is entirely built in react (and uses Gatsby). Takes 4kb to full page render (1 file - static only - JavaScript disabled). That’s smaller than most any html+css especially if using some css library. Of course once that is loaded and if JavaScript is enabled, then it will start to load interactive stuff and prefetch (which is around 100kb - but I have a lot of interactive stuff - including a zork style…
https://developers.google.com/web/updates/2019/02/rendering-...
Re: The Failed Promise of Web Components
#118> Can we fix this? Sure, by returning to basics. Let's assume that Web Component is a DOM element with a code associated with it + lifecycle events. Here is how Components are done in Sciter ( https://sciter.com ) 1. CSS has got `prototype` property: div.my-component { prototype: MyComponent url(script/components.js); } where MyComponent is the name of class in JS, url (optional) is an URL where this MyComponent can…
after doing a bit of vue I wanted this :)
The script will run only if you have elements with matching selectors. So you may have component libraries. Browser will instantiate only used components.
Re: The Failed Promise of Web Components
#119Earlier quoted context omitted.
Is that true? If I download Visual Basic right now, could I make a sensible visual app vs React? I’m tempted to see if the truth is really out there.
No, Visual Basic 6 can only place controls by X/Y position, has no databinding and no VDOM or way to create controls other than placing them in the designer or manually creating and destroying them in code. It's pretty terrible unless you want to make UIs with a fixed size and set of controls.
Right now I’ll say the best iOS/android apps put web to shame. Is Flutter and SwiftUI where we should be looking? The question is specific to semi complex apps (typical crud), not websites.
Re: The Failed Promise of Web Components
#120This post is needlessly snarky, but I don't disagree with the basic premise. Here's what killed web components: lack of native databinding on the web. That's the reason the standard is useless without JS. Any modular, dynamic, modern UI requires databinding, which means it's going to bring in a framework anyway, which means that self-contained widgets are all going to bring in their own frameworks, which means that i…
The web components under the hood would still need a way to program themselves in response to that data, so a templating language would need to be baked in along with data binding. Secondary languages are a bad idea, so hopefully this templating language would be something like jsx/ejs. The proposal really is to bake applications support in to the browser. That seems right to me. The browser is more and more an os, a…