chore(deps): update dependency esbuild to ~0.14.44 #1074
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.14.43
->~0.14.44
Release Notes
evanw/esbuild
v0.14.44
Compare Source
Add a
copy
loader (#2255)You can configure the "loader" for a specific file extension in esbuild, which is a way of telling esbuild how it should treat that file. For example, the
text
loader means the file is imported as a string while thebinary
loader means the file is imported as aUint8Array
. If you want the imported file to stay a separate file, the only option was previously thefile
loader (which is intended to be similar to Webpack'sfile-loader
package). This loader copies the file to the output directory and imports the path to that output file as a string. This is useful for a web application because you can refer to resources such as.png
images by importing them for their URL. However, it's not helpful if you need the imported file to stay a separate file but to still behave the way it normally would when the code is run without bundling.With this release, there is now a new loader called
copy
that copies the loaded file to the output directory and then rewrites the path of the import statement orrequire()
call to point to the copied file instead of the original file. This will automatically add a content hash to the output name by default (which can be configured with the--asset-names=
setting). You can use this by specifyingcopy
for a specific file extension, such as with--loader:.png=copy
.Fix a regression in arrow function lowering (#2302)
This release fixes a regression with lowering arrow functions to function expressions in ES5. This feature was introduced in version 0.7.2 and regressed in version 0.14.30.
In JavaScript, regular
function
expressions treatthis
as an implicit argument that is determined by how the function is called, but arrow functions treatthis
as a variable that is captured in the closure from the surrounding lexical scope. This is emulated in esbuild by storing the value ofthis
in a variable before changing the arrow function into a function expression.However, the code that did this didn't treat
this
expressions as a usage of that generated variable. Version 0.14.30 began omitting unused generated variables, which caused the transformation ofthis
to break. This regression happened due to missing test coverage. With this release, the problem has been fixed:This fix was contributed by @nkeynes.
Allow entity names as define values (#2292)
The "define" feature allows you to replace certain expressions with certain other expressions at compile time. For example, you might want to replace the global identifier
IS_PRODUCTION
with the boolean valuetrue
when building for production. Previously the only expressions you could substitute in were either identifier expressions or anything that is valid JSON syntax. This limitation exists because supporting more complex expressions is more complex (for example, substituting in arequire()
call could potentially pull in additional files, which would need to be handled). With this release, you can now also now define something as a member expression chain of the formfoo.abc.xyz
.Implement package self-references (#2312)
This release implements a rarely-used feature in node where a package can import itself by name instead of using relative imports. You can read more about this feature here: https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name. For example, assuming the
package.json
in a given package looks like this:Then any module in that package can reference an export in the package itself:
Self-referencing is also available when using
require
, both in an ES module, and in a CommonJS one. For example, this code will also work:Add a warning for assigning to an import (#2319)
Import bindings are immutable in JavaScript, and assigning to them will throw an error. So instead of doing this:
You need to do something like this instead:
This is already an error if you try to bundle this code with esbuild. However, this was previously allowed silently when bundling is disabled, which can lead to confusion for people who don't know about this aspect of how JavaScript works. So with this release, there is now a warning when you do this:
This new warning can be turned off with
--log-override:assign-to-import=silent
if you don't want to see it.Implement
alwaysStrict
intsconfig.json
(#2264)This release adds
alwaysStrict
to the set of TypeScripttsconfig.json
configuration values that esbuild supports. When this is enabled, esbuild will forbid syntax that isn't allowed in strict mode and will automatically insert"use strict";
at the top of generated output files. This matches the behavior of the TypeScript compiler: https://www.typescriptlang.org/tsconfig#alwaysStrict.Configuration
📅 Schedule: Branch creation - "before 2am" (UTC), 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.