Add use case stubs for Cross-Origin Storage (COS) - #1208
Open
tomayac wants to merge 9 commits into
Open
Conversation
Adds three Stage 1 (use case identification) stubs under guides/performance/ for the WICG Cross-Origin Storage proposal: - avoid-redundant-large-asset-downloads: the imperative navigator.crossOriginStorage.requestFileHandle() API for sharing large files (AI models, Wasm modules, bundled JS libraries, game engine cores) across origins. - load-shared-resources-declaratively: the declarative HTML (crossoriginstorage attribute) and JS (crossOriginStorage import attribute) integrations. - share-web-fonts-across-origins: the declarative CSS cross-origin-storage() request-url-modifier for @font-face. Re-read the explainer (https://github.com/WICG/cross-origin-storage/) and spec (https://wicg.github.io/cross-origin-storage/) in full for this pass; content reflects the current API shape (singular requestFileHandle(), origins upgrade-only semantics, Public Hash List availability gating, GREASE'ing, declarative HTML/JS/CSS integrations). Known blocker: COS has no shipping browser implementation and no entry in the web-features package yet, so the web-feature-ids: cross-origin-storage value in each guide.md is a placeholder that will fail this repo's web-feature-ids CI check. Tracking issue for the upstream feature definition: web-platform-dx/web-features#4029. See PR description for details.
Per feedback: don't call out the web-features dependency in the guide content itself. web-feature-ids still points at the cross-origin-storage placeholder (web-platform-dx/web-features#4029).
Sourced from the working patterns documented in web-ai-community/cross-origin-storage-extension's docs/ folder (progressive-enhancement-demo.html and its CSS/HTML/JS fixtures), rewritten against the literal WICG spec syntax rather than that extension's polyfill-specific shims (e.g. real dynamic import() with a 'with' option instead of the extension's non-standard __non_standard__import() helper, since the guide represents the spec, not one particular polyfill's workaround for it). - avoid-redundant-large-asset-downloads/demo.html: imperative requestFileHandle() read path, NotFoundError/NotAllowedError handling, create:true write path with origins:'*'. - load-shared-resources-declaratively/demo.html: declarative HTML crossoriginstorage attribute on <link>/<script>, and feature-detected dynamic import() with the crossOriginStorage attribute for the JS form. - share-web-fonts-across-origins/demo.html: CSS cross-origin-storage() with a same-list plain url() fallback, COS-enhanced source ordered first per the src list's first-match resolution.
tomayac
marked this pull request as ready for review
August 9, 2026 13:09
rviscomi
reviewed
Aug 10, 2026
Co-authored-by: Rick Viscomi <rviscomi@users.noreply.github.com>
Member
Author
Ah, excellent. Suggestion accepted.
Done (also fixed the built-in AI one). PTAL! Thanks! |
rviscomi
reviewed
Aug 11, 2026
Co-authored-by: Rick Viscomi <rviscomi@users.noreply.github.com>
Co-authored-by: Rick Viscomi <rviscomi@users.noreply.github.com>
rviscomi
reviewed
Aug 12, 2026
| name: share-web-fonts-across-origins | ||
| description: Serve large, popular web fonts from a shared cross-origin cache instead of re-downloading them from a font CDN on every site that references them. | ||
| web-feature-ids: | ||
| - cross-origin-storage |
Member
There was a problem hiding this comment.
Suggested change
| - cross-origin-storage | |
| - tmp-cross-origin-storage |
| "web_features": { | ||
| "canvas-html": "ewewraw", | ||
| "container-scroll-state-queries": "bramus", | ||
| "cross-origin-storage": "tomayac", |
Member
There was a problem hiding this comment.
Suggested change
| "cross-origin-storage": "tomayac", | |
| "tmp-cross-origin-storage": "tomayac", |
| name: load-shared-resources-declaratively | ||
| description: Serve popular, unmodified scripts, stylesheets, and JavaScript modules from a shared cross-origin cache using markup or import syntax alone, without writing custom caching logic. | ||
| web-feature-ids: | ||
| - cross-origin-storage |
Member
There was a problem hiding this comment.
Suggested change
| - cross-origin-storage | |
| - tmp-cross-origin-storage |
| name: avoid-redundant-large-asset-downloads | ||
| description: Avoid re-downloading and re-storing large shared assets, such as AI models, Wasm modules, or fully-bundled JavaScript libraries, that a visitor's browser may already hold from an unrelated site. | ||
| web-feature-ids: | ||
| - cross-origin-storage |
Member
There was a problem hiding this comment.
Suggested change
| - cross-origin-storage | |
| - tmp-cross-origin-storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds guidance use cases for Cross-Origin Storage (COS) under
guides/performance/, covering all three ways to use the API:avoid-redundant-large-asset-downloads— the imperativenavigator.crossOriginStorage.requestFileHandle()API: storing/retrieving large files (AI models, Wasm modules, fully-bundled JS libraries, game engine cores) keyed by content hash.load-shared-resources-declaratively— the declarative HTMLcrossoriginstorageattribute (on<link>/<script>elements that already carryintegrity) and thecrossOriginStorageJS import attribute for static/dynamic module imports.share-web-fonts-across-origins— the declarative CSScross-origin-storage()request-url-modifier for@font-face.Each includes a
demo.htmlalongsideguide.mdandexpectations.md.web-feature-idsin all three points atcross-origin-storage(web-platform-dx/web-features#4029).