-
Update JavaScript syntax feature compatibility tables (#1594)
Most JavaScript syntax feature compatibility data is able to be obtained automatically via https://kangax.github.io/compat-table/. However, they are missing data for quite a few new JavaScript features (see (kangax/compat-table#1034)) so data on these new features has to be added manually. This release manually adds a few new entries:
-
Top-level await
This feature lets you use
await
at the top level of a module, outside of anasync
function. Doing this holds up the entire module instantiation operation until the awaited expression is resolved or rejected. This release marks this feature as supported in Edge 89, Firefox 89, and Safari 15 (it was already marked as supported in Chrome 89 and Node 14.8). The data source for this is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await. -
Arbitrary module namespace identifier names
This lets you use arbitrary strings as module namespace identifier names as long as they are valid UTF-16 strings. An example is
export { x as "🍕" }
which can then be imported asimport { "🍕" as y } from "./example.js"
. This release marks this feature as supported in Firefox 87 (it was already marked as supported in Chrome 90 and Node 16). The data source for this is https://bugzilla.mozilla.org/show_bug.cgi?id=1670044.
I would also like to add data for Safari. They have recently added support for arbitrary module namespace identifier names (https://bugs.webkit.org/show_bug.cgi?id=217576) and
export * as
(https://bugs.webkit.org/show_bug.cgi?id=214379). However, I have no idea how to determine which Safari release these bugs correspond to so this compatibility data for Safari has been omitted. -
-
Avoid unnecessary additional log messages after the server is stopped (#1589)
There is a development server built in to esbuild which is accessible via the
serve()
API call. This returns a promise that resolves to an object with astop()
method that immediately terminates the development server. Previously calling this could cause esbuild to print stray log messages sincestop()
could cause plugins to be unregistered while a build is still in progress. With this release, callingstop()
no longer terminates the development server immediately. It now waits for any active builds to finish first so the builds are not interrupted and left in a confusing state. -
Fix an accidental dependency on Go ≥1.17.0 (#1585)
The source code of this release no longer uses the
math.MaxInt
constant that was introduced in Go version 1.17.0. This constant was preventing esbuild from being compiled on Go version <1.17.0. This fix was contributed by @davezuko.