3 ms·
Universal web components are a pipe dream. Even within a community using the same framework or library, there is disagreement on how to solve certain problems.
by ralmidani 9y ago
Universal web components are a pipe dream.
Even within a community using the same framework or library, there is disagreement on how to solve certain problems. For example, the folks behind React Router removed parsing of querystrings, because people wanted the flexibilty of using alternative solutions [0].
It's hard to imagine something more trivial than parsing querystrings, yet no consensus exists among users of the same library (which itself is not officially-sanctioned by FB yet, and even React, while stronger than other libraries, is not loved and used by all client-side web devs) on how to do it best.
Yet people think someday in the near future, these differences will just disappear magically, and we will be able to author web components that snap--like Lego bricks--into whatever environment a developer wants?
[0] https://github.com/ReactTraining/react-router/issues/4410 https://github.com/ReactTraining/react-router/issues/4410
- spankalee 9y agoIf you look at the component models themselves, they're incredibly similar to Custom Elements. Most of the lifecycle hooks are the same, and things like setProps() in React are replaceable by reactive setters. So yes, I do think it'll work.
- deleted 9y ago[deleted]
- ralmidani 9y agoquerySelector() and querySelectorAll() are similar to jQuery, but they are not what unseated jQuery. It took a new library with compelling new features (unidirectional data flow, no need to use a special, crippled language just for templates) to get people to abandon jQuery. React is the dominant client-side web framework, but its preferred template syntax has a method for inserting components into the document which is totally different from the "standard" (and Ember) way of doing things. JSX uses CapitalizedComponentNames, while the standard uses dasherized-component-names. JSX has self-closing tags with slashes before the closing angle bracket, while the standard does not. There are perhaps tens of thousands of devs using React, Preact, and Inferno. How can these differences be smoothed over in order to enable universal web components?
- boubiyeah 9y ago100% agree. Plus web components are underpowered, imperative turds. Reusable = Reusable within ONE family of applications using a similar stack. That's already pretty nice. UX guidelines keep evolving too and it will remain a business advantage to be able to provide a better experience (and quickly so) than your competitors. Who seriously like the crappy <select> or <input type="date"> desktop web browsers provide?
- chickenfries 9y agoI do when they work. I really hate when someone reimplements select without supporting things like typing to skip select an option. And honestly, on mobile, the built ins are the best. There are react components that provide a good experience that replicates the features of most built ins, but it's a constantly moving target considering native widgets vary between platforms. In general I agree with you and gp though. I would love for web components to one day be the standard but I'll believe it when I see it.