4 ms·
Every reasonably complex site I've worked on uses some form of bundler so even if a site uses a bunch of common libraries they are all compiled together into a
by Osiris 5y ago
Every reasonably complex site I've worked on uses some form of bundler so even if a site uses a bunch of common libraries they are all compiled together into a big JS file.
I think that a lot of the way websites are developed would have to change to support such an initiative.
- quickthrower2 5y agoWebpack allows you to get some dependencies from global window but IIRC it is tricky to set up. That said if it were a web standard then webpack or one if the newer bundlers could figure it all out automatically based on your dependencies. The problem is “who is the source of truth”. A hash comparison system “get me the library that hashes to xyz” might work, and then you pick your “provider” as a fallback but the browser can pull from cache if the hash matches (even if it came from another provider) Just thinking of that the problem then is which to cache. How to know “React” is important? I guess browser could keep tally and keep the most often requested ones cached.
- davnicwil 5y agoyep, the way I'm thinking about this it'd certainly be the case that bundlers etc would be aware of the standard and act accordingly.