FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prevent date-enabled Node.js compatibility from adding conflicting globals to generated runtime types by jamesopstad · Pull Request #15239 · cloudflare/workers-sdk · GitHub

Prevent date-enabled Node.js compatibility from adding conflicting globals to generated runtime types - #15239

Merged
jamesopstad merged 2 commits into
mainfrom
james/fix-runtime-types-nodejs-compat-date
Aug 18, 2026
Merged

Prevent date-enabled Node.js compatibility from adding conflicting globals to generated runtime types#15239
jamesopstad merged 2 commits into
mainfrom
james/fix-runtime-types-nodejs-compat-date

Conversation

Copy link
Copy Markdown
Contributor

Fixes #15215.

Prevent date-enabled Node.js compatibility from adding conflicting globals to generated runtime types

wrangler types now treats Node.js compatibility enabled by a compatibility date the same way as an explicit nodejs_compat flag. Node.js globals continue to come from @types/node instead of being generated as any declarations that override those types.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix

A picture of a cute animal (not mandatory, but encouraged)

changeset-bot Bot commented Aug 17, 2026
edited
Loading

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f44326

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

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

github-project-automation Bot moved this to Untriaged in workers-sdk Aug 17, 2026
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team August 17, 2026 12:17

workers-devprod commented Aug 17, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

ask-bonk Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

All imports are present. The changeset lists only wrangler as patch, which is correct — runtime-types is not a published package that end users depend on directly? Let me verify the changeset matches. The bot mentioned wrangler, vite-plugin, and vitest-pool-workers get bumped (via dependency). That's consistent.

Now let me consider the changeset scope. The changeset references runtime-types changes but only bumps wrangler. Per AGENTS.md, changesets should reference the public-facing package. wrangler is the user-facing tool for wrangler types, so this is correct.

Let me verify the logic once more for a potential real bug. The comment on line 87-89 still says "Ignore Node.js compatibility as there is currently no mechanism to generate these types dynamically." That's fine.

Let me think about whether pushing no_nodejs_compat_v2 alongside no_nodejs_compat could be redundant/conflicting in workerd. Per the resolveNodejsCompat docs (line 80-82): from the default-on date, "each must be turned off separately... with no_nodejs_compat and no_nodejs_compat_v2 respectively." So both are needed and valid. Correct.

The implementation is correct and well-tested. Let me do a final check — is there any scenario where a user explicitly passes no_nodejs_compat with a date >= 2026-08-04 (they've disabled node compat)? The filter removes it, then re-adds both opt-outs. Result is the same (node disabled). No regression. And the header retains the original flags for caching. Correct.

The code is correct, tests cover the main cases, imports are valid, and the changeset is appropriate. No actionable issues.

LGTM

github run

Copy link
Copy Markdown
Contributor

✅ All changesets look good

This comment was marked as resolved.

pkg-pr-new Bot commented Aug 17, 2026
edited
Loading

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15239

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15239

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15239

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15239

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15239

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15239

miniflare

npm i https://pkg.pr.new/miniflare@15239

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15239

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15239

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15239

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15239

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@15239

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15239

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15239

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15239

wrangler

npm i https://pkg.pr.new/wrangler@15239

commit: 8f44326

jamesopstad marked this pull request as draft August 17, 2026 12:22

This comment was marked as resolved.

This comment was marked as resolved.

jamesopstad force-pushed the james/fix-runtime-types-nodejs-compat-date branch from b78fbde to 161b461 Compare August 17, 2026 12:39
jamesopstad marked this pull request as ready for review August 17, 2026 12:39

petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is OK but a couple more code comments would help the future reader understand what is going on.

Comment thread packages/runtime-types/src/header.ts Outdated

workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Codeowners reviews satisfied

jamesopstad force-pushed the james/fix-runtime-types-nodejs-compat-date branch from 161b461 to 8f44326 Compare August 18, 2026 10:20

devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Devin Review found 1 new potential issue.

View 1 additional finding in Devin Review.

dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM 🙂

jamesopstad merged commit f431166 into main Aug 18, 2026
84 of 88 checks passed
jamesopstad deleted the james/fix-runtime-types-nodejs-compat-date branch August 18, 2026 10:56
github-project-automation Bot moved this from Untriaged to Done in workers-sdk Aug 18, 2026
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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

wrangler types emits declare const Buffer: any since v4.122.0, nullifying the @types/node Buffer interface

4 participants


Back | FazBrowse Home | New Git URL