alexlafroscia / ember-esbuild

Ember tooling for ESBuild
12 stars 1 forks source link

chore(deps): bump esbuild from 0.8.9 to 0.11.2 #43

Closed dependabot[bot] closed 3 years ago

dependabot[bot] commented 3 years ago

Bumps esbuild from 0.8.9 to 0.11.2.

Release notes

Sourced from esbuild's releases.

v0.11.2

  • Fix missing symbol dependency for wrapped ESM files (#1086)

    An internal graph node was missing an edge, which could result in generating code that crashes at run-time when code splitting is enabled. Specifically a part containing an import statement must depend on the imported file's wrapper symbol if the imported file is wrapped, regardless of whether it's a wrapped CommonJS or ESM file. Previously this was only the case for CommonJS files but not for ESM files, which is incorrect. This bug has been fixed.

  • Fix an edge case with entry points and top-level await

    If an entry point uses import() on itself, it currently has to be wrapped since import() expressions call the wrapper for the imported file. This means the another call to the wrapper must be inserted at the bottom of the entry point file to start the lazy evaluation of the entry point code (otherwise nothing will be evaluated, since the entry point is wrapped). However, if this entry point then contains a top-level await that means the wrapper is async and must be passed to await to catch and forward any exceptions thrown during the evaluation of the entry point code. This await was previously missing in this specific case due to a bug, but the await should now be added in this release.

v0.11.1

  • Fix a missing space before internal import() when minifying (#1082)

    Internal import() of a CommonJS module inside the bundle turns into a call to Promise.resolve().then(() => require()). However, a space was not inserted before the Promise token when minifying, which could lead to a syntax error. This bug has been fixed.

  • Fix code generation for unused imported files without side effects (#1080)

    When esbuild adds a wrapping closure around a file to turn it from a statically-initialized file to a dynamically-initialized file, it also needs to turn import statements in other files that import the wrapped file into calls to the wrapper so that the wrapped file is initialized in the correct ordering. However, although tree-shaking is disabled for wrapped CommonJS files because CommonJS exports are dynamic, tree-shaking is still enabled for wrapped ESM files because ESM exports are static.

    This caused a bug when files that have been marked with "sideEffects": false end up being completely unused in the resulting bundle. In that case the file is removed entirely, but esbuild was still turning import statements to that file into calls to the ESM wrapper. These wrapper calls should instead be omitted if the file was completely removed from the bundle as dead code. This bug has been fixed.

  • Allow top-level await in supported environments

    Top-level await (i.e. using the await keyword outside of an async function) is not yet part of the JavaScript language standard. The feature proposal is still at stage 3 and has not yet advanced to stage 4. However, V8 has already implemented it and it has shipped in Chrome 89 and node 14.8. This release allows top-level await to be used when the --target= flag is set to those compilation targets.

  • Convert import() to require() if import() is not supported (#1084)

    This release now converts dynamic import() expressions into Promise.resolve().then(() => require()) expressions if the compilation target doesn't support them. This is the case for node before version 13.2, for example.

v0.11.0

This release contains backwards-incompatible changes. Since esbuild is before version 1.0.0, these changes have been released as a new minor version to reflect this (as recommended by npm). You should either be pinning the exact version of esbuild in your package.json file or be using a version range syntax that only accepts patch upgrades such as ~0.10.0. See the documentation about semver for more information.

The changes in this release mostly relate to how entry points are handled. The way output paths are generated has changed in some cases, so you may need to update how you refer to the output path for a given entry point when you update to this release (see below for details). These breaking changes are as follows:

  • Change how require() and import() of ESM works (#667, #706)

    Previously if you call require() on an ESM file, or call import() on an ESM file with code splitting disabled, esbuild would convert the ESM file to CommonJS. For example, if you had the following input files:

    // cjs-file.js
    console.log(require('./esm-file.js').foo)
    

    // esm-file.js export let foo = bar()

    The previous bundling behavior would generate something like this:

    var require_esm_file = __commonJS((exports) => {
      __markAsModule(exports);
    

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.11.2

  • Fix missing symbol dependency for wrapped ESM files (#1086)

    An internal graph node was missing an edge, which could result in generating code that crashes at run-time when code splitting is enabled. Specifically a part containing an import statement must depend on the imported file's wrapper symbol if the imported file is wrapped, regardless of whether it's a wrapped CommonJS or ESM file. Previously this was only the case for CommonJS files but not for ESM files, which is incorrect. This bug has been fixed.

  • Fix an edge case with entry points and top-level await

    If an entry point uses import() on itself, it currently has to be wrapped since import() expressions call the wrapper for the imported file. This means the another call to the wrapper must be inserted at the bottom of the entry point file to start the lazy evaluation of the entry point code (otherwise nothing will be evaluated, since the entry point is wrapped). However, if this entry point then contains a top-level await that means the wrapper is async and must be passed to await to catch and forward any exceptions thrown during the evaluation of the entry point code. This await was previously missing in this specific case due to a bug, but the await should now be added in this release.

0.11.1

  • Fix a missing space before internal import() when minifying (#1082)

    Internal import() of a CommonJS module inside the bundle turns into a call to Promise.resolve().then(() => require()). However, a space was not inserted before the Promise token when minifying, which could lead to a syntax error. This bug has been fixed.

  • Fix code generation for unused imported files without side effects (#1080)

    When esbuild adds a wrapping closure around a file to turn it from a statically-initialized file to a dynamically-initialized file, it also needs to turn import statements in other files that import the wrapped file into calls to the wrapper so that the wrapped file is initialized in the correct ordering. However, although tree-shaking is disabled for wrapped CommonJS files because CommonJS exports are dynamic, tree-shaking is still enabled for wrapped ESM files because ESM exports are static.

    This caused a bug when files that have been marked with "sideEffects": false end up being completely unused in the resulting bundle. In that case the file is removed entirely, but esbuild was still turning import statements to that file into calls to the ESM wrapper. These wrapper calls should instead be omitted if the file was completely removed from the bundle as dead code. This bug has been fixed.

  • Allow top-level await in supported environments

    Top-level await (i.e. using the await keyword outside of an async function) is not yet part of the JavaScript language standard. The feature proposal is still at stage 3 and has not yet advanced to stage 4. However, V8 has already implemented it and it has shipped in Chrome 89 and node 14.8. This release allows top-level await to be used when the --target= flag is set to those compilation targets.

  • Convert import() to require() if import() is not supported (#1084)

    This release now converts dynamic import() expressions into Promise.resolve().then(() => require()) expressions if the compilation target doesn't support them. This is the case for node before version 13.2, for example.

0.11.0

This release contains backwards-incompatible changes. Since esbuild is before version 1.0.0, these changes have been released as a new minor version to reflect this (as recommended by npm). You should either be pinning the exact version of esbuild in your package.json file or be using a version range syntax that only accepts patch upgrades such as ~0.10.0. See the documentation about semver for more information.

The changes in this release mostly relate to how entry points are handled. The way output paths are generated has changed in some cases, so you may need to update how you refer to the output path for a given entry point when you update to this release (see below for details). These breaking changes are as follows:

  • Change how require() and import() of ESM works (#667, #706)

    Previously if you call require() on an ESM file, or call import() on an ESM file with code splitting disabled, esbuild would convert the ESM file to CommonJS. For example, if you had the following input files:

    // cjs-file.js
    console.log(require('./esm-file.js').foo)
    

    // esm-file.js export let foo = bar()

    The previous bundling behavior would generate something like this:

... (truncated)

Commits
  • 5cf95a6 publish 0.11.2 to npm
  • 3a0da94 add another graph edge for "__exportStar"
  • 2c6fafb fix test non-determinism issue
  • 8206198 need to await async entry point esm wrappers
  • ae3ce46 fix #1086: add graph edge for wrapped esm import
  • 02ff418 publish 0.11.1 to npm
  • 1aaaec2 fix #1084: lower "import()" for older targets
  • 057daf9 allow top-level await in chrome 89 and node 14.8
  • 6cbfaca fix #1080: omit esm wrapper calls for dead files
  • e402940 fix #1082: missing space before "Promise" when minifying
  • Additional commits viewable in compare view


Dependabot compatibility score

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 will merge this PR once CI passes on it, as requested by @alexlafroscia.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will 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 version` will 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 dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)