feat(host-cloudflare): use dynamic-worker runtime when LOADER binding present#1452
Open
alanpog wants to merge 1 commit into
Open
feat(host-cloudflare): use dynamic-worker runtime when LOADER binding present#1452alanpog wants to merge 1 commit into
alanpog wants to merge 1 commit into
Conversation
… present Swap the Cloudflare host's code substrate from QuickJS-wasm to @executor-js/runtime-dynamic-worker (the cloud substrate) whenever the Worker declares a worker_loaders LOADER binding; fall back to QuickJS when the binding is absent, so existing self-host deployments are unaffected. Verified on a live deployment: sandboxed code runs in real workerd isolates (navigator.userAgent === "Cloudflare-Workers") with platform-enforced zero egress — fetch() throws and the only exit is the RPC tool bridge through the host.
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.
Swaps the Cloudflare host's code substrate from QuickJS-wasm to
@executor-js/runtime-dynamic-worker(the cloud substrate) whenever the Worker declares aworker_loadersLOADER binding, falling back to QuickJS when the binding is absent — the one-Layer change the comment insrc/execution.tspredicted. Existing self-host deployments without the binding are unaffected.Verified on a live self-host deployment (account with Worker Loaders access):
navigator.userAgent === "Cloudflare-Workers")fetch()throws ("This worker is not permitted to access the internet"); the only exit is the RPC tool bridge through the hostrequire_approvalpause/resume behave identically to the QuickJS substrateNotes:
worker_loadersblock inwrangler.jsoncmakes dynamic-worker the default for new deployments; deployments preferring QuickJS (or without Worker Loaders access) can remove the block — the conditional keeps both paths live. Happy to flip the default to opt-in if you'd rather.apps/host-cloudflareis private/unpublished (per Remove changeset that only targets ignored packages #1444); can add one if you want it recorded.format:check, host-cloudflaretypecheckandtest.