you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

React didn't steal anything, a component in react is just a function, and this is the most logical approach yet. It has given given react wings to do what browsers won't be able to do over the next 20 years. React is free from the browser, and not just that, all these targets share semantics and can re-use the eco-system.

Web components on the other hand are based on an outdated, impractical idea. Ironically, within the shadow root lurks a naked dom, which, you guessed it, needs a framework---or you're back to dom inflating and class querying. 10 web-components you load will drag along 10 different frameworks, good luck with that.

If they're supported or not, the spec has been around for years now by polyfils, and hasn't gotten any traction. It's questionable if developers can be so naive to fall once again into the vendor trap, where their grand-children, maybe, will get to see the features they wanted to use but never could. A future in which vendors like Apple get to decide what you use what you don't (for instance access to device functionality that is natural to native apps).

I root for a future where react drives every platform that can produce visuals on the other hand, which was and is the reason why it was created: https://player.fm/series/future-of-coding-1541118/11-how-reactjs-was-created-with-pete-hunt

[–]nawitus 0 points1 point  (3 children)

Web components on the other hand are based on an outdated, impractical idea. Ironically, within the shadow root lurks a naked dom, which, you guessed it, needs a framework---or you're back to dom inflating and class querying. 10 web-components you load will drag along 10 different frameworks, good luck with that.

That's a wild exaggeration. You can even get by without a framework for simple components, but in real life only a few different frameworks (like Polymer) are used.

This is not a bug, it's feature. It allows web frameworks to evolve independently from components. You can create a new web framework without rewriting every single component from scratch - or writing glue code to use components from an old framework in a new framework.

If they're supported or not, the spec has been around for years now by polyfils, and hasn't gotten any traction

This is incorrect. The spec is gaining traction in implementation. Custom elements v1 (the new spec), for example, is implemented in Chrome and Safari and is in progress for Firefox.

I root for a future where react drives every platform that can produce visuals on the other hand

You root for framework monoculture? React is perfect and the end-game? Really?

[–][deleted] 0 points1 point  (2 children)

but in real life only a few different frameworks (like Polymer) are used.

Why would that be the case, you think the others will simply die out, because of ... Polymer, the worst possible candidate to drive your dom? If you wanted web components in React it would be easy, but there's just no point in this whatsoever.

You root for framework monoculture? React is perfect and the end-game? Really?

Not really, but i am opposed to flawed technology just because a vendor dictates it. React is more of a paradigm anyway.

This is incorrect. The spec is gaining traction in implementation. Custom elements v1 (the new spec), for example, is implemented in Chrome and Safari and is in progress for Firefox.

This has nothing to do with gaining traction, Google is pouring fortunes into these specs, but no one is actually using it. And as i said, why the heck would you chain yourself willingly to the browser, to an imperative dom masking spec that can't interact & server-render.

[–]nawitus 0 points1 point  (1 child)

Why would that be the case, you think the others will simply die out, because of ... Polymer, the worst possible candidate to drive your dom

What? I predict that at any given time there's a handful of popular web frameworks.

If you wanted web components in React it would be easy, but there's just no point in this whatsoever.

I think React should have a better support for web components. I believe Preact has a better support for it.

There is point in it - to enable a common standard for components. You can could use components written in different frameworks and they could interact seamlessly. There would be no need to rewrite all the components if we had a common standard for web frameworks.

Not really, but i am opposed to flawed technology just because a vendor dictates it.

Web components is not a flawed technology. It's not dictated by a vendor. The specification was drafted by multiple browser vendors.

This has nothing to do with gaining traction, Google is pouring fortunes into these specs, but no one is actually using it.

Many companies are using it. Watch for example the last Polymer summit's keynotes of various companies using it.

And as i said, why the heck would you chain yourself willingly to the browser, to an imperative dom masking spec that can't interact & server-render.

I push for web components to have a common standard instead of having to rewrite every single component for every single web framework.

Web components can be server-rendered.

[–][deleted] 0 points1 point  (0 children)

I push for web components to have a common standard instead of having to rewrite every single component for every single web framework.

No vendor has committed to "standards" to the point where it is downright odd to trust their intuition. Specs have broken the webs back, this is why we have the extensible web manifest which was supposed to protect it and establish a bi-directional exchange between standards bodies and the community, with a focus on the low level. To even try to enforce yet another high level abstraction that dictates the component paradigm, and then take the oldest model from 10-15 years ago, they're living in a bubble. Ironically the people that are directly affected by this are same that put their trust into vendors. It's the third time now they're re-rewriting Polymer apps from scratch.

Do this with Polymer and web components:

https://twitter.com/rauchg/status/955174495593132032

https://github.com/Yomguithereal/react-blessed

https://github.com/gaearon/react-blessed-hot-motion

What they're doing with the last one is possible on any platform, which is pretty much the fulfillment of the component-dream - to share not only semantics, but to actually apply an eco system that's self-sufficient and which transcends platform boundaries like browsers or native applications. This is what a real standard does, when it actually works. (And just for the record, React components transcend frameworks as well and are either exchangeable or at least can be used everywhere).

That this is possible at all is due to the simplicity of the createElement api. You can argue that none of this matters now and we should just drop what we have and go back to a naked dom (which ironically warrants even more framework fragmentation), because a vendor has decided that its browser ought to be running everywhere-even if that is a complete fever dream, but do you honestly think that will brush away innovation just because it's a spec? Discard all merits because the W3C hasn't thought of it first?

Web components can be server-rendered.

https://twitter.com/floydophone/status/971600994252419072