4 ms·
I have no idea what Unix philosophy's got to do with Web Components, but your advice is terrible. You're dissing custom frameworks at the same time as you're a
by dmitriid 9y ago
I have no idea what Unix philosophy's got to do with Web Components, but your advice is terrible.
You're dissing custom frameworks at the same time as you're advocating using a custom framework. Or, as you call it, "a templating engine". Because you need much much much more than just a templating engine:
- Web Components provide a fraction of a fraction of React's capabilities. Even though React doesn't even have that many capabilities. After all, it's just the V in MVC.
- You still need data binding
- You still need state management
- You still need ways to deal with component hierarchies (good luck not forgetting to unbind all the event listeners etc.)
- You still need to re-implement your own forms [1]
- etc. etc. etc.
So what you really are proposing is: either use a framework/a bunch of helper libs (Polymer, Skate.js whatever) or end up getting crufty and unmanageable with the low-level DOM APIs that Web Components offer (there are no other APIs in the standard).
[1] There is no way to have custom elements include data in form submissions: https://github.com/w3c/webcomponents/issues/187 https://github.com/w3c/webcomponents/issues/187 and the solution is "to replicate the behaviour of form elements (which requires you to also to replicate <form />)" https://github.com/w3c/webcomponents/issues/187#issuecomment-298679090 https://github.com/w3c/webcomponents/issues/187#issuecomment...
- colordrops 9y ago> I have no idea what Unix philosophy's got to do with Web Components. From Wikipedia: The UNIX philosophy is documented by Doug McIlroy in the Bell System Technical Journal from 1978: * Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features". * Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input. * Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them. * Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them. I'd say that the first, second, and fourth are EXACTLY what web components provide. Furthermore, things like Angular and React that include the kitchen sink are precisely the antithesis of the Unix philosophy. And lit-html does only one thing and does it well. It is not a framework. > Web Components provide a fraction of a fraction of React's capabilities. That's a pretty empty statement. > You still need data binding Which is why I suggested adding lit-html > You still need state management React doesn't include this either. I would suggest redux, or even something hand-rolled, considering how simple redux is. Even Dan Abramov, the creator of redux, suggests rolling your own unless you really need it. > You still need ways to deal with component hierarchies (good luck not forgetting to unbind all the event listeners etc.) lit-html handles this > You still need to re-implement your own forms See: https://www.webcomponents.org/ https://www.webcomponents.org/ for countless form components. > etc. etc. "etc" is used when you've run out of ideas. > There is no way to have custom elements include data in form submissions. You would be adopting a new technology with web components. Why bother with old-school form submissions? You are very ignorant and come off as seriously aggressive for no reason. Do your homework.
- dmitriid 9y ago> All custom frameworks end up getting crufty and unmanageable same person: > I suggested adding lit-html > I would suggest redux, or even something hand-rolled > See: https://www.webcomponents.org/ https://www.webcomponents.org/ for countless form components. How quickly will that become crufty and unmanageable? Oh, pretty quickly. Also, the following statement is if not false, then misleading > I'd say that the first, second, and fourth are EXACTLY what web components provide. - Web Components don't even do one thing well. - There are still issues with "serving as input": you need to manually construct and add them to your templates if you need complex properties (i.e. anything that's not a string), there are issues interacting with the rest of the spec (form data, labels not supporting custom elements, input elements not being extensible, ARIA still not aligned with custom elements) - WCs don't provide any tools and definitely do not lighten a programming task. Because at this point they provide nothing but low-level overly verbose primitives to construct custom elements. Everything else has to be brought in in the form of helpers, third-party libs or, yes, frameworks (e.g., if you call React a framework, then Polymer is also a framework). So, original comment said this: > I've recently tried to get into React seriously and I found myself getting stuck pretty quickly. I tried Vue.js which seem to be popular as well and I had a blast. I found the templates more intuitive, the documentation easier to read and the concepts just fun to use. Your suggestion to go for Web Components because custom frameworks are crufty and unmanageable is disingenuous at best. You will end up with both custom frameworks on top of WebComponents and potential multiple issues that exist. Unless, of course, you go for "hundreds of components on webcomponents.org", vast majority of whom use Polymer to plug all the holes in the spec.
- colordrops 9y agoRedux and lit are not frameworks, but modular components that can be swapped out if you keep your interfaces clean. And neither are web components a framework. But go on with your rant.
- dmitriid 9y agoIf you cared long enough to read and understand what I wrote, there would be a point to continue this conversation. What you do though is twist my words every which way and fight with that twisted version. Just to point out a few things: - I never said Web Components written in X would be incompatible with Y - I never said Web Components were a framework - I never said Redux was a framework The rest I really couldn’t be bothered to lay out and dispel, as I have better things to do with my life.