feat(wrangler): add container support to worker previews#13781
Draft
maxwellpeterson wants to merge 1 commit into
Draft
feat(wrangler): add container support to worker previews#13781maxwellpeterson wants to merge 1 commit into
maxwellpeterson wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: aafe866 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
248f2f4 to
28b0ab1
Compare
28b0ab1 to
80b4aeb
Compare
Worker previews now support containers via a new `previews.containers`
configuration block. Container configuration is non-inheritable: declare
containers explicitly in the `previews` block to enable them for
previews, mirroring how `previews.durable_objects` works today. Preview
container application names are auto-generated by wrangler in the form
`{worker_name}_{preview_slug}_{class_name}` and are not user
configurable -- the config validator rejects entries that set a `name`
field. Container applications bound to Durable Object classes
implemented by another Worker (via `script_name`) are intentionally
skipped, since the implementing Worker owns its own container
application.
Container applications are created on `wrangler preview` and removed on
`wrangler preview delete`. Cleanup matches applications by their
auto-generated name prefix (`{worker_name}_{preview_slug}_`), so
deletions are scoped to the specific preview being torn down. Failures
on individual application deletes are logged as warnings but do not
block the preview deletion itself.
80b4aeb to
aafe866
Compare
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.
wrangler previewnow supports containers via a newpreviews.containersconfiguration block.Container configuration is non-inheritable: declare containers explicitly in the
previewsblock to enable them for previews, mirroring howpreviews.durable_objectsworks today. Preview container application names are auto-generated by wrangler in the form{worker_name}_{preview_slug}_{class_name}and are not user-configurable — the config validator rejects entries that set anamefield. Container applications bound to Durable Object classes implemented by another Worker (viascript_name) are intentionally skipped, since the implementing Worker owns its own container application.Container applications are created on
wrangler previewand removed onwrangler preview delete. Cleanup matches applications by their auto-generated name prefix ({worker_name}_{preview_slug}_), so deletions are scoped to the specific preview being torn down. Failures on individual application deletes are logged as warnings but do not block the preview deletion itself.This was originally part of #13712 and has been split out for easier review.