Post

wouldn't it be nice if sites could share a cache of common js? ... stuff like react, or vue or svelte? 👉 there's an early stage proposal for cross-origin storage which enables exactly this. there are challenges but I think it's very interesting indeed

github.comGitHub - WICG/cross-origin-storage: Explainer for the Cross-Origin Storage (COS) APIExplainer for the Cross-Origin Storage (COS) API. Contribute to WICG/cross-origin-storage development by creating an account on GitHub.

By working with fullstack frameworks like Nuxt, we can make sure they output COS-friendly chunks that are the same for all Nuxt users on the same version. This even can mean bundling together different unrelated vendor libraries that just happen to be all used by the framework.

Yeah, the way I understand Svelte is that it essentially gets "compiled away," but as Dan says, there could still be other libraries or vendor artifacts that could profit. A COS-aware bundler certainly can help: SvelteKit <3 Vite from what I can tell.