Part 1️⃣ of removing CfWorkerInit["bindings"]#12449
Conversation
🦋 Changeset detectedLatest commit: d83f2a2 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 |
CfWorkerInit["bindings"]
create-cloudflare
@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: |
| const bindings = ( | ||
| await convertBindingsToCfWorkerInitBindings(config.bindings) | ||
| ).bindings; | ||
| const doBindings = extractBindingsOfType( |
There was a problem hiding this comment.
super nit: i would swap the parameter order, to look alike bindings["durable_object_namespace"]
There was a problem hiding this comment.
That's a fair comment. I'm going to leave it for now because this is an existing function that's used in lots of different places, but that would be a good followup.
petebacondarwin
left a comment
There was a problem hiding this comment.
What is the bug in printBindings that is being fixed? If it is an actual bug, then this should have a changeset, no?
| }; | ||
|
|
||
| export type File = { | ||
| export type ParseFile = { |
There was a problem hiding this comment.
Why this rename? Is it because File is very general? You could say the same about Location and Message?
There was a problem hiding this comment.
Or another way of asking the question... why not reuse the File type that is defined in types.ts?
There was a problem hiding this comment.
Final weird comment: Do we even need to export Location and (Parse)File? We could just inline these into the Message type probably.
There was a problem hiding this comment.
The File type in types.ts is different, but was conflicting with this ParseFile type which is why I renamed it. It can't be inlined because it's referenced outside of Message, and it has to be exported or dts bundling breaks because TS can't find the symbol.
|
Claude finished @penalosa's task —— View job Changeset Review
✅ All changesets look good The changeset
The changeset clearly explains that unsafe metadata was incorrectly being displayed in the bindings table and is now properly displayed as a separate JSON block, which is indeed a bug fix warranting a patch version. |
First part of landing #12151 in stages. This part:
Bindingtype to@cloudflare/workers-utilsprintBindings()A picture of a cute animal (not mandatory, but encouraged)