fix: Support dev.plugin on typed services bindings#14269
Conversation
🦋 Changeset detectedLatest commit: a747dab The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
✅ All changesets look good |
|
There's no validation that I've completed a thorough review. The change is well-structured, well-tested, and the logic is correct:
I considered potential issues (type prefix handling, options serializability, remote+dev conflict, unknown property leakage) and none are actionable bugs. The LGTM |
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-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
petebacondarwin
left a comment
There was a problem hiding this comment.
Given that this is an internal only feature, hence no public documentation, I think we should name it something like unstable_dev to indicate that it is not to be relied upon.
Hmm... it sits on |
056b55d to
168aa4c
Compare
168aa4c to
3035a72
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
OK. Thanks for iterating. I agree we may as well leave the naming as it is.
I left one nit about the structure of the code in miniflare/index.ts, but we could always do a follow up to tidy that up if you want.
|
Codeowners approval required for this PR:
Show detailed file reviewers |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Wrangler only honored dev.plugin on unsafe.bindings entries, so users
authoring a service binding via services[] could not wire it to a local
Miniflare plugin during wrangler dev — they had to fall back to
unsafe.bindings and accept a 'directly supported by wrangler' warning. The
typed services[] form now accepts the same dev: { plugin, options? }
shape, routes the binding through Miniflare's external-plugin pathway in
wrangler dev, and strips the field at deploy time. Validation rejects
malformed dev shapes.
3035a72 to
a747dab
Compare
Wrangler previously only honored
dev.pluginonunsafe.bindingsentries, so users authoring a service binding viaservices[]could not wire it to a local Miniflare plugin duringwrangler dev— they had to fall back tounsafe.bindingsand accept a warning such as:The typed
services[]form now accepts the samedev: { plugin, options? }shape, routes the binding through Miniflare's external-plugin pathway inwrangler dev, and strips the field at deploy time. Validation rejects malformed dev shapes.Needed as a prerequisite to fixing https://jira.cfdata.org/browse/CC-7944
servicesbindings are already documented. This is just a fix for the equivalent ofCfUnsafeBinding.dev.pluginto work without requiring an unsafe binding.A picture of a cute animal (not mandatory, but encouraged)
