build: update dev-dependency esbuild from 0.25.3 to 0.25.11 #24
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.25.3->0.25.11Release Notes
evanw/esbuild (esbuild)
v0.25.11Compare Source
Add support for
with { type: 'bytes' }imports (#4292)The import bytes proposal has reached stage 2.7 in the TC39 process, which means that although it isn't quite recommended for implementation, it's generally approved and ready for validation. Furthermore it has already been implemented by Deno and Webpack. So with this release, esbuild will also add support for this. It behaves exactly the same as esbuild's existing
binaryloader. Here's an example:Lower CSS media query range syntax (#3748, #4293)
With this release, esbuild will now transform CSS media query range syntax into equivalent syntax using
min-/max-prefixes for older browsers. For example, the following CSS:will be transformed like this with a target such as
--target=chrome100(or more specifically with--supported:media-range=falseif desired):v0.25.10Compare Source
Fix a panic in a minification edge case (#4287)
This release fixes a panic due to a null pointer that could happen when esbuild inlines a doubly-nested identity function and the final result is empty. It was fixed by emitting the value
undefinedin this case, which avoids the panic. This case must be rare since it hasn't come up until now. Here is an example of code that previously triggered the panic (which only happened when minifying):Fix
@supportsnested inside pseudo-element (#4265)When transforming nested CSS to non-nested CSS, esbuild is supposed to filter out pseudo-elements such as
::placeholderfor correctness. The CSS nesting specification says the following:However, it seems like this behavior is different for nested at-rules such as
@supports, which do work with pseudo-elements. So this release modifies esbuild's behavior to now take that into account:v0.25.9Compare Source
Better support building projects that use Yarn on Windows (#3131, #3663)
With this release, you can now use esbuild to bundle projects that use Yarn Plug'n'Play on Windows on drives other than the
C:drive. The problem was as follows:C:driveD:drive../..to get from the project directory to the cache directory..(soD:\..is justD:)Yarn works around this edge case by pretending Windows-style paths beginning with
C:\are actually Unix-style paths beginning with/C:/, so the../..path segments are able to navigate across drives inside Yarn's implementation. This was broken for a long time in esbuild but I finally got access to a Windows machine and was able to debug and fix this edge case. So you should now be able to bundle these projects with esbuild.Preserve parentheses around function expressions (#4252)
The V8 JavaScript VM uses parentheses around function expressions as an optimization hint to immediately compile the function. Otherwise the function would be lazily-compiled, which has additional overhead if that function is always called immediately as lazy compilation involves parsing the function twice. You can read V8's blog post about this for more details.
Previously esbuild did not represent parentheses around functions in the AST so they were lost during compilation. With this change, esbuild will now preserve parentheses around function expressions when they are present in the original source code. This means these optimization hints will not be lost when bundling with esbuild. In addition, esbuild will now automatically add this optimization hint to immediately-invoked function expressions. Here's an example:
Note that you do not want to wrap all function expressions in parentheses. This optimization hint should only be used for functions that are called on initial load. Using this hint for functions that are not called on initial load will unnecessarily delay the initial load. Again, see V8's blog post linked above for details.
Update Go from 1.23.10 to 1.23.12 (#4257, #4258)
This should have no effect on existing code as this version change does not change Go's operating system support. It may remove certain false positive reports (specifically CVE-2025-4674 and CVE-2025-47907) from vulnerability scanners that only detect which version of the Go compiler esbuild uses.
v0.25.8Compare Source
Fix another TypeScript parsing edge case (#4248)
This fixes a regression with a change in the previous release that tries to more accurately parse TypeScript arrow functions inside the
?:operator. The regression specifically involves parsing an arrow function containing a#privateidentifier inside the middle of a?:ternary operator inside a class body. This was fixed by propagating private identifier state into the parser clone used to speculatively parse the arrow function body. Here is an example of some affected code:Fix a regression with the parsing of source phase imports
The change in the previous release to parse source phase imports failed to properly handle the following cases:
Parsing for these cases should now be fixed. The first case was incorrectly treated as a syntax error because esbuild was expecting the second case. And the last case was previously allowed but is now forbidden. TypeScript hasn't added this feature yet so it remains to be seen whether the last case will be allowed, but it's safer to disallow it for now. At least Babel doesn't allow the last case when parsing TypeScript, and Babel was involved with the source phase import specification.
v0.25.7Compare Source
Parse and print JavaScript imports with an explicit phase (#4238)
This release adds basic syntax support for the
deferandsourceimport phases in JavaScript:deferThis is a stage 3 proposal for an upcoming JavaScript feature that will provide one way to eagerly load but lazily initialize imported modules. The imported module is automatically initialized on first use. Support for this syntax will also be part of the upcoming release of TypeScript 5.9. The syntax looks like this:
Note that this feature deliberately cannot be used with the syntax
import defer foo from "<specifier>"orimport defer { foo } from "<specifier>".sourceThis is a stage 3 proposal for an upcoming JavaScript feature that will provide another way to eagerly load but lazily initialize imported modules. The imported module is returned in an uninitialized state. Support for this syntax may or may not be a part of TypeScript 5.9 (see this issue for details). The syntax looks like this:
Note that this feature deliberately cannot be used with the syntax
import defer * as foo from "<specifier>"orimport defer { foo } from "<specifier>".This change only adds support for this syntax. These imports cannot currently be bundled by esbuild. To use these new features with esbuild's bundler, the imported paths must be external to the bundle and the output format must be set to
esm.Support optionally emitting absolute paths instead of relative paths (#338, #2082, #3023)
This release introduces the
--abs-paths=feature which takes a comma-separated list of situations where esbuild should use absolute paths instead of relative paths. There are currently three supported situations:code(comments and string literals),log(log message text and location info), andmetafile(the JSON build metadata).Using absolute paths instead of relative paths is not the default behavior because it means that the build results are no longer machine-independent (which means builds are no longer reproducible). Absolute paths can be useful when used with certain terminal emulators that allow you to click on absolute paths in the terminal text and/or when esbuild is being automatically invoked from several different directories within the same script.
Fix a TypeScript parsing edge case (#4241)
This release fixes an edge case with parsing an arrow function in TypeScript with a return type that's in the middle of a
?:ternary operator. For example:The
:token in the value assigned toxpairs with the?token, so it's not the start of a return type annotation. However, the first:token in the value assigned toyis the start of a return type annotation because after parsing the arrow function body, it turns out there's another:token that can be used to pair with the?token. This case is notable as it's the first TypeScript edge case that esbuild has needed a backtracking parser to parse. It has been addressed by a quick hack (cloning the whole parser) as it's a rare edge case and esbuild doesn't otherwise need a backtracking parser. Hopefully this is sufficient and doesn't cause any issues.Inline small constant strings when minifying
Previously esbuild's minifier didn't inline string constants because strings can be arbitrarily long, and this isn't necessarily a size win if the string is used more than once. Starting with this release, esbuild will now inline string constants when the length of the string is three code units or less. For example:
Note that esbuild's constant inlining only happens in very restrictive scenarios to avoid issues with TDZ handling. This change doesn't change when esbuild's constant inlining happens. It only expands the scope of it to include certain string literals in addition to numeric and boolean literals.
v0.25.6Compare Source
Fix a memory leak when
cancel()is used on a build context (#4231)Calling
rebuild()followed bycancel()in rapid succession could previously leak memory. The bundler uses a producer/consumer model internally, and the resource leak was caused by the consumer being termianted while there were still remaining unreceived results from a producer. To avoid the leak, the consumer now waits for all producers to finish before terminating.Support empty
:is()and:where()syntax in CSS (#4232)Previously using these selectors with esbuild would generate a warning. That warning has been removed in this release for these cases.
Improve tree-shaking of
trystatements in dead code (#4224)With this release, esbuild will now remove certain
trystatements if esbuild considers them to be within dead code (i.e. code that is known to not ever be evaluated). For example:Consider negated bigints to have no side effects
While esbuild currently considers
1,-1, and1nto all have no side effects, it didn't previously consider-1nto have no side effects. This is because esbuild does constant folding with numbers but not bigints. However, it meant that unused negative bigint constants were not tree-shaken. With this release, esbuild will now consider these expressions to also be side-effect free:Support a configurable delay in watch mode before rebuilding (#3476, #4178)
The
watch()API now takes adelayoption that lets you add a delay (in milliseconds) before rebuilding when a change is detected in watch mode. If you use a tool that regenerates multiple source files very slowly, this should make it more likely that esbuild's watch mode won't generate a broken intermediate build before the successful final build. This option is also available via the CLI using the--watch-delay=flag.This should also help avoid confusion about the
watch()API's options argument. It was previously empty to allow for future API expansion, which caused some people to think that the documentation was missing. It's no longer empty now that thewatch()API has an option.Allow mixed array for
entryPointsAPI option (#4223)The TypeScript type definitions now allow you to pass a mixed array of both string literals and object literals to the
entryPointsAPI option, such as['foo.js', { out: 'lib', in: 'bar.js' }]. This was always possible to do in JavaScript but the TypeScript type definitions were previously too restrictive.Update Go from 1.23.8 to 1.23.10 (#4204, #4207)
This should have no effect on existing code as this version change does not change Go's operating system support. It may remove certain false positive reports (specifically CVE-2025-4673 and CVE-2025-22874) from vulnerability scanners that only detect which version of the Go compiler esbuild uses.
Experimental support for esbuild on OpenHarmony (#4212)
With this release, esbuild now publishes the
@esbuild/openharmony-arm64npm package for OpenHarmony. It contains a WebAssembly binary instead of a native binary because Go doesn't currently support OpenHarmony. Node does support it, however, so in theory esbuild should now work on OpenHarmony through WebAssembly.This change was contributed by @hqzing.
v0.25.5Compare Source
Fix a regression with
browserinpackage.json(#4187)The fix to #4144 in version 0.25.3 introduced a regression that caused
browseroverrides specified inpackage.jsonto fail to override relative path names that end in a trailing slash. That behavior change affected the[email protected]package. This regression has been fixed, and now has test coverage.Add support for certain keywords as TypeScript tuple labels (#4192)
Previously esbuild could incorrectly fail to parse certain keywords as TypeScript tuple labels that are parsed by the official TypeScript compiler if they were followed by a
?modifier. These labels includedfunction,import,infer,new,readonly, andtypeof. With this release, these keywords will now be parsed correctly. Here's an example of some affected code:Add CSS prefixes for the
stretchsizing value (#4184)This release adds support for prefixing CSS declarations such as
div { width: stretch }. That CSS is now transformed into this depending on what the--target=setting includes:v0.25.4Compare Source
Add simple support for CORS to esbuild's development server (#4125)
Starting with version 0.25.0, esbuild's development server is no longer configured to serve cross-origin requests. This was a deliberate change to prevent any website you visit from accessing your running esbuild development server. However, this change prevented (by design) certain use cases such as "debugging in production" by having your production website load code from
localhostwhere the esbuild development server is running.To enable this use case, esbuild is adding a feature to allow Cross-Origin Resource Sharing (a.k.a. CORS) for simple requests. Specifically, passing your origin to the new
corsoption will now set theAccess-Control-Allow-Originresponse header when the request has a matchingOriginheader. Note that this currently only works for requests that don't send a preflightOPTIONSrequest, as esbuild's development server doesn't currently supportOPTIONSrequests.Some examples:
CLI:
JS:
Go:
The special origin
*can be used to allow any origin to access esbuild's development server. Note that this means any website you visit will be able to read everything served by esbuild.Pass through invalid URLs in source maps unmodified (#4169)
This fixes a regression in version 0.25.0 where
sourcesin source maps that form invalid URLs were not being passed through to the output. Version 0.25.0 changed the interpretation ofsourcesfrom file paths to URLs, which means that URL parsing can now fail. Previously URLs that couldn't be parsed were replaced with the empty string. With this release, invalid URLs insourcesshould now be passed through unmodified.Handle exports named
__proto__in ES modules (#4162, #4163)In JavaScript, the special property name
__proto__sets the prototype when used inside an object literal. Previously esbuild's ESM-to-CommonJS conversion didn't special-case the property name of exports named__proto__so the exported getter accidentally became the prototype of the object literal. It's unclear what this affects, if anything, but it's better practice to avoid this by using a computed property name in this case.This fix was contributed by @magic-akari.
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 is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.