The basis for much of our ecosystem stems from a single method to replace traditional build routines and tree shaking in favor of a better developer experience for the average web user.
script type="module"
can resolve these on the fly in the browser>
minor performance metrics for random person XThere's a detailed article on dev.to from 2020 when project lead @btopro invented the approach and showcased it on a developer community meeting. The TLDR :
/build
, it falls back to a CDN (with fail-over across three) and delivers on matchMutationObserver
on the page for any tag added to the pageimport()
executes to import the definition; thus hydrating the custom element!This technological break through of the modern web + web components + ingenuity of existing APIs allows HAX to hydrate Sites from a singular, unbundled script while still delivering a high level of performance. The website is effectively an SPA and as new content is loaded, the definitions needed automatically load while known definitions sit in the user's cache and load automatically.
These are a few examples of sites disconnected from the CDN aspect of the script by supplying their own assets locally