fix(deps): update dependency esbuild to v0.15.10 #92
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.
This PR contains the following updates:
0.15.8->0.15.10Release Notes
evanw/esbuild
v0.15.10Compare Source
Add support for node's "pattern trailers" syntax (#2569)
After esbuild implemented node's
exportsfeature inpackage.json, node changed the feature to also allow text after*wildcards in patterns. Previously the*was required to be at the end of the pattern. It lets you do something like this:{ "exports": { "./features/*": "./features/*.js", "./features/*.js": "./features/*.js" } }With this release, esbuild now supports these types of patterns too.
Fix subpath imports with Yarn PnP (#2545)
Node has a little-used feature called subpath imports which are package-internal imports that start with
#and that go through theimportsmap inpackage.json. Previously esbuild had a bug that caused esbuild to not handle these correctly in packages installed via Yarn's "Plug'n'Play" installation strategy. The problem was that subpath imports were being checked after Yarn PnP instead of before. This release reorders these checks, which should allow subpath imports to work in this case.Link from JS to CSS in the metafile (#1861, #2565)
When you import CSS into a bundled JS file, esbuild creates a parallel CSS bundle next to your JS bundle. So if
app.tsimports some CSS files and you bundle it, esbuild will give youapp.jsandapp.css. You would then add both<script src="app.js"></script>and<link href="app.css" rel="stylesheet">to your HTML to include everything in the page. This approach is more efficient than having esbuild insert additional JavaScript intoapp.jsthat downloads and includesapp.cssbecause it means the browser can download and parse both the CSS and the JS in parallel (and potentially apply the CSS before the JS has even finished downloading).However, sometimes it's difficult to generate the
<link>tag. One case is when you've added[hash]to the entry names setting to include a content hash in the file name. Then the file name will look something likeapp-GX7G2SBE.cssand may change across subsequent builds. You can tell esbuild to generate build metadata using themetafileAPI option but the metadata only tells you which generated JS bundle corresponds to a JS entry point (via theentryPointproperty), not which file corresponds to the associated CSS bundle. Working around this was hacky and involved string manipulation.This release adds the
cssBundleproperty to the metafile to make this easier. It's present on the metadata for the generated JS bundle and points to the associated CSS bundle. So to generate the HTML tags for a given JS entry point, you first find the output file with theentryPointyou are looking for (and put that in a<script>tag), then check for thecssBundleproperty to find the associated CSS bundle (and put that in a<link>tag).One thing to note is that there is deliberately no
jsBundleproperty mapping the other way because it's not a 1:1 relationship. Two JS bundles can share the same CSS bundle in the case where the associated CSS bundles have the same name and content. In that case there would be no one value for a hypotheticaljsBundleproperty to have.v0.15.9Compare Source
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.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.