3 ms·
Have you used Web Components as part of a large project? What has your experience been? I'd love to start pushing them to my clients, especially non-tech compa
by GeneralMaximus 10y ago
Have you used Web Components as part of a large project? What has your experience been?
I'd love to start pushing them to my clients, especially non-tech companies who can't afford to rewrite all their code every time a new framework becomes the fad, but I'm still kinda unconvinced. I'd love to read some real-world case studies.
- ergo14 10y agoWell if you want "big" cases you have Google Play Music, Youtube (gaming site, + the main one is being rewritten right now - you can force beta with some cookies), electronic arts sites like battlefield1 and others. Watch polymer summit streams they show some really high profile sites that use webcomponents. Personally I've introduced web components using polymer library in two ways - upgrading legacy jquery based application and when starting a fresh CMS system with admin panel that is 100% SPA built with polymer (kind of like weebly interface - its not public yet). It worked well for both of my cases, It felt quite similar to my previous angular 1.5+ component based approach (so I suppose it would be comparable to react/vue development). Right now you can use polymer-redux or polymer-uniflow if you want to structure big application data flows. I haven't encountered bigger obstacles or problems compared to other solutions I've used in the past. I've integrated 3rd party libs like crossroads-router or quill editor just fine. I looked a bit at Angular 2.x but for me Polymer look way more natural in terms in how applications should be build on the web. What I did miss was a routing element like angular's ui-router (I didn't like `app-route` element)- but this is currently being worked on and there is a POC ui-router port for Polymer already.
- GeneralMaximus 10y agoThank you so much for your response. I had no idea all those properties were built with Web Components/Polymer! Maybe I'm living in a React/Vue bubble, because this stuff has never shown up on my radar. > I looked a bit at Angular 2.x but for me Polymer look way more natural in terms in how applications should be build on the web. Completely agree. In the long term, I'd love to see most reusable UI components on the web built with Web Components, with optional wrappers for people who still want to use frameworks. One more question: is there currently a way to do server-side rendering for an SPA built with Web Components? I'm assuming something like jsdom will work?
- ergo14 10y agoNo as far as I can tell this is not possible - because web components with shadow dom do not leak implementation details. For example you have <video> tag - it has its own internal controls that are not part of the markup - same with web components - <my-custom-elem> is what the browser sees - not what is inside - for it it is just a DOM element. Then again I haven't explored the subject too deeply since I do Python server side so js rendering is not an option here. I suppose it would be possible if you would drop the shadow dom from your elements.