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

[Snyk] Upgrade esbuild from 0.19.5 to 0.19.6 #255

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

bripkens
Copy link
Member

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade esbuild from 0.19.5 to 0.19.6.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 1 version ahead of your current version.
  • The recommended version was released 22 days ago, on 2023-11-19.
Release notes
Package name: esbuild
  • 0.19.6 - 2023-11-19
    • Fix a constant folding bug with bigint equality

      This release fixes a bug where esbuild incorrectly checked for bigint equality by checking the equality of the bigint literal text. This is correct if the bigint doesn't have a radix because bigint literals without a radix are always in canonical form (since leading zeros are not allowed). However, this is incorrect if the bigint has a radix (e.g. 0x123n) because the canonical form is not enforced when a radix is present.

      // Original code
      console.log(!!0n, !!1n, 123n === 123n)
      console.log(!!0x0n, !!0x1n, 123n === 0x7Bn)

      // Old output
      console.log(false, true, true);
      console.log(true, true, false);

      // New output
      console.log(false, true, true);
      console.log(!!0x0n, !!0x1n, 123n === 0x7Bn);

    • Add some improvements to the JavaScript minifier

      This release adds more cases to the JavaScript minifier, including support for inlining String.fromCharCode and String.prototype.charCodeAt when possible:

      // Original code
      document.onkeydown = e => e.keyCode === 'A'.charCodeAt(0) && console.log(String.fromCharCode(55358, 56768))

      // Old output (with --minify)
      document.onkeydown=o=>o.keyCode==="A".charCodeAt(0)&&console.log(String.fromCharCode(55358,56768));

      // New output (with --minify)
      document.onkeydown=o=>o.keyCode===65&&console.log("🧀");

      In addition, immediately-invoked function expressions (IIFEs) that return a single expression are now inlined when minifying. This makes it possible to use IIFEs in combination with @ __PURE__ annotations to annotate arbitrary expressions as side-effect free without the IIFE wrapper impacting code size. For example:

      // Original code
      const sideEffectFreeOffset = /* @ PURE */ (() => computeSomething())()
      use(sideEffectFreeOffset)

      // Old output (with --minify)
      const e=(()=>computeSomething())();use(e);

      // New output (with --minify)
      const e=computeSomething();use(e);

    • Automatically prefix the mask-composite CSS property for WebKit (#3493)

      The mask-composite property will now be prefixed as -webkit-mask-composite for older WebKit-based browsers. In addition to prefixing the property name, handling older browsers also requires rewriting the values since WebKit uses non-standard names for the mask composite modes:

      / Original code */
      div {
      mask-composite: add, subtract, intersect, exclude;
      }

      /* New output (with --target=chrome100) */
      div {
      -webkit-mask-composite:
      source-over,
      source-out,
      source-in,
      xor;
      mask-composite:
      add,
      subtract,
      intersect,
      exclude;
      }

    • Avoid referencing this from JSX elements in derived class constructors (#3454)

      When you enable --jsx=automatic and --jsx-dev, the JSX transform is supposed to insert this as the last argument to the jsxDEV function. I'm not sure exactly why this is and I can't find any specification for it, but in any case this causes the generated code to crash when you use a JSX element in a derived class constructor before the call to super() as this is not allowed to be accessed at that point. For example

      // Original code
      class ChildComponent extends ParentComponent {
      constructor() {
      super(<div />)
      }
      }

      // Problematic output (with --loader=jsx --jsx=automatic --jsx-dev)
      import { jsxDEV } from "react/jsx-dev-runtime";
      class ChildComponent extends ParentComponent {
      constructor() {
      super(/* @ PURE */ jsxDEV("div", {}, void 0, false, {
      fileName: "<stdin>",
      lineNumber: 3,
      columnNumber: 15
      }, this)); // The reference to "this" crashes here
      }
      }

      The TypeScript compiler doesn't handle this at all while the Babel compiler just omits this for the entire constructor (even after the call to super()). There seems to be no specification so I can't be sure that this change doesn't break anything important. But given that Babel is pretty loose with this and TypeScript doesn't handle this at all, I'm guessing this value isn't too important. React's blog post seems to indicate that this value was intended to be used for a React-specific migration warning at some point, so it could even be that this value is irrelevant now. Anyway the crash in this case should now be fixed.

    • Allow package subpath imports to map to node built-ins (#3485)

      You are now able to use a subpath import in your package to resolve to a node built-in module. For example, with a package.json file like this:

      {
        "type": "module",
        "imports": {
          "#stream": {
            "node": "stream",
            "default": "./stub.js"
          }
        }
      }

      You can now import from node's stream module like this:

      import * as stream from '#stream';
      console.log(Object.keys(stream));

      This will import from node's stream module when the platform is node and from ./stub.js otherwise.

    • No longer throw an error when a Symbol is missing (#3453)

      Certain JavaScript syntax features use special properties on the global Symbol object. For example, the asynchronous iteration syntax uses Symbol.asyncIterator. Previously esbuild's generated code for older browsers required this symbol to be polyfilled. However, starting with this release esbuild will use Symbol.for() to construct these symbols if they are missing instead of throwing an error about a missing polyfill. This means your code no longer needs to include a polyfill for missing symbols as long as your code also uses Symbol.for() for missing symbols.

    • Parse upcoming changes to TypeScript syntax (#3490, #3491)

      With this release, you can now use from as the name of a default type-only import in TypeScript code, as well as of as the name of an await using loop iteration variable:

      import type from from 'from'
      for (await using of of of) ;

      This matches similar changes in the TypeScript compiler (#56376 and #55555) which will start allowing this syntax in an upcoming version of TypeScript. Please never actually write code like this.

      The type-only import syntax change was contributed by @ magic-akari.

  • 0.19.5 - 2023-10-17
    Read more
from esbuild GitHub release notes
Commit messages
Package name: esbuild
  • 6073a3a publish 0.19.6 to npm
  • 19ff9d3 async arrow functions are not IIFEs
  • 9fa4e79 inline IIFEs that return a single expression
  • 6c4aa2c fix #3454: crash with jsx-dev before super() call
  • 4a1e576 fix #3467: `formatMessages` edge case perf hack
  • 20c2604 add some go tests for message formatting
  • 5271f82 silence new warnings within `node_modules`
  • 83e8c7f fix #3485: map subpath imports to node built-ins
  • 07e527d fix #3453: use `Symbol.for` for missing symbols
  • 50cead7 try adding a warning about suspicious uses of `=>`
  • e1dfdfc try adding a warning about suspicious uses of `??`
  • 478807e fix #3493: `-webkit-` prefix for `mask-composite`
  • 645734f fix the latest yarn breaking its own installation
  • 429da3d run `make update-compat-table`
  • c0860ca ci: update node 16 => 18 to fix yarn berry error
  • 7a697c0 allow `for (await using of of of) ;`
  • 08b4607 fix #3490, close #3491: `import type from from ""`
  • 7cb6e95 ci: update node 16 => 18 to fix yarn berry error
  • 4e11b50 formalize and expose the ToString operation
  • 24f87d2 minifier: support string in ToNumber conversion
  • 1cfd587 minifier: expand string concatenation with array
  • a84497e `.toString()` on number with a radix other than 10
  • fda70ee minifier: handle `.toString()` on primitives
  • 427ee60 js: avoid `NaN` and `Infinity` names inside `with`

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
otelbin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 8:42pm

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@marcelbirkner marcelbirkner merged commit c76cd21 into main Dec 11, 2023
8 checks passed
@marcelbirkner marcelbirkner deleted the snyk-upgrade-9f1479ae9c731b5303a6c66474ff7e50 branch December 11, 2023 20:42
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants