HNHacker News
TopNewBestAskShowJobs

westbrookjo

5 karma · joined April 12, 2019

submissionscomments
westbrookjo··on Web Components could replace frontend frameworks?
That's an interesting read. I'm thinking on whether the real question is what is the declarative difference between the video tag, which by normal application lets everyone feel find about that content hidden by the shadow DOM vs the APIs we're developing for our custom elements. There seems to be an important piece of learning, not just for SSR, but for custom element development in general, that I think we can build off of.
westbrookjo··on Web Components could replace frontend frameworks?
Possibly. I think the extra `&`s are something that could wash out with one-time tooling, and that the desire for `@nest .parent &` would bump the conversion rate, but it's always fun to watch the comings and going of standards.
westbrookjo··on Web Components could replace frontend frameworks?
You might want to check out https://cssdb.org/#nesting-rules native nested CSS rules have hit stage 1!
westbrookjo··on Web Components could replace frontend frameworks?
LitHTML and LitElement don't need a specific bundler, they work with whatever tools (or not) you'd like. You might want to get them another look!
westbrookjo··on Web Components could replace frontend frameworks?
One thing that is particularly important to take into account when comparing web components to framework is that they can and should work together. If indeed "web components" replace your "framework" it will most likely be because a new framework that takes advantage of web components and all that the web is now replaces your old framework. Already libraries that combine popular concepts like hooks from React with web components (https://github.com/matthewp/haunted) are pointing the way to a more powerful future for both site that need just that little extra something via a stand alone web component or a whole family of components wedded to a framework into a rich application. That being said, don't get confused by people on either side being overly defensive of their place in the web ecosystem things are they are now will change. Techniques will grow and merge and there will be something else that is "the thing" before too long. Web components will likely be as much a part of that as the elements who's shoulders they stand on (e.g. <select/> and <video/>). That's the power of the web.
westbrookjo··on Web Components could replace frontend frameworks?
Even from the beginning of Polymer and it's use of HTML Imports there were tools for bundling them and they worked great! It's even easier to find the right tool for you now that ES Modules deliver the power of web components with the help of your favorite Rollup or Webpack configs and plugins...

https://open-wc.org/building/

westbrookjo··on Web Components could replace frontend frameworks?
You can server side render a `video` element just the same way you would a `custom-element`. We've been doing it for years and there's no reason to think anything about that has changed. If you're looking to deep SSR which is arguable as far as benefit, check out approaches like https://github.com/ionic-team/stencil-ssr-starter
westbrookjo··on Web Components could replace frontend frameworks?
Types are cool, TypeScript is cool, and types with JSDocs are cool, https://dev.to/dakmor/type-safe-web-components-with-jsdoc-4i... and what's more, they're all cool with web components.
westbrookjo··on Web Components could replace frontend frameworks?
You might be interested in https://github.com/bennypowers/stripe-elements Stripe v3 with Shadow DOM.
westbrookjo··on Web Components could replace frontend frameworks?
Be sure to checkout lit-html and LitElement (https://lit-html.polymer-project.org & https://lit-element.polymer-project.org)...what you've written about here already exists!