Add single-threaded WASM fallback to remove COOP/COEP header requirement#3
Open
coryrylan wants to merge 1 commit into
Open
Add single-threaded WASM fallback to remove COOP/COEP header requirement#3coryrylan wants to merge 1 commit into
coryrylan wants to merge 1 commit into
Conversation
The threaded WASM build requires SharedArrayBuffer and therefore COOP/COEP response headers, which blocks CDN/static deployments that cannot set server headers. This adds a second, single-threaded build variant that the loader selects automatically at runtime when SharedArrayBuffer is unavailable, so the web component works with zero server configuration. - scripts/patch-build-usd-single-thread.py: verified patch that drops -pthread from the Autodesk fork's build_usd.py and passes -DEMSCRIPTEN_WITHOUT_PTHREAD=ON to oneTBB (supported by the pinned oneTBB v2021.12.0) - scripts/build-wasm.sh: builds both variants (threaded -> wasm/, single-threaded -> wasm/st/), selectable via VARIANTS env var - src/utils.ts: feature-detect SharedArrayBuffer and load wasm/st/ as a fallback; fail with an actionable error instead of a cryptic one - README.md / BUILDING.md: document the two variants, mark the headers as optional (performance), update the stale oneTBB blocker notes, and fix the coi-serviceworker link to the canonical repo The wasm/st/ artifacts still need to be generated with `npm run build:wasm` (Docker) and committed; until then non-isolated pages get a descriptive load error. https://claude.ai/code/session_01FT2aFG1YER768D3FRELkYd
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.
The threaded WASM build requires SharedArrayBuffer and therefore COOP/COEP
response headers, which blocks CDN/static deployments that cannot set
server headers. This adds a second, single-threaded build variant that the
loader selects automatically at runtime when SharedArrayBuffer is
unavailable, so the web component works with zero server configuration.
-pthread from the Autodesk fork's build_usd.py and passes
-DEMSCRIPTEN_WITHOUT_PTHREAD=ON to oneTBB (supported by the pinned
oneTBB v2021.12.0)
single-threaded -> wasm/st/), selectable via VARIANTS env var
fallback; fail with an actionable error instead of a cryptic one
optional (performance), update the stale oneTBB blocker notes, and fix
the coi-serviceworker link to the canonical repo
The wasm/st/ artifacts still need to be generated with
npm run build:wasm(Docker) and committed; until then non-isolated pages get a descriptive
load error.
https://claude.ai/code/session_01FT2aFG1YER768D3FRELkYd