Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The need for this came up in the context of Remix. Since route files in a Remix app contain code for both server and client and go through separate esbuild pipelines, we need to allow imports from all Node builtins in the client build, even those that don't have any polyfills. We then rely on tree shaking to remove code from unused imports in the client bundle.
Right now we handle unpolyfilled Node builtins by marking them as
external
in our esbuild config, but this approach is causing other issues (remix-run/remix#5521). It also means that any unpolyfilled Node builtin imports are left in the client bundle and throw an error at runtime. This change would allow us to remove ourexternals
config and fix this issue.Status and versioning classification: