chore(deps): update all non-major dev dependencies #1712
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:
4.2.22
->4.3.0
4.14.176
->4.14.178
3.2.5
->3.2.8
5.3.0
->5.9.1
5.3.0
->5.9.1
0.13.12
->0.14.11
8.2.0
->8.7.0
18.0.1
->18.1.1
9.1.3
->9.1.4
2.4.1
->2.5.1
0.3.3
->0.3.4
0.5.20
->0.5.21
4.4.4
->4.5.4
1.8.2
->1.9.5
5.62.1
->5.66.0
Release Notes
typescript-eslint/typescript-eslint (@typescript-eslint/eslint-plugin)
v5.9.1
Compare Source
Note: Version bump only for package @typescript-eslint/eslint-plugin
v5.9.0
Compare Source
Features
5.8.1 (2021-12-27)
Bug Fixes
v5.8.1
Compare Source
Bug Fixes
v5.8.0
Compare Source
Bug Fixes
type
StatementTypes can't differenciate from variable (#4270) (bfc4324)array-type
markAST_NODE_TYPES.TSBigIntKeyword
as simple (#4274) (74e544e)semi
(#4318) (3b87b49)Features
any
/unknown
(#4207) (ff0adf9)v5.7.0
Compare Source
Features
v5.6.0
Compare Source
Features
v5.5.0
Compare Source
Bug Fixes
node.source
(#4196) (637722a)Features
array-type
distinguish whether readonly or not (#4066) (314af44)v5.4.0
Compare Source
Bug Fixes
Features
5.3.1 (2021-11-08)
Note: Version bump only for package @typescript-eslint/eslint-plugin
v5.3.1
Compare Source
Note: Version bump only for package @typescript-eslint/eslint-plugin
typescript-eslint/typescript-eslint (@typescript-eslint/parser)
v5.9.1
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.9.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
5.8.1 (2021-12-27)
Note: Version bump only for package @typescript-eslint/parser
v5.8.1
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.8.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.7.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.6.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.5.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
v5.4.0
Compare Source
Note: Version bump only for package @typescript-eslint/parser
5.3.1 (2021-11-08)
Note: Version bump only for package @typescript-eslint/parser
v5.3.1
Compare Source
Note: Version bump only for package @typescript-eslint/parser
evanw/esbuild
v0.14.11
Compare Source
Fix a bug with enum inlining (#1903)
The new TypeScript enum inlining behavior had a bug where it worked correctly if you used
export enum Foo
but not if you usedenum Foo
and then laterexport { Foo }
. This release fixes the bug so enum inlining now works correctly in this case.Warn about
module.exports.foo = ...
in ESM (#1907)The
module
variable is treated as a global variable reference instead of as a CommonJS module reference in ESM code, which can cause problems for people that try to use both CommonJS and ESM exports in the same file. There has been a warning about this since version 0.14.9. However, the warning only covered cases likeexports.foo = bar
andmodule.exports = bar
but notmodule.exports.foo = bar
. This last case is now handled;Enable esbuild's CLI with Deno (#1913)
This release allows you to use Deno as an esbuild installer, without also needing to use esbuild's JavaScript API. You can now use esbuild's CLI with Deno:
v0.14.10
Compare Source
Enable tree shaking of classes with lowered static fields (#175)
If the configured target environment doesn't support static class fields, they are converted into a call to esbuild's
__publicField
function instead. However, esbuild's tree-shaking pass treated this call as a side effect, which meant that all classes with static fields were ineligible for tree shaking. This release fixes the problem by explicitly ignoring calls to the__publicField
function during tree shaking side-effect determination. Tree shaking is now enabled for these classes:Treat
--define:foo=undefined
as an undefined literal instead of an identifier (#1407)References to the global variable
undefined
are automatically replaced with the literal value for undefined, which appears asvoid 0
when printed. This allows for additional optimizations such as collapsingundefined ?? bar
into justbar
. However, this substitution was not done for values specified via--define:
. As a result, esbuild could potentially miss out on certain optimizations in these cases. With this release, it's now possible to use--define:
to substitute something with an undefined literal:Add the
--drop:debugger
flag (#1809)Passing this flag causes all
debugger;
statements to be removed from the output. This is similar to thedrop_debugger: true
flag available in the popular UglifyJS and Terser JavaScript minifiers.Add the
--drop:console
flag (#28)Passing this flag causes all
console.xyz()
API calls to be removed from the output. This is similar to thedrop_console: true
flag available in the popular UglifyJS and Terser JavaScript minifiers.WARNING: Using this flag can introduce bugs into your code! This flag removes the entire call expression including all call arguments. If any of those arguments had important side effects, using this flag will change the behavior of your code. Be very careful when using this flag. If you want to remove console API calls without removing arguments with side effects (which does not introduce bugs), you should mark the relevant API calls as pure instead like this:
--pure:console.log --minify
.Inline calls to certain no-op functions when minifying (#290, #907)
This release makes esbuild inline two types of no-op functions: empty functions and identity functions. These most commonly arise when most of the function body is eliminated as dead code. In the examples below, this happens because we use
--define:window.DEBUG=false
to cause dead code elimination inside the function body of the resultingif (false)
statement. This inlining is a small code size and performance win but, more importantly, it allows for people to use these features to add useful abstractions that improve the development experience without needing to worry about the run-time performance impact.An identity function is a function that just returns its argument. Here's an example of inlining an identity function:
An empty function is a function with an empty body. Here's an example of inlining an empty function:
To get this behavior you'll need to use the
function
keyword to define your function since that causes the definition to be hoisted, which eliminates concerns around initialization order. These features also work across modules, so functions are still inlined even if the definition of the function is in a separate module from the call to the function. To get cross-module function inlining to work, you'll need to have bundling enabled and use theimport
andexport
keywords to access the function so that esbuild can see which functions are called. And all of this has been added without an observable impact to compile times.I previously wasn't able to add this to esbuild easily because of esbuild's low-pass compilation approach. The compiler only does three full passes over the data for speed. The passes are roughly for parsing, binding, and printing. It's only possible to inline something after binding but it needs to be inlined before printing. Also the way module linking was done made it difficult to roll back uses of symbols that were inlined, so the symbol definitions were not tree shaken even when they became unused due to inlining.
The linking issue was somewhat resolved when I fixed #128 in the previous release. To implement cross-module inlining of TypeScript enums, I came up with a hack to defer certain symbol uses until the linking phase, which happens after binding but before printing. Another hack is that inlining of TypeScript enums is done directly in the printer to avoid needing another pass.
The possibility of these two hacks has unblocked these simple function inlining use cases that are now handled. This isn't a fully general approach because optimal inlining is recursive. Inlining something may open up further inlining opportunities, which either requires multiple iterations or a worklist algorithm, both of which don't work when doing late-stage inlining in the printer. But the function inlining that esbuild now implements is still useful even though it's one level deep, and so I believe it's still worth adding.
v0.14.9
Compare Source
Implement cross-module tree shaking of TypeScript enum values (#128)
If your bundle uses TypeScript enums across multiple files, esbuild is able to inline the enum values as long as you export and import the enum using the ES module
export
andimport
keywords. However, this previously still left the definition of the enum in the bundle even when it wasn't used anymore. This was because esbuild's tree shaking (i.e. dead code elimination) is based on information recorded during parsing, and at that point we don't know which imported symbols are inlined enum values and which aren't.With this release, esbuild will now remove enum definitions that become unused due to cross-module enum value inlining. Property accesses off of imported symbols are now tracked separately during parsing and then resolved during linking once all inlined enum values are known. This behavior change means esbuild's support for cross-module inlining of TypeScript enums is now finally complete. Here's an example:
Bundling the example code above now results in the enum definition being completely removed from the bundle:
Fix a regression with
export {} from
and CommonJS (#1890)This release fixes a regression that was introduced by the change in 0.14.7 that avoids calling the
__toESM
wrapper for import statements that are converted torequire
calls and that don't use thedefault
or__esModule
export names. The previous change was correct for theimport {} from
syntax but not for theexport {} from
syntax, which meant that in certain cases with re-exported values, the value of thedefault
import could be different than expected. This release fixes the regression.Warn about using
module
orexports
in ESM code (#1887)CommonJS export variables cannot be referenced in ESM code. If you do this, they are treated as global variables instead. This release includes a warning for people that try to use both CommonJS and ES module export styles in the same file. Here's an example:
Running esbuild on that code now generates a warning that looks like this:
v0.14.8
Compare Source
Add a
resolve
API for plugins (#641, #1652)Plugins now have access to a new API called
resolve
that runs esbuild's path resolution logic and returns the result to the caller. This lets you write plugins that can reuse esbuild's complex built-in path resolution logic to change the inputs and/or adjust the outputs. Here's an example:This plugin intercepts imports to the path
example
, tells esbuild to resolve the import./foo
in the directory/bar
, and then forces whatever path esbuild returns to be considered external. Here are some additional details:If you don't pass the optional
resolveDir
parameter, esbuild will still runonResolve
plugin callbacks but will not attempt any path resolution itself. All of esbuild's path resolution logic depends on theresolveDir
parameter including looking for packages innode_modules
directories (since it needs to know where thosenode_modules
directories might be).If you want to resolve a file name in a specific directory, make sure the input path starts with
./
. Otherwise the input path will be treated as a package path instead of a relative path. This behavior is identical to esbuild's normal path resolution logic.If path resolution fails, the
errors
property on the returned object will be a non-empty array containing the error information. This function does not always throw an error when it fails. You need to check for errors after calling it.The behavior of this function depends on the build configuration. That's why it's a property of the
build
object instead of being a top-level API call. This also means you can't call it until all pluginsetup
functions have finished since these give plugins the opportunity to adjust the build configuration before it's frozen at the start of the build. So the newresolve
function is going to be most useful inside youronResolve
and/oronLoad
callbacks.There is currently no attempt made to detect infinite path resolution loops. Calling
resolve
from withinonResolve
with the same parameters is almost certainly a bad idea.Avoid the CJS-to-ESM wrapper in some cases (#1831)
Import statements are converted into
require()
calls when the output format is set to CommonJS. To convert from CommonJS semantics to ES module semantics, esbuild wraps the return value in a call to esbuild's__toESM()
helper function. However, the conversion is only needed if it's possible that the exports nameddefault
or__esModule
could be accessed.This release avoids calling this helper function in cases where esbuild knows it's impossible for the
default
or__esModule
exports to be accessed, which results in smaller and faster code. To get this behavior, you have to use theimport {} from
import syntax:Strip overwritten function declarations when minifying (#610)
JavaScript allows functions to be re-declared, with each declaration overwriting the previous declaration. This type of code can sometimes be emitted by automatic code generators. With this release, esbuild now takes this behavior into account when minifying to drop all but the last declaration for a given function:
Add support for the Linux IBM Z 64-bit Big Endian platform (#1864)
With this release, the esbuild package now includes a Linux binary executable for the IBM System/390 64-bit architecture. This new platform was contributed by @shahidhs-ibm.
Allow whitespace around
:
in JSX elements (#1877)This release allows you to write the JSX
<rdf:Description rdf:ID="foo" />
as<rdf : Description rdf : ID="foo" />
instead. Doing this is not forbidden by the JSX specification. While this doesn't work in TypeScript, it does work with other JSX parsers in the ecosystem, so support for this has been added to esbuild.v0.14.7
Compare Source
Cross-module inlining of TypeScript
enum
constants (#128)This release adds inlining of TypeScript
enum
constants across separate modules. It activates when bundling is enabled and when the enum is exported via theexport
keyword and imported via theimport
keyword:The access to
Foo.Bar
will now be compiled into0 /* Bar */
even though the enum is defined in a separate file. This inlining was added without adding another pass (which would have introduced a speed penalty) by splitting the code for the inlining between the existing parsing and printing passes. Enum inlining is active whether or not you useenum
orconst enum
because it improves performance.To demonstrate the performance improvement, I compared the performance of the TypeScript compiler built by bundling the TypeScript compiler source code with esbuild before and after this change. The speed of the compiler was measured by using it to type check a small TypeScript code base. Here are the results:
tsc
As you can see, enum inlining gives around a 15% speedup, which puts the esbuild-bundled version at the same speed as the offical TypeScript compiler build (the
tsc
column)!The specifics of the benchmark aren't important here since it's just a demonstration of how enum inlining can affect performance. But if you're wondering, I type checked the Rollup code base using a work-in-progress branch of the TypeScript compiler that's part of the ongoing effort to convert their use of namespaces into ES modules.
Mark node built-in modules as having no side effects (#705)
This release marks node built-in modules such as
fs
as being side-effect free. That means unused imports to these modules are now removed when bundling, which sometimes results in slightly smaller code. For example:Note that these modules are only automatically considered side-effect when bundling for node, since they are only known to be side-effect free imports in that environment. However, you can customize this behavior with a plugin by returning
external: true
andsideEffects: false
in anonResolve
callback for whatever paths you want to be treated this way.Recover from a stray top-level
}
in CSS (#1876)This release fixes a bug where a stray
}
at the top-level of a CSS file would incorrectly truncate the remainder of the file in the output (although not without a warning). With this release, the remainder of the file is now still parsed and printed:This fix was contributed by @sbfaulkner.
v0.14.6
Compare Source
Fix a minifier bug with BigInt literals
Previously expression simplification optimizations in the minifier incorrectly assumed that numeric operators always return numbers. This used to be true but has no longer been true since the introduction of BigInt literals in ES2020. Now numeric operators can return either a number or a BigInt depending on the arguments. This oversight could potentially have resulted in behavior changes. For example, this code printed
false
before being minified andtrue
after being minified because esbuild shortened===
to==
under the false assumption that both operands were numbers:The type checking logic has been rewritten to take into account BigInt literals in this release, so this incorrect simplification is no longer applied.
Enable removal of certain unused template literals (#1853)
This release contains improvements to the minification of unused template literals containing primitive values:
This can arise when the template literals are nested inside of another function call that was determined to be unnecessary such as an unused call to a function marked with the
/* @​__PURE__ */
pragma.This release also fixes a bug with this transformation where minifying the unused expression
`foo ${bar}`
into"" + bar
changed the meaning of the expression. Template string interpolation always callstoString
while string addition may callvalueOf
instead. This unused expression is now minified to`${bar}`
, which is slightly longer but which avoids the behavior change.Allow
keyof
/readonly
/infer
in TypeScript index signatures (#1859)This release fixes a bug that prevented these keywords from being used as names in index signatures. The following TypeScript code was previously rejected, but is now accepted:
This fix was contributed by @magic-akari.
Avoid warning about
import.meta
if it's replaced (#1868)It's possible to replace the
import.meta
expression using the--define:
feature. Previously doing that still warned that theimport.meta
syntax was not supported when targeting ES5. With this release, there will no longer be a warning in this case.v0.14.5
Compare Source
Fix an issue with the publishing script
This release fixes a missing dependency issue in the publishing script where it was previously possible for the published binary executable to have an incorrect version number.
v0.14.4
Compare Source
Adjust esbuild's handling of
default
exports and the__esModule
marker (#532, #1591, #1719)This change requires some background for context. Here's the history to the best of my understanding:
When the ECMAScript module
import
/export
syntax was being developed, the CommonJS module format (used in Node.js) was already widely in use. Because of this the export name calleddefault
was given special a syntax. Instead of writingimport { default as foo } from 'bar'
you can just writeimport foo from 'bar'
. The idea was that when ECMAScript modules (a.k.a. ES modules) were introduced, you could import existing CommonJS modules using the new import syntax for compatibility. Since CommonJS module exports are dynamic while ES module exports are static, it's not generally possible to determine a CommonJS module's export names at module instantiation time since the code hasn't been evaluated yet. So the value ofmodule.exports
is just exported as thedefault
export and the specialdefault
import syntax gives you easy access tomodule.exports
(i.e.const foo = require('bar')
is the same asimport foo from 'bar'
).However, it took a while for ES module syntax to be supported natively by JavaScript runtimes, and people still wanted to start using ES module syntax in the meantime. The Babel JavaScript compiler let you do this. You could transform each ES module file into a CommonJS module file that behaved the same. However, this transformation has a problem: emulating the
import
syntax accurately as described above means thatexport default 0
andimport foo from 'bar'
will no longer line up when transformed to CommonJS. The codeexport default 0
turns intomodule.exports.default = 0
and the codeimport foo from 'bar'
turns intoconst foo = require('bar')
, meaningfoo
is0
before the transformation butfoo
is{ default: 0 }
after the transformation.To fix this, Babel sets the property
__esModule
to true as a signal to itself when it converts an ES module to a CommonJS module. Then, when importing adefault
export, it can know to use the value ofmodule.exports.default
instead ofmodule.exports
to make sure the behavior of the CommonJS modules correctly matches the behavior of the original ES modules. This fix has been widely adopted across the ecosystem and has made it into other tools such as TypeScript and even esbuild.However, when Node.js finally released their ES module implementation, they went with the original implementation where the
default
export is alwaysmodule.exports
, which broke compatibility with the existing ecosystem of ES modules that had been cross-compiled into CommonJS modules by Babel. You now have to either add or remove an additional.default
property depending on whether your code needs to run in a Node environment or in a Babel environment, which created an interoperability headache. In addition, JavaScript tools such as esbuild now need to guess whether you want Node-style or Babel-styledefault
imports. There's no way for a tool to know with certainty which one a given file is expecting and if your tool guesses wrong, your code will break.This release changes esbuild's heuristics around
default
exports and the__esModule
marker to attempt to improve compatibility with Webpack and Node, which is what most packages are tuned for. The behavior changes are as follows:Old behavior:
If an
import
statement is used to load a CommonJS file and a)module.exports
is an object, b)module.exports.__esModule
is truthy, and c) the propertydefault
exists inmodule.exports
, then esbuild would set thedefault
export tomodule.exports.default
(like Babel). Otherwise thedefault
export was set tomodule.exports
(like Node).If a
require
call is used to load an ES module file, the returned module namespace object had the__esModule
property set to true. This behaved as if the ES module had been converted to CommonJS via a Babel-compatible transformation.The
__esModule
marker could inconsistently appear on module namespace objects (i.e.import * as
) when writing pure ESM code. Specifically, if a module namespace object was matConfiguration
📅 Schedule: 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.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by WhiteSource Renovate. View repository job log here.