Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump esbuild from 0.14.48 to 0.14.49 #66

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

dependabot[bot]
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)

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] <[email protected]>
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 11, 2022

The following labels could not be found: dependencies, npm.

@PacoVK PacoVK merged commit a54b03c into main Jul 11, 2022
@PacoVK PacoVK deleted the dependabot/npm_and_yarn/esbuild-0.14.49 branch July 11, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant