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.

I'm working with @tomayac.com to build bundler integration for this (currently a nuxt module + a vite plugin) I'd love to know: 1️⃣ if this sounds like a good idea you'd use 2️⃣ if you wanted to test it out and see if it might make a difference for you ... happy to help if you have questions! 🙏

github.comGitHub - danielroe/cross-origin-storage: Load shared dependencies from Cross-Origin Storage (COS).Load shared dependencies from Cross-Origin Storage (COS). - danielroe/cross-origin-storage

2 reposts18 likes

with so many supply chain issues lately, I would be very concerned about security with something like this. i love the idea for sure, but I personally lean toward security over convenience

that definitely helps. but (correct me if i’m wrong) verification of those hashes is not enforced, correct? so devs/vibe coders out there could just as easily skip that validation and use a corrupt resource…so the users of those systems are then at risk

right now testing it out means: ⚪ using the vite plugin or nuxt module ⚪ installing an 'unpacked' version of a chrome extension that polyfills this functionality ⚪ checking to see if your site still builds, and ideally comparing output _across_ several sites

chromewebstore.google.comCross-Origin Storage - Chrome Web StoreImplements the proposed Cross-Origin Storage API, letting sites share files with your consent for a faster and more efficient web.

I sort of get it. But wouldn't it be simpler to use SRI? You get the same hashing protection - but without lots of new syntax. If example,org has `src=whatever.js integrity="sha25-…” cross origin=*` why not let the browser serve up its cached version if the hashes match?