Skip to content

Conversation

@dependabot-preview
Copy link
Contributor

Bumps esbuild from 0.8.28 to 0.8.31.

Release notes

Sourced from esbuild's releases.

v0.8.31

  • Fix minification issue from previous release (#648)

    The minification optimization to omit certain continue and return statements when it's implied by control flow in version 0.8.29 caused a regression when the branch condition uses a hoisted function:

    if (fn()) return;
    ...
    function fn() {}

    In that case, transforming the code by inverting the condition and moving the following statements inside the branch is not valid because the function is no longer hoisted to above the branch condition. This release fixes the regression by avoiding this optimization in cases like this.

  • Add the option --sourcemap=both (#650)

    This new option puts the generated source map both an inline //# sourceMappingURL= data URL comment inside the output file and in an external file next to the output file. Using it is also possible with the transform API, which will cause it to return both an inline data URL comment in the code value and the source map JSON in the map value.

  • Tree-shake unused code with --format=iife (#639)

    When the output format is IIFE (which wraps the code in an immediately-invoked function expression), esbuild now assumes that it's safe to remove unused code. This is an assumption that esbuild always makes when bundling but that esbuild previously didn't make when not bundling. Now esbuild will remove code even when not bundling as long as the output format is IIFE.

    This is only done for the IIFE output format because people are currently using the other formats to compile "partial modules", meaning they expect to be able to append code to esbuild's output and have that appended code be able to reference unused code inside esbuild's output. So it's not safe for esbuild to remove unused code in those cases. The IIFE output format wraps everything in a closure so unused code is not exposed to the module-level scope. Appended code will not be able to access unused code inside the closure so that means it's safe to remove.

v0.8.30

  • Fix @jsx and @jsxFrag comments without trailing spaces

    The --jsx-factory and --jsx-fragment settings can be set on a per-file basis using // @jsx name or // @jsxFrag name comments. Comments of the form /* @jsx name */ or /* @jsxFrag name */ will also work. However, there was a bug where comments of the form /* @jsx name*/ or /* @jsxFrag name*/ (a multi-line comment without a trailing space at the end) did not work. This bug has been fixed, and you now no longer need a trailing space for multi-line comments.

  • Minification improvements

    • The expression before a switch statement is now folded into the value. This means fn(); switch (x) { ... } turns into switch (fn(), x) { ... }.

    • Uses of === and !== are converted to == or != if the types of both sides can easily be statically determined. This means (x & 1) === 0 turns into (x & 1) == 0.

    • Equality comparisons are removed if both sides are boolean and one side is a constant. This means !x === true turns into !x.

    • Certain unary and binary operators are now removed if unused. This means if (a() === b()) {} turns into a(), b();.

    • The comma operator is now extracted from certain expressions. This means (a, b) + c turns into a, b + c.

    • Minification now takes advantage of the left-associativity of certain operators. This means a && (b && c) turns into a && b && c.

    • Computed properties that are strings now become no longer computed. This means {['a']: b} turns into {a: b} and class { ['a'] = b } turns into class { a = b }.

    • Repeated if-jump statements are now merged. This means if (a) break; if (b) break; turns into if (a || b) break;.

  • Fix issues with nested source maps (#638)

    A nested source map happens when an input file has a valid //# sourceMappingURL= comment that points to a valid source map file. In that case, esbuild will read that source map and use it to map back to the original source code from the generated file. This only happens if you enable source map generation in esbuild via --sourcemap. This release fixes the following issues:

Changelog

Sourced from esbuild's changelog.

0.8.31

  • Fix minification issue from previous release (#648)

    The minification optimization to omit certain continue and return statements when it's implied by control flow in version 0.8.29 caused a regression when the branch condition uses a hoisted function:

    if (fn()) return;
    ...
    function fn() {}

    In that case, transforming the code by inverting the condition and moving the following statements inside the branch is not valid because the function is no longer hoisted to above the branch condition. This release fixes the regression by avoiding this optimization in cases like this.

  • Add the option --sourcemap=both (#650)

    This new option puts the generated source map both an inline //# sourceMappingURL= data URL comment inside the output file and in an external file next to the output file. Using it is also possible with the transform API, which will cause it to return both an inline data URL comment in the code value and the source map JSON in the map value.

  • Tree-shake unused code with --format=iife (#639)

    When the output format is IIFE (which wraps the code in an immediately-invoked function expression), esbuild now assumes that it's safe to remove unused code. This is an assumption that esbuild always makes when bundling but that esbuild previously didn't make when not bundling. Now esbuild will remove code even when not bundling as long as the output format is IIFE.

    This is only done for the IIFE output format because people are currently using the other formats to compile "partial modules", meaning they expect to be able to append code to esbuild's output and have that appended code be able to reference unused code inside esbuild's output. So it's not safe for esbuild to remove unused code in those cases. The IIFE output format wraps everything in a closure so unused code is not exposed to the module-level scope. Appended code will not be able to access unused code inside the closure so that means it's safe to remove.

0.8.30

  • Fix @jsx and @jsxFrag comments without trailing spaces

    The --jsx-factory and --jsx-fragment settings can be set on a per-file basis using // @jsx name or // @jsxFrag name comments. Comments of the form /* @jsx name */ or /* @jsxFrag name */ will also work. However, there was a bug where comments of the form /* @jsx name*/ or /* @jsxFrag name*/ (a multi-line comment without a trailing space at the end) did not work. This bug has been fixed, and you now no longer need a trailing space for multi-line comments.

  • Minification improvements

    • The expression before a switch statement is now folded into the value. This means fn(); switch (x) { ... } turns into switch (fn(), x) { ... }.

    • Uses of === and !== are converted to == or != if the types of both sides can easily be statically determined. This means (x & 1) === 0 turns into (x & 1) == 0.

    • Equality comparisons are removed if both sides are boolean and one side is a constant. This means !x === true turns into !x.

    • Certain unary and binary operators are now removed if unused. This means if (a() === b()) {} turns into a(), b();.

    • The comma operator is now extracted from certain expressions. This means (a, b) + c turns into a, b + c.

    • Minification now takes advantage of the left-associativity of certain operators. This means a && (b && c) turns into a && b && c.

    • Computed properties that are strings now become no longer computed. This means {['a']: b} turns into {a: b} and class { ['a'] = b } turns into class { a = b }.

    • Repeated if-jump statements are now merged. This means if (a) break; if (b) break; turns into if (a || b) break;.

  • Fix issues with nested source maps (#638)

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 badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in the .dependabot/config.yml file in this repo:

  • Update frequency
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added the dependencies This issue is a problem in a dependency or a pull request that updates a dependency file. label Jan 7, 2021
@gitpod-io
Copy link

gitpod-io bot commented Jan 7, 2021

@mergify
Copy link
Contributor

mergify bot commented Jan 7, 2021

Thanks Dependabot!

@mergify mergify bot merged commit dddb589 into master Jan 7, 2021
@mergify mergify bot deleted the dependabot/npm_and_yarn/esbuild-0.8.31 branch January 7, 2021 02:45
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 6c68ba7
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies This issue is a problem in a dependency or a pull request that updates a dependency file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant