4 ms·
I think web components are low level and non-opinionated to give you freedom of implementation for higher level things. Thats what Polymer, Stencil, Svelte, Ska
by ergo14 9y ago
I think web components are low level and non-opinionated to give you freedom of implementation for higher level things.
Thats what Polymer, Stencil, Svelte, SkateJS are for. Indeed WC API is not the nicest to work with to say the least, but thats not the problem, I write in python instead of Assembly, just user higher level stuff.
- dmitriid 9y ago> Indeed WC API is not the nicest to work with to say the least, but thats not the problem How is it not a problem? > I write in python instead of Assembly, just user higher level stuff. As with any analogies, it's a wrong one. You compare a low-level PL with a high level PL. WebComponents is not a programming language. It's a set of APIs for the most popular platform in the world I wonder how far along iOS would get if all it provided for its UI libraries was just the UIView, and never anything else (no collection views, no table views, no content views etc.) That's exactly what w3c does, times and again.
- ergo14 9y agoIt is low level API to be non-opinionated. Or at least it makes sense for me to make it like that. Same as web assembly, service worksers and others - that is a step in right direction IMO. Same as for example Python providing WSGI - you don't often use WSGI directly, you use a framework on top of it like Pyramid, Django or Flask.
- dmitriid 9y ago> It is low level API to be non-opinionated. No API is non-opinionated. It's the opinion of its authors. And w3c's opinions invariably are to the detriment of developer experience. For example, quote from [1]: "The things like property initializers for instances that were so nice in [a previous example] aren't here. And they've been stuck in committee for reasons that, frankly, just make me grumpy" (around 22:30 mark) [1]: https://www.youtube.com/watch?v=y-8Lmg5Gobw https://www.youtube.com/watch?v=y-8Lmg5Gobw Around 12:50 mark: "What jumped out at us was how much infrastructure each library was bringing around to support creating widgets or components". Let's look at WCs: ooops, all the infrastructure is still there, nothing is done to make it easier.
- spankalee 9y ago> And w3c's opinions invariably are to the detriment of developer experience. Wow. Sorry, but I don't think you really know what you're talking about here. The Web Component specs are part of the HTML and DOM specs. Things like property initialization would fall under JavaScript and are already being addressed with JavaScript class fields with initializers. Spec authors don't go out of their way to make life hard on developers :/
- rictic 9y ago> No API is non-opinionated. It's the difference between AppCache and Service Worker. AppCache is very easy to write, very easy to read, has a nice and simple API. It's just the wrong API, so it's functionally almost useless. Service Worker's API is more complex because it has hooks for the user to efficiently express exactly what they need. It's less easy to write, and less easy to read, but it's flexible enough that basically every site on the web could make good use out of having a Service Worker. Most people won't write against the Service Worker API directly, they'll use a library. You might say that this is a flaw of the API, that it's too complex or verbose for most users to use directly, but I think there's another angle to it. There can be many libraries and those libraries can iterate quickly. There can be only so many specs, and those specs necessarily iterate slowly.
- dmitriid 9y agoWhat I don't understand is why people insist that WebComponents API is ServiceWorkers in this analogy, and not AppCache :)
- dmitriid 9y agoAlso, this article captures the essence for AppCache vs ServiceWorkers comparisons: https://medium.com/@firt/service-workers-replacing-appcache-a-sledgehammer-to-crack-a-nut-5db6f473cc9b https://medium.com/@firt/service-workers-replacing-appcache-... Namely: 'I don’t think we need a “Service Worker’s jQuery”. We need to use Vanilla AppCache code.' Same goes for a ton of other things on the web platform. Replace "Service Worker" with "Web Components", and the sentence will still remain true.
- coldtea 9y ago>I think web components are low level and non-opinionated to give you freedom of implementation for higher level things. Yeah, that worked so nice with X-Windows...