Bump esbuild from 0.12.10 to 0.15.7
Bumps esbuild from 0.12.10 to 0.15.7.
Release notes
Sourced from esbuild's releases.
v0.15.7
Add
--watch=foreverto allow esbuild to never terminate (#1511, #1885)Currently using esbuild's watch mode via
--watchfrom the CLI will stop watching if stdin is closed. The rationale is that stdin is automatically closed by the OS when the parent process exits, so stopping watch mode when stdin is closed ensures that esbuild's watch mode doesn't keep running forever after the parent process has been closed. For example, it would be bad if you wrote a shell script that didesbuild --watch &to run esbuild's watch mode in the background, and every time you run the script it creates a newesbuildprocess that runs forever.However, there are cases when it makes sense for esbuild's watch mode to never exit. One such case is within a short-lived VM where the lifetime of all processes inside the VM is expected to be the lifetime of the VM. Previously you could easily do this by piping the output of a long-lived command into esbuild's stdin such as
sleep 999999999 | esbuild --watch &. However, this possibility often doesn't occur to people, and it also doesn't work on Windows. People also sometimes attempt to keep esbuild open by piping an infinite stream of data to esbuild such as withesbuild --watch </dev/zero &which causes esbuild to spin at 100% CPU. So with this release, esbuild now has a--watch=foreverflag that will not stop watch mode when stdin is closed.Work around
PATHwithoutnodein install script (#2519)Some people install esbuild's npm package in an environment without the
nodecommand in theirPATH. This fails on Windows because esbuild's install script runs theesbuildcommand before exiting as a sanity check, and on Windows theesbuildcommand has to be a JavaScript file because of some internal details about how npm handles thebinfolder (specifically theesbuildcommand lacks the.exeextension, which is required on Windows). This release attempts to work around this problem by usingprocess.execPathinstead of"node"as the command for running node. In theory this means the installer can now still function on Windows if something is wrong withPATH.v0.15.6
Lower
for awaitloops (#1930)This release lowers
for awaitloops to the equivalentforloop containingawaitwhen esbuild is configured such thatfor awaitloops are unsupported. This transform still requires at least generator functions to be supported since esbuild's lowering ofawaitcurrently relies on generators. This new transformation is mostly modeled after what the TypeScript compiler does. Here's an example:async function f() { for await (let x of y) x() }The code above will now become the following code with
--target=es2017(omitting the code for the__forAwaithelper function):async function f() { try { for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { let x = temp.value; x(); } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && await temp.call(iter); } finally { if (error) throw error[0]; } } }Automatically fix invalid
supportedconfigurations (#2497)The
--target=setting lets you tell esbuild to target a specific version of one or more JavaScript runtimes such aschrome80,node14and esbuild will restrict its output to only those features supported by all targeted JavaScript runtimes. More recently, esbuild introduced the--supported:setting that lets you override which features are supported on a per-feature basis. However, this now lets you configure nonsensical things such as--supported:async-await=false --supported:async-generator=true. Previously doing this could result in esbuild building successfully but producing invalid output.Starting with this release, esbuild will now attempt to automatically fix nonsensical feature override configurations by introducing more overrides until the configuration makes sense. So now the configuration from previous example will be changed such that
async-await=falseimpliesasync-generator=false. The full list of implications that were introduced is below:
... (truncated)
Changelog
Sourced from esbuild's changelog.
0.15.7
Add
--watch=foreverto allow esbuild to never terminate (#1511, #1885)Currently using esbuild's watch mode via
--watchfrom the CLI will stop watching if stdin is closed. The rationale is that stdin is automatically closed by the OS when the parent process exits, so stopping watch mode when stdin is closed ensures that esbuild's watch mode doesn't keep running forever after the parent process has been closed. For example, it would be bad if you wrote a shell script that didesbuild --watch &to run esbuild's watch mode in the background, and every time you run the script it creates a newesbuildprocess that runs forever.However, there are cases when it makes sense for esbuild's watch mode to never exit. One such case is within a short-lived VM where the lifetime of all processes inside the VM is expected to be the lifetime of the VM. Previously you could easily do this by piping the output of a long-lived command into esbuild's stdin such as
sleep 999999999 | esbuild --watch &. However, this possibility often doesn't occur to people, and it also doesn't work on Windows. People also sometimes attempt to keep esbuild open by piping an infinite stream of data to esbuild such as withesbuild --watch </dev/zero &which causes esbuild to spin at 100% CPU. So with this release, esbuild now has a--watch=foreverflag that will not stop watch mode when stdin is closed.Work around
PATHwithoutnodein install script (#2519)Some people install esbuild's npm package in an environment without the
nodecommand in theirPATH. This fails on Windows because esbuild's install script runs theesbuildcommand before exiting as a sanity check, and on Windows theesbuildcommand has to be a JavaScript file because of some internal details about how npm handles thebinfolder (specifically theesbuildcommand lacks the.exeextension, which is required on Windows). This release attempts to work around this problem by usingprocess.execPathinstead of"node"as the command for running node. In theory this means the installer can now still function on Windows if something is wrong withPATH.0.15.6
Lower
for awaitloops (#1930)This release lowers
for awaitloops to the equivalentforloop containingawaitwhen esbuild is configured such thatfor awaitloops are unsupported. This transform still requires at least generator functions to be supported since esbuild's lowering ofawaitcurrently relies on generators. This new transformation is mostly modeled after what the TypeScript compiler does. Here's an example:async function f() { for await (let x of y) x() }The code above will now become the following code with
--target=es2017(omitting the code for the__forAwaithelper function):async function f() { try { for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { let x = temp.value; x(); } } catch (temp) { error = [temp]; } finally { try { more && (temp = iter.return) && await temp.call(iter); } finally { if (error) throw error[0]; } } }Automatically fix invalid
supportedconfigurations (#2497)The
--target=setting lets you tell esbuild to target a specific version of one or more JavaScript runtimes such aschrome80,node14and esbuild will restrict its output to only those features supported by all targeted JavaScript runtimes. More recently, esbuild introduced the--supported:setting that lets you override which features are supported on a per-feature basis. However, this now lets you configure nonsensical things such as--supported:async-await=false --supported:async-generator=true. Previously doing this could result in esbuild building successfully but producing invalid output.
... (truncated)
Commits
c0b8a53publish 0.15.7 to npm976b57avalidateawaitin shorthand destructuring8ac7529tests: ignore new top-level await test262 testsdbd21a8tests: skip new features in test2627331a34ci: upgrade to yarn 3.2.3, enable more tests31e1ceeinstall script: tiny wasm tree-shaking improvement0438f64ci: run deno tests on windows7549073ci: pin deno version to avoid test flakes6a26f59tests: use unused test innode-unref-tests037ffbbtests: removesource-mapfromjs-api-tests- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)