Skip to content

Fix Node global declarations in workers types - #7149

Open
xgame92 wants to merge 2 commits into
cloudflare:mainfrom
xgame92:xgame92/fix-workers-types-node-globals
Open

Fix Node global declarations in workers types#7149
xgame92 wants to merge 2 commits into
cloudflare:mainfrom
xgame92:xgame92/fix-workers-types-node-globals

Conversation

@xgame92

@xgame92 xgame92 commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #7026

Buffer, process, and global are also declared by @types/node using the var declaration kind. Emit the same declaration kind for those three names so TypeScript can merge the declarations, while preserving const for Workers and DOM globals.

Adds a transformer regression test covering the three Node globals and a non-Node control.

Testing:

  • Targeted transformer regression test: 1 passed, 0 failed
  • Linux types generator build: passed
  • Generated snapshot matches the Linux generator artifact

@xgame92

xgame92 commented Aug 27, 2026

Copy link
Copy Markdown
Author

Could a maintainer approve the workflow runs? The Linux check-snapshot artifact is needed to regenerate the types snapshot; the Bazel types target is marked incompatible on Windows because of rtti_capnp_js.

@xgame92
xgame92 marked this pull request as ready for review August 27, 2026 19:58
@xgame92
xgame92 requested a review from a team as a code owner August 27, 2026 19:58
@xgame92
xgame92 requested a review from emily-shen August 27, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workers-types declares Buffer and process as const, discarding the @types/node globals

1 participant