feat: add Flagship binding support#13139
Merged
petebacondarwin merged 39 commits intocloudflare:mainfrom Apr 10, 2026
Merged
Conversation
Add the Flagship binding to the shared config and type system: - Add flagship binding type to EnvironmentNonInheritable (environment.ts) - Add default value flagship: [] (config.ts) - Add friendly names, notInheritable() validation, and validateFlagshipBinding (validation.ts) - Add CfFlagship interface and CfWorkerInit.bindings.flagship field (worker.ts) - Add flagship to WorkerMetadataBinding and Binding union types (types.ts) - Add flagship case in mapWorkerMetadataBindings (map-worker-metadata-bindings.ts)
Create a new miniflare plugin for Flagship feature flag bindings: - New plugins/flagship/index.ts with zod schema, getBindings, getNodeBindings, and getServices (remote proxy only, no local simulation) - Register FLAGSHIP_PLUGIN in the PLUGINS object and WorkerOptions type
…elines Add Flagship binding support across the deployment and dev subsystems: - Add to getBindings() and createWorkerUploadForm() (deployment-bundle) - Wire through dev.ts, start-dev.ts, and miniflare/index.ts (dev wiring) - Add both convert functions in startDevWorker/utils.ts - Add CLI display in print-bindings.ts (always remote mode) - Add to ValidKeys exclusion in add-created-resource-config.ts - Add flagship: [] default in secret/index.ts draft worker
- Add flagship -> Flags type mapping in both type generation code paths so `wrangler types` emits FLAGS: Flags for configured flagship bindings - Add flagship:read and flagship:write to DefaultScopes for wrangler login
🦋 Changeset detectedLatest commit: 5ce25e1 The changes in this PR will be included in the next version bump. 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 |
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
…vice entry Match the pattern used by AI and VPC plugins — pass the potentially-undefined remoteProxyConnectionString through to remoteProxyClientWorker() which handles the undefined case gracefully, instead of short-circuiting with an empty return.
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
…nding Warn users who define flagship as an unsafe binding that it is directly supported by wrangler, matching the pattern of other safe binding types.
- Rename 'fs' to 'flagshipBinding' in type-generation to avoid shadowing - Fix formatting in worker.ts and type-generation/index.ts
Add flagship:read and flagship:write to inline snapshot expectations in user.test.ts (6), deploy/core.test.ts (2), and whoami.test.ts (3).
Member
Author
This is the current CI error, a simple re-run should fix it |
Contributor
Add flagship binding to bindingsConfigMock to satisfy the EnvironmentNonInheritable type constraint.
Update 3 inline snapshots that output the full generated Env interface to include the FLAGS: Flags binding from the flagship config mock.
83b02f1 to
7dd869f
Compare
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
9a5fe5f to
195176c
Compare
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
petebacondarwin
approved these changes
Apr 9, 2026
Contributor
petebacondarwin
left a comment
There was a problem hiding this comment.
Can you add tests for this binding configuration to packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts.
Can you add tests to miniflare for: getObjectValue, getObjectDetails, getStringDetails, and getNumberDetails.
workers-devprod
approved these changes
Apr 9, 2026
Contributor
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
- Add remote field to flagship config, types, and validation - Fix TS2304: destructure remote in print-bindings flagship map - Conditionally pass remoteProxyConnectionString based on remote flag - Remove unused config binding from flagship plugin worker - Update compatibilityDate to 2025-03-17
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Strip remote field from flagship bindings in config-diffs.ts - Add validation tests for flagship binding config - Add miniflare tests for getObjectValue, getObjectDetails, getStringDetails, and getNumberDetails
petebacondarwin
approved these changes
Apr 10, 2026
Merged
petebacondarwin
added a commit
that referenced
this pull request
Apr 13, 2026
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
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.
Summary
Add end-to-end support for the Flagship binding across
@cloudflare/workers-utils,miniflare, andwrangler.Corresponding
workerdPR: cloudflare/workerd#6456@cloudflare/workers-utils: Config schema, validation, default values,CfFlagshiptype,WorkerMetadataBinding/Bindingunion entries, and metadata binding mappingminiflare: New remote-only plugin (plugins/flagship/) with zod schema, proxy bindings, and remote proxy client wiringwrangler: Deployment bundle upload, dev wiring (miniflare options,convertConfigToBindings), CLI binding display, type generation (Flagstype in both code paths), OAuth scopes (flagship:read,flagship:write), and config-diffs support