Skip to content

Rename the existing CloudflareContainerBackend to LegacyContainerBackend - #161

Open
aron-cf wants to merge 4 commits into
mainfrom
container-backend-legacy
Open

aron-cf wants to merge 4 commits into
mainfrom
container-backend-legacy

Conversation

@aron-cf

@aron-cf aron-cf commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This will be replaced by the new instance based container runtime in a follow-up PR. For now this just moves the code but we'll remove it entirely in a future release.


Devin Review

The packages reference workers-types globals such as DurableObjectState
and Fetcher from their published declaration files, so a consumer has to
supply the types for those declarations to resolve. That relationship is
a peer dependency, not a development dependency, and declaring it as the
latter understated it.

Declare it as an optional peer accepting either major. Optional because
the consumers we know about do not install the package at all: the
examples here, and other Workers projects, generate their ambient types
with wrangler types instead, and demanding a package nobody installs
would fail every install for no benefit.

Widening to v5 is what unblocks wrangler 4.136, which declares a v5 peer
of its own. It also makes the container startup options visible: the
instance, image and hardTimeout fields a durable-object-scheduled
container must pass to start() exist only in v5, so the range, rather
than the pin, is what lets that code typecheck.
A container the durable object schedules itself has to name its image
and instance size on every start() call, because the wrangler containers
block rejects those keys under that policy. This backend cannot express
either: it builds the start options from enableInternet and env alone,
and drops anything else the caller passes.

Rather than teach one backend both policies, which would make every
option conditional on a deployment property no test can see, the
implementation is renamed and left alone. A second backend follows,
serving the durable-object policy only, and the two stay separate.

The vacated export path belongs to that backend rather than to a
compatibility alias, so callers of the old name get a build error that
names the replacement. Pointing it at a backend that drives a different
scheduling policy would turn a build failure into a container that never
starts.

Only the four exported names change. Internal names stay as they are,
since the new backend gets its own copies.
The example had no .gitignore, so a cf.json that `wrangler dev` writes
under .wrangler/cache was committed along with real changes. Every other
example ignores that directory.

The file is a snapshot of one contributor's request.cf object, carrying
their ISP, city, coordinates and colo. None of it is useful to anyone
else, and it is regenerated on the next local run. It was also the only
thing failing `biome check`, which reformatted the minified JSON and then
reported the difference on every run, so the repo shipped a check that
could not pass from a clean checkout.

The ignore rule matches the one examples/artifacts uses, keeping the
negation for .dev.vars.example so the committed env template stays
tracked.
Use the current Wrangler release across the packages and examples. Refresh
the lockfile so the renamed `container-legacy` workspace has its own
resolved dependency graph.
@changeset-bot

changeset-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

馃 Changeset detected

Latest commit: cfb2626

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/computer Major
@cloudflare/dofs Major
@cloudflare/computer-rpc Major
@cloudflare/computerd Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃攳 Example commands retain the old workspace name

The README and Wrangler comment still select @example/computer-container. Contributors cannot run the renamed @example/computer-container-legacy workspace with those commands.

(Refers to this code)

Devin Review


Was this helpful? React with 馃憤 or 馃憥 to provide feedback.

@@ -1,5 +1,5 @@
{
"name": "@example/computer-container",
"name": "@example/computer-container-legacy",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃煛 Renamed example breaks its CI job

@example/computer-container-legacy replaces the workspace still referenced by the example matrix. The job fails before validating the example and blocks CI.

Learn more

The example was renamed both as a directory and as an npm workspace. The CI matrix still passes the old workspace name to npm run build:types, npm run typecheck, and npm test, and passes the deleted directory to Biome. npm cannot resolve @example/computer-container, so the matrix job exits before those checks run.

Example: The example/container job executes npm run build:types --workspace @example/computer-container. Only @example/computer-container-legacy exists, so npm reports no matching workspace instead of generating types.

Recommended fix: Update the container entry in the example matrix to use workspace: "@example/computer-container-legacy", path: examples/container-legacy, and a matching display name.

Devin Review


Was this helpful? React with 馃憤 or 馃憥 to provide feedback.

Comment on lines +124 to +131
"@cloudflare/workers-types": "^4.20260616.1 || ^5.20260921.1",
"@platformatic/vfs": "*",
"ai": "^6.0.196 || ^7.0.0",
"zod": "^4.4.3"
},
"peerDependenciesMeta": {
"@cloudflare/workers-types": {
"optional": true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃攳 Rename bundles dependency contract changes

The PR also upgrades Wrangler and adds @cloudflare/workers-types peer ranges. These unrelated compatibility changes need separate rationale and validation.

Devin Review


Was this helpful? React with 馃憤 or 馃憥 to provide feedback.

@aron-cf
aron-cf added this pull request to stack #163 September 23, 2026 15:51
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