[wrangler] add tcp_handlers wrangler config section - #14995
Conversation
🦋 Changeset detectedLatest commit: 1cf6e86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@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: |
| | { json?: string } | ||
| | { pythonModule?: string } | ||
| | { pythonRequirement?: string } | ||
| | { obsoletePythonRequirement?: string } |
There was a problem hiding this comment.
🟡 Hand-written runtime config types still expose a removed R2 admin option, which would crash config serialization if used
The hand-written runtime config type still advertises the removed R2 admin binding option (r2Admin at packages/miniflare/src/runtime/config/workerd.ts:116) even though the generated encoder for it was renamed away in this change, so any code that sets it would crash while building the runtime configuration instead of being rejected up front.
Impact: A stale, unusable option remains advertised to callers, and using it would abort local development startup rather than fail cleanly.
Rename applied to python requirements but not to the R2 admin field
The regenerated Cap'n Proto bindings renamed r2Admin to obsolete0 (packages/miniflare/src/runtime/config/generated/workerd.ts:2391-2415), removing _initR2Admin/set r2Admin. encodeCapnpStruct() (packages/miniflare/src/runtime/config/index.ts:21-49) dispatches dynamically by key: an object-valued r2Admin entry would call anyStruct["_initR2Admin"](), which is now undefined. The parallel rename for pythonRequirement → obsoletePythonRequirement was propagated to the hand-written types (packages/miniflare/src/runtime/config/workerd.ts:100), but r2Admin was left in both Worker_Binding and Worker_Binding_Type unions. No current call site sets r2Admin, so this is latent rather than actively broken.
Prompt for agents
The regenerated Cap'n Proto bindings in packages/miniflare/src/runtime/config/generated/workerd.ts renamed the `r2Admin` union member to `obsolete0` (and `pythonRequirement` to `obsoletePythonRequirement`). This PR updated the hand-written mirror types in packages/miniflare/src/runtime/config/workerd.ts for the python requirement rename, but left `r2Admin?: ServiceDesignator` in the `Worker_Binding` union and `r2Admin?: Void` in `Worker_Binding_Type`. Since encodeCapnpStruct() dispatches dynamically on object keys, a config containing `r2Admin` would attempt to call a now-nonexistent `_initR2Admin` and throw. Update the hand-written types so they match the generated schema (either rename to `obsolete0` or drop the member entirely), keeping the two files in sync as documented in packages/miniflare/CONTRIBUTING.md.
Was this helpful? React with 👍 or 👎 to provide feedback.
This PR adds a
tcp_handlersconfig section, for the upcoming inbound TCP feature on Workers. It will configure workerd TCP listeners as implemented in cloudflare/workerd#6059It would have to be set in the wrangler config like this:
{ "tcp_handlers": [{ "port": 5432, "address": "127.0.0.1", // default }], }I'd love feedback on the
tcp_handlersname. Please also note that UDP handlers are planned, so if this name is merged, it would probably also mean adding audp_handlerssection in the future.connect()TCP inbound handler cloudflare-docs#32443A picture of a cute animal (not mandatory, but encouraged)