Rename worker/isolated based backends - #35
Merged
Merged
Conversation
…vascript Rename the two Dynamic-Worker-hosted backends so their names describe what they are. Both run inside a Worker; they differ only in whether the shell is just-bash or an ECMAScript module. The previous names obscured that: WorkerBackend carried type "worker" but default id "isolate-shell", and the JavaScript backend was IsolateJavaScriptBackend with type "isolate-javascript". WorkerBackend becomes WorkerShellBackend, and IsolateJavaScriptBackend becomes WorkerJavaScriptBackend. Both now hold matching type and default id values, "worker-shell" and "worker-javascript". The source directories and package export subpaths move in step, from backends/worker and backends/javascript to backends/worker-shell and backends/worker-javascript. Changing the JavaScript backend's default id re-keys its execution journal and watermark rows; existing rows written under the old id become invisible to the renamed backend. This is acceptable for the preview journal, which is ephemeral.
…ports The worker example now imports WorkerShellBackend from the backends/worker-shell subpath, and the example itself moves from examples/worker to examples/worker-shell so its name matches the backend it demonstrates. Its package name, wrangler name, and R2 bucket gain the -shell suffix in step. The artifacts and think examples, which also construct the shell backend, follow the same import and class rename. The think-compare-runtimes mock target moves to the new subpath.
Reflect the worker-shell and worker-javascript names in the README's package listing, import examples, and the default backend id sentence.
Rename WorkerBackend to WorkerShellBackend and IsolateJavaScriptBackend to WorkerJavaScriptBackend throughout the design docs, along with the backends/worker-shell and backends/worker-javascript import subpaths and the worker-shell and worker-javascript selector ids.
Several documents still pointed at the pre-rename example directory and source tree. Update the project layout tree to worker-shell and worker-javascript, and repoint the worker backend doc and the package README at examples/worker-shell.
…mple The artifacts example clones this repo and copies EXAMPLE_PATH into the workspace at runtime; it still pointed at examples/worker, which the rename moved to examples/worker-shell, so the copy would fail once the rename landed. Update EXAMPLE_PATH and the surrounding prose, the root README link, AGENTS.md, and the artifacts example's own README, package.json, and wrangler.jsonc.
aron-cf
force-pushed
the
stack/1-rename-worker-backends
branch
from
August 3, 2026 10:17
1c37bf4 to
16365d6
Compare
Renaming the example package from @example/computer-worker to @example/computer-worker-shell left package-lock.json referencing the old name, so npm ci failed with an out-of-sync lockfile. Regenerate the lockfile so a clean install resolves the renamed package.
commit: |
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
@cloudflare/computerpackage ships two backends that run inside a Cloudflare Worker: one that hosts a shell and one that runs a JavaScript module. Their old names,WorkerBackendandIsolateJavaScriptBackend, described neither what they host nor how they relate to each other, and their backendtypeand defaultidstrings had drifted from the class names. A reader could not tell from the name that both are Worker-hosted, nor that they are siblings.This change renames them to
WorkerShellBackend(type and idworker-shell) andWorkerJavaScriptBackend(type and idworker-javascript), so the shared "Worker-hosted" prefix is explicit and each backend's class name,type, and defaultidall agree. The source directories, export subpaths, package manifest entries, the shell bundle build path, and the generated-bundle gitignore entry all move to match. Theworkerexample is renamed toworker-shellin the same change, and the documentation and package README are updated to the new names.The rename touches the public surface: consumers importing
WorkerBackendorIsolateJavaScriptBackend, or selecting a backend by the oldtype/idstring, must move to the new names. A historical journal-migration test row keeps its originalisolate-javascriptvalue because it records data written under the old name and must continue to read it back.No behavior changes. Verify with
npm run build && npm test --workspace @cloudflare/computerandnpx biome check .from the repository root.