-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use
esbuild-plugins-node-modules-polyfill
- Loading branch information
1 parent
ca891e7
commit 38e08fc
Showing
7 changed files
with
60 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
"wrangler": major | ||
--- | ||
|
||
refactor: use `esbuild-plugins-node-modules-polyfill` | ||
|
||
Replaces `@esbuild-plugins/node-globals-polyfill` & `@esbuild-plugins/node-modules-polyfill` with the up-to-date & maintained `esbuild-plugins-node-modules-polyfill` | ||
|
||
The `esbuild-plugins` repository actually points towards using `esbuild-plugin-polyfill-node` instead | ||
https://github.com/remorses/esbuild-plugins/blob/373b44902ad3e669f7359c857de09a930ce1ce90/README.md?plain=1#L15-L16 | ||
|
||
But the Remix repo (see https://github.com/remix-run/remix/pull/5274) tried this and found some regressions. | ||
So they chose to go for @imranbarbhuiya's `esbuild-plugins-node-modules-polyfill` instead (see https://github.com/remix-run/remix/pull/6562), which is an up-to-date and well maintained alternative. | ||
|
||
Users should no longer see the following deprecation warnings when installing Wrangler: | ||
|
||
```sh | ||
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. | ||
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead | ||
``` | ||
|
||
Resolves https://github.com/cloudflare/workers-sdk/issues/1232 | ||
|
||
**Possible Breaking Change:** | ||
Since we are swapping out the entire polyfill library for a new one, there is a chance that projects using `node_compat` will experience regressions when trying to deploy. | ||
|
||
If you have such a Worker, ensure that you test it carefully before deploying when migrating from Wrangler v3 to Wrangler v4. |
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { define } from 'worktop.build'; | ||
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'; | ||
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill'; | ||
|
||
// @ts-ignore | ||
export default define({ | ||
modify(config) { | ||
config.plugins = config.plugins || []; | ||
config.plugins.push(NodeModulesPolyfillPlugin()); | ||
config.plugins.push(nodeModulesPolyfillPlugin()); | ||
}, | ||
}); |