Bump esbuild from 0.15.5 to 0.15.9
Bumps esbuild from 0.15.5 to 0.15.9.
Release notes
Sourced from esbuild's releases.
v0.15.9
Fix an obscure npm package installation issue with
--omit=optional(#2558)The previous release introduced a regression with
npm install esbuild --omit=optionalwhere the filenode_modules/.bin/esbuildwould no longer be present after installation. That could cause any package scripts which used theesbuildcommand to no longer work. This release fixes the regression sonode_modules/.bin/esbuildshould now be present again after installation. This regression only affected people installing esbuild usingnpmwith either the--omit=optionalor--no-optionalflag, which is a somewhat unusual situation.More details:
The reason for this regression is due to some obscure npm implementation details. Since the Go compiler doesn't support trivial cross-compiling on certain Android platforms, esbuild's installer installs a WebAssembly shim on those platforms instead. In the previous release I attempted to simplify esbuild's WebAssembly shims to depend on the
esbuild-wasmpackage instead of including another whole copy of the WebAssembly binary (to make publishing faster and to save on file system space after installation). However, both theesbuildpackage and theesbuild-wasmpackage provide a binary calledesbuildand it turns out that addingesbuild-wasmas a nested dependency of theesbuildpackage (specificallyesbuildoptionally depends on@esbuild/android-armwhich depends onesbuild-wasm) caused npm to be confused about whatnode_modules/.bin/esbuildis supposed to be.It's pretty strange and unexpected that disabling the installation of optional dependencies altogether would suddenly cause an optional dependency's dependency to conflict with the top-level package. What happens under the hood is that if
--omit=optionalis present, npm attempts to uninstall theesbuild-wasmnested dependency at the end ofnpm install(even though theesbuild-wasmpackage was never installed due to--omit=optional). This uninstallation causesnode_modules/.bin/esbuildto be deleted.After doing a full investigation, I discovered that npm's handling of the
.bindirectory is deliberately very brittle. When multiple packages in the dependency tree put something in.binwith the same name, the end result is non-deterministic/random. What you get in.binmight be from one package, from the other package, or might be missing entirely. The workaround suggested by npm is to just avoid having two packages that put something in.binwith the same name. So this was fixed by making the@esbuild/android-armandesbuild-android-64packages each include another whole copy of the WebAssembly binary, which works because these packages don't put anything in.bin.v0.15.8
Fix JSX name collision edge case (#2534)
Code generated by esbuild could have a name collision in the following edge case:
- The JSX transformation mode is set to
automatic, which causesimportstatements to be inserted- An element uses a
{...spread}followed by akey={...}, which uses the legacycreateElementfallback imported fromreact- Another import uses a name that ends with
reactsuch as@remix-run/react- The output format has been set to CommonJS so that
importstatements are converted into require callsIn this case, esbuild previously generated two variables with the same name
import_react, like this:var import_react = require("react"); var import_react2 = require("@remix-run/react");That bug is fixed in this release. The code generated by esbuild no longer contains a name collision.
Fall back to WebAssembly on Android ARM (#1556, #1578, #2335, #2526)
Go's compiler supports trivial cross-compiling to almost all platforms without installing any additional software other than the Go compiler itself. This has made it very easy for esbuild to publish native binary executables for many platforms. However, it strangely doesn't support cross-compiling to Android ARM without installing the Android build tools.
So instead of publishing a native esbuild binary executable to npm, this release publishes a WebAssembly fallback build. This is essentially the same as the
esbuild-wasmpackage but it's installed automatically when you install theesbuildpackage on Android ARM. So packages that depend on theesbuildpackage should now work on Android ARM. This change has not yet been tested end-to-end because I don't have a 32-bit Android ARM device myself, but in theory it should work.This inherits the drawbacks of WebAssembly including significantly slower performance than native as well as potentially also more severe memory usage limitations and lack of certain features (e.g.
--serve). If you want to use a native binary executable of esbuild on Android ARM, you may be able to build it yourself from source after installing the Android build tools.Attempt to better support Yarn's
ignorePatternDatafeature (#2495)Part of resolving paths in a project using Yarn's Plug'n'Play feature involves evaluating a regular expression in the
ignorePatternDataproperty of.pnp.data.json. However, it turns out that the particular regular expressions generated by Yarn use some syntax that works with JavaScript regular expressions but that does not work with Go regular expressions.In this release, esbuild will now strip some of the the problematic syntax from the regular expression before compiling it, which should hopefully allow it to be compiled by Go's regular expression engine. The specific character sequences that esbuild currently strips are as follows:
(?!\.)(?!(?:^|\/)\.)(?!\.{1,2}(?:\/|$))(?!(?:^|\/)\.{1,2}(?:\/|$))
... (truncated)
Changelog
Sourced from esbuild's changelog.
0.15.9
Fix an obscure npm package installation issue with
--omit=optional(#2558)The previous release introduced a regression with
npm install esbuild --omit=optionalwhere the filenode_modules/.bin/esbuildwould no longer be present after installation. That could cause any package scripts which used theesbuildcommand to no longer work. This release fixes the regression sonode_modules/.bin/esbuildshould now be present again after installation. This regression only affected people installing esbuild usingnpmwith either the--omit=optionalor--no-optionalflag, which is a somewhat unusual situation.More details:
The reason for this regression is due to some obscure npm implementation details. Since the Go compiler doesn't support trivial cross-compiling on certain Android platforms, esbuild's installer installs a WebAssembly shim on those platforms instead. In the previous release I attempted to simplify esbuild's WebAssembly shims to depend on the
esbuild-wasmpackage instead of including another whole copy of the WebAssembly binary (to make publishing faster and to save on file system space after installation). However, both theesbuildpackage and theesbuild-wasmpackage provide a binary calledesbuildand it turns out that addingesbuild-wasmas a nested dependency of theesbuildpackage (specificallyesbuildoptionally depends on@esbuild/android-armwhich depends onesbuild-wasm) caused npm to be confused about whatnode_modules/.bin/esbuildis supposed to be.It's pretty strange and unexpected that disabling the installation of optional dependencies altogether would suddenly cause an optional dependency's dependency to conflict with the top-level package. What happens under the hood is that if
--omit=optionalis present, npm attempts to uninstall theesbuild-wasmnested dependency at the end ofnpm install(even though theesbuild-wasmpackage was never installed due to--omit=optional). This uninstallation causesnode_modules/.bin/esbuildto be deleted.After doing a full investigation, I discovered that npm's handling of the
.bindirectory is deliberately very brittle. When multiple packages in the dependency tree put something in.binwith the same name, the end result is non-deterministic/random. What you get in.binmight be from one package, from the other package, or might be missing entirely. The workaround suggested by npm is to just avoid having two packages that put something in.binwith the same name. So this was fixed by making the@esbuild/android-armandesbuild-android-64packages each include another whole copy of the WebAssembly binary, which works because these packages don't put anything in.bin.0.15.8
Fix JSX name collision edge case (#2534)
Code generated by esbuild could have a name collision in the following edge case:
- The JSX transformation mode is set to
automatic, which causesimportstatements to be inserted- An element uses a
{...spread}followed by akey={...}, which uses the legacycreateElementfallback imported fromreact- Another import uses a name that ends with
reactsuch as@remix-run/react- The output format has been set to CommonJS so that
importstatements are converted into require callsIn this case, esbuild previously generated two variables with the same name
import_react, like this:var import_react = require("react"); var import_react2 = require("@remix-run/react");That bug is fixed in this release. The code generated by esbuild no longer contains a name collision.
Fall back to WebAssembly on Android ARM (#1556, #1578, #2335, #2526)
Go's compiler supports trivial cross-compiling to almost all platforms without installing any additional software other than the Go compiler itself. This has made it very easy for esbuild to publish native binary executables for many platforms. However, it strangely doesn't support cross-compiling to Android ARM without installing the Android build tools.
So instead of publishing a native esbuild binary executable to npm, this release publishes a WebAssembly fallback build. This is essentially the same as the
esbuild-wasmpackage but it's installed automatically when you install theesbuildpackage on Android ARM. So packages that depend on theesbuildpackage should now work on Android ARM. This change has not yet been tested end-to-end because I don't have a 32-bit Android ARM device myself, but in theory it should work.This inherits the drawbacks of WebAssembly including significantly slower performance than native as well as potentially also more severe memory usage limitations and lack of certain features (e.g.
--serve). If you want to use a native binary executable of esbuild on Android ARM, you may be able to build it yourself from source after installing the Android build tools.Attempt to better support Yarn's
ignorePatternDatafeature (#2495)Part of resolving paths in a project using Yarn's Plug'n'Play feature involves evaluating a regular expression in the
ignorePatternDataproperty of.pnp.data.json. However, it turns out that the particular regular expressions generated by Yarn use some syntax that works with JavaScript regular expressions but that does not work with Go regular expressions.In this release, esbuild will now strip some of the the problematic syntax from the regular expression before compiling it, which should hopefully allow it to be compiled by Go's regular expression engine. The specific character sequences that esbuild currently strips are as follows:
(?!\.)(?!(?:^|\/)\.)
... (truncated)
Commits
085265apublish 0.15.9 to npmf84de90use a custom message for macOS architecture issuesba91ed1makefile: publish four at a time againe55f980addvalidateto clean02d3dedbuild all platforms in ci44c5417fix android arm package inmake cleaneb9de88additional platform target updates758d4e1fix #2558: removeesbuild-wasmpackage nestinga333130update platform targets8b3bb3bupdate wasm-napi-exit0 targets- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)