Update dependency esbuild to v0.18.13 #247
Merged
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.18.11
->0.18.13
Release Notes
evanw/esbuild (esbuild)
v0.18.13
Compare Source
Add the
--drop-labels=
option (#2398)If you want to conditionally disable some development-only code and have it not be present in the final production bundle, right now the most straightforward way of doing this is to use the
--define:
flag along with a specially-named global variable. For example, consider the following code:You can build this for development and production like this:
esbuild --define:DEV=true
esbuild --define:DEV=false
One drawback of this approach is that the resulting code crashes if you don't provide a value for
DEV
with--define:
. In practice this isn't that big of a problem, and there are also various ways to work around this.However, another approach that avoids this drawback is to use JavaScript label statements instead. That's what the
--drop-labels=
flag implements. For example, consider the following code:With this release, you can now build this for development and production like this:
esbuild
esbuild --drop-labels=DEV
This means that code containing optional development-only checks can now be written such that it's safe to run without any additional configuration. The
--drop-labels=
flag takes comma-separated list of multiple label names to drop.Avoid causing
unhandledRejection
during shutdown (#3219)All pending esbuild JavaScript API calls are supposed to fail if esbuild's underlying child process is unexpectedly terminated. This can happen if
SIGINT
is sent to the parentnode
process with Ctrl+C, for example. Previously doing this could also cause an unhandled promise rejection when esbuild attempted to communicate this failure to its own child process that no longer exists. This release now swallows this communication failure, which should prevent this internal unhandled promise rejection. This change means that you can now use esbuild's JavaScript API with a customSIGINT
handler that extends the lifetime of thenode
process without esbuild's internals causing an early exit due to an unhandled promise rejection.Update browser compatibility table scripts
The scripts that esbuild uses to compile its internal browser compatibility table have been overhauled. Briefly:
caniuse-lite
and@mdn/browser-compat-data
as new data sources (replacing manually-copied information)This change means it's now much easier to keep esbuild's internal compatibility tables up to date. You can review the table changes here if you need to debug something about this change:
v0.18.12
Compare Source
Fix a panic with
const enum
inside parentheses (#3205)This release fixes an edge case where esbuild could potentially panic if a TypeScript
const enum
statement was used inside of a parenthesized expression and was followed by certain other scope-related statements. Here's a minimal example that triggers this edge case:Allow a newline in the middle of TypeScript
export type
statement (#3225)Previously esbuild incorrectly rejected the following valid TypeScript code:
Code that uses a newline after
export type
is now allowed starting with this release.Fix cross-module inlining of string enums (#3210)
A refactoring typo in version 0.18.9 accidentally introduced a regression with cross-module inlining of string enums when combined with computed property accesses. This regression has been fixed.
Rewrite
.js
to.ts
inside packages withexports
(#3201)Packages with the
exports
field are supposed to disable node's path resolution behavior that allows you to import a file with a different extension than the one in the source code (for example, importingfoo/bar
to getfoo/bar.js
). And TypeScript has behavior where you can import a non-existent.js
file and you will get the.ts
file instead. Previously the presence of theexports
field caused esbuild to disable all extension manipulation stuff which included both node's implicit file extension searching and TypeScript's file extension swapping. However, TypeScript appears to always apply file extension swapping even in this case. So with this release, esbuild will now rewrite.js
to.ts
even inside packages withexports
.Fix a redirect edge case in esbuild's development server (#3208)
The development server canonicalizes directory URLs by adding a trailing slash. For example, visiting
/about
redirects to/about/
if/about/index.html
would be served. However, if the requested path begins with two slashes, then the redirect incorrectly turned into a protocol-relative URL. For example, visiting//about
redirected to//about/
which the browser turns intohttp://about/
. This release fixes the bug by canonicalizing the URL path when doing this redirect.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.