Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 11, 2022

Bumps esbuild from 0.14.48 to 0.14.49.

Release notes

Sourced from esbuild's releases.

v0.14.49

  • Keep inlined constants when direct eval is present (#2361)

    Version 0.14.19 of esbuild added inlining of certain const variables during minification, which replaces all references to the variable with the initializer and then removes the variable declaration. However, this could generate incorrect code when direct eval is present because the direct eval could reference the constant by name. This release fixes the problem by preserving the const variable declaration in this case:

    // Original code
    console.log((() => { const x = 123; return x + eval('x') }))
    // Old output (with --minify)
    console.log(()=>123+eval("x"));
    // New output (with --minify)
    console.log(()=>{const x=123;return 123+eval("x")});

  • Fix an incorrect error in TypeScript when targeting ES5 (#2375)

    Previously when compiling TypeScript code to ES5, esbuild could incorrectly consider the following syntax forms as a transformation error:

    0 ? ([]) : 1 ? ({}) : 2;

    The error messages looked like this:

    ✘ [ERROR] Transforming destructuring to the configured target environment ("es5") is not supported yet
    
    example.ts:1:5:
      1 │ 0 ? ([]) : 1 ? ({}) : 2;
        ╵      ^
    

    ✘ [ERROR] Transforming destructuring to the configured target environment ("es5") is not supported yet

    example.ts:1:16:
      1 │ 0 ? ([]) : 1 ? ({}) : 2;
        ╵                 ^
    

    These parenthesized literals followed by a colon look like the start of an arrow function expression followed by a TypeScript return type (e.g. ([]) : 1 could be the start of the TypeScript arrow function ([]): 1 => 1). Unlike in JavaScript, parsing arrow functions in TypeScript requires backtracking. In this case esbuild correctly determined that this expression wasn't an arrow function after all but the check for destructuring was incorrectly not covered under the backtracking process. With this release, the error message is now only reported if the parser successfully parses an arrow function without backtracking.

  • Fix generated TypeScript enum comments containing */ (#2369, #2371)

    TypeScript enum values that are equal to a number or string literal are inlined (references to the enum are replaced with the literal value) and have a /* ... */ comment after them with the original enum name to improve readability. However, this comment is omitted if the enum name contains the character sequence */ because that would end the comment early and cause a syntax error:

    // Original TypeScript
    enum Foo { '/*' = 1, '*/' = 2 }
    console.log(Foo['/*'], Foo['*/'])

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.14.49

  • Keep inlined constants when direct eval is present (#2361)

    Version 0.14.19 of esbuild added inlining of certain const variables during minification, which replaces all references to the variable with the initializer and then removes the variable declaration. However, this could generate incorrect code when direct eval is present because the direct eval could reference the constant by name. This release fixes the problem by preserving the const variable declaration in this case:

    // Original code
    console.log((() => { const x = 123; return x + eval('x') }))
    // Old output (with --minify)
    console.log(()=>123+eval("x"));
    // New output (with --minify)
    console.log(()=>{const x=123;return 123+eval("x")});

  • Fix an incorrect error in TypeScript when targeting ES5 (#2375)

    Previously when compiling TypeScript code to ES5, esbuild could incorrectly consider the following syntax forms as a transformation error:

    0 ? ([]) : 1 ? ({}) : 2;

    The error messages looked like this:

    ✘ [ERROR] Transforming destructuring to the configured target environment ("es5") is not supported yet
    
    example.ts:1:5:
      1 │ 0 ? ([]) : 1 ? ({}) : 2;
        ╵      ^
    

    ✘ [ERROR] Transforming destructuring to the configured target environment ("es5") is not supported yet

    example.ts:1:16:
      1 │ 0 ? ([]) : 1 ? ({}) : 2;
        ╵                 ^
    

    These parenthesized literals followed by a colon look like the start of an arrow function expression followed by a TypeScript return type (e.g. ([]) : 1 could be the start of the TypeScript arrow function ([]): 1 => 1). Unlike in JavaScript, parsing arrow functions in TypeScript requires backtracking. In this case esbuild correctly determined that this expression wasn't an arrow function after all but the check for destructuring was incorrectly not covered under the backtracking process. With this release, the error message is now only reported if the parser successfully parses an arrow function without backtracking.

  • Fix generated TypeScript enum comments containing */ (#2369, #2371)

    TypeScript enum values that are equal to a number or string literal are inlined (references to the enum are replaced with the literal value) and have a /* ... */ comment after them with the original enum name to improve readability. However, this comment is omitted if the enum name contains the character sequence */ because that would end the comment early and cause a syntax error:

    // Original TypeScript
    enum Foo { '/*' = 1, '*/' = 2 }

... (truncated)

Commits

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 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)

@dependabot dependabot bot requested a review from tclindner as a code owner July 11, 2022 23:02
@dependabot dependabot bot added the dependencies 📦 Pull requests that update a dependency file label Jul 11, 2022
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/esbuild-0.14.49 branch from b1f9406 to 8aad6e0 Compare July 16, 2022 13:08
@tclindner tclindner enabled auto-merge (squash) July 16, 2022 13:09
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/esbuild-0.14.49 branch 3 times, most recently from d376ea0 to 513be86 Compare July 16, 2022 13:26
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.14.48 to 0.14.49.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.14.48...v0.14.49)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/esbuild-0.14.49 branch from 513be86 to 7ad6c5d Compare July 16, 2022 13:31
@tclindner tclindner merged commit 19881c1 into master Jul 16, 2022
@tclindner tclindner deleted the dependabot/npm_and_yarn/esbuild-0.14.49 branch July 16, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies 📦 Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants