Skip to content

fix(builtins): move to generated node builtins fixture#157

Merged
wraithgar merged 3 commits intomainfrom
gar/builtins
Jan 6, 2026
Merged

fix(builtins): move to generated node builtins fixture#157
wraithgar merged 3 commits intomainfrom
gar/builtins

Conversation

@wraithgar
Copy link
Copy Markdown
Contributor

@wraithgar wraithgar commented Jan 5, 2026

This generates the node builtins from runtime instead of using pulling them from the runtime. It will allow this to work in a browser setting with no resolve fallbacks needing to be added.

Current questions with this approach:

  • How will we know to update this when node 26 comes out?
    • This is now accounted for and the way the test is setup will fail if we run in a node runtime that mismatches. It should also gracefully run in older node versions that don't have all the new modules.
  • How do we address builtin names from other runtimes (e.g. bun) [BUG] bun is a core module name #126

Alternatives:

  • Semver major change that requires builtins to be passed in
  • Pull this from require still but default to an empty array if it's missing
  • Do nothing and add guidance for folks using a bundler to add a resolve fallback.

Closes #124

Comment thread test/index.js Outdated
@hashtagchris
Copy link
Copy Markdown
Contributor

How will we know to update this when node 26 comes out?

We use template-oss and leverage Dependabot to update the CI to run for new major versions of node, right? Should we aim for that template-oss PR to fail if Node 26 introduces new builtin modules, so no one has to remember to revisit this package?

#110

@wraithgar
Copy link
Copy Markdown
Contributor Author

Other runtimes may need to be a "BYOB" (bring your own builtins) situation where you can pass in other builtins. If we go down that route we may want to export the current ones as an attribute off of this module so you can safely extend it from a well known location.

@hashtagchris
Copy link
Copy Markdown
Contributor

hashtagchris commented Jan 5, 2026

Other runtimes may need to be a "BYOB" (bring your own builtins) situation where you can pass in other builtins. If we go down that route we may want to export the current ones as an attribute off of this module so you can safely extend it from a well known location.

Do you base that on #126? I think it's asking for consistent responses across runtimes.

Would this BYOB feature be for registries other than npmjs.org? In the case where clients and third-parties use this package, I assume its used to detect early that the registry will reject a publish (currently, or in the near future).

Copy link
Copy Markdown
Contributor

@hashtagchris hashtagchris left a comment

Choose a reason for hiding this comment

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

Looks good as-is to me. I'm thinking the change in behavior for runtimes other than Nodejs doesn't warrant making this a breaking change.

@wraithgar wraithgar merged commit 78cc913 into main Jan 6, 2026
20 checks passed
@wraithgar wraithgar deleted the gar/builtins branch January 6, 2026 19:48
@github-actions github-actions Bot mentioned this pull request Jan 6, 2026
wraithgar pushed a commit that referenced this pull request Jan 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.0.2](v7.0.1...v7.0.2)
(2026-01-06)
### Bug Fixes
*
[`78cc913`](78cc913)
[#157](#157)
builtins: move to generated node builtins fixture (#157) (@wraithgar)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fengmk2 added a commit to voidzero-dev/vite-plus that referenced this pull request Jan 15, 2026
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.

[Feature Request] Browser compatible version

2 participants