Skip to content

Rename worker/isolated based backends - #35

Merged
aron-cf merged 7 commits into
mainfrom
stack/1-rename-worker-backends
Aug 3, 2026
Merged

aron-cf merged 7 commits into
mainfrom
stack/1-rename-worker-backends

Conversation

@aron-cf

@aron-cf aron-cf commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

The @cloudflare/computer package ships two backends that run inside a Cloudflare Worker: one that hosts a shell and one that runs a JavaScript module. Their old names, WorkerBackend and IsolateJavaScriptBackend, described neither what they host nor how they relate to each other, and their backend type and default id strings 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 id worker-shell) and WorkerJavaScriptBackend (type and id worker-javascript), so the shared "Worker-hosted" prefix is explicit and each backend's class name, type, and default id all agree. The source directories, export subpaths, package manifest entries, the shell bundle build path, and the generated-bundle gitignore entry all move to match. The worker example is renamed to worker-shell in the same change, and the documentation and package README are updated to the new names.

The rename touches the public surface: consumers importing WorkerBackend or IsolateJavaScriptBackend, or selecting a backend by the old type/id string, must move to the new names. A historical journal-migration test row keeps its original isolate-javascript value 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/computer and npx biome check . from the repository root.

aron-cf added 6 commits August 3, 2026 09:48
…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
aron-cf force-pushed the stack/1-rename-worker-backends branch from 1c37bf4 to 16365d6 Compare August 3, 2026 10:17
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.
@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/computer/@cloudflare/computer@35

commit: ce6754b

@aron-cf
aron-cf merged commit 0632e72 into main Aug 3, 2026
11 checks passed
@aron-cf
aron-cf deleted the stack/1-rename-worker-backends branch August 3, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant