3 ms·
I was comparing importing Web Components using HTML imports vs. static inlining the web component code within initial markup sent to browser. Putting it anothe
by everlost 11y ago
I was comparing importing Web Components using HTML imports vs. static inlining the web component code within initial markup sent to browser.
Putting it another way - whats the advantage of HTML imports over server side imports?
Server side imports may increase the initial payload, but that will still be quicker compared to extra fetch requests for the web component.
@nostrademons is right that http2 will level the playing field for this battle... so definitely keeping an eye out for it!
- spankalee 11y agoWeb component APIs and HTML imports are mostly orthogonal, except that HTML is a nice way to package HTML, CSS and JavaScript. You can inline your custom element definition just like you can inline anything else.