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.18.13 to 0.19.12 #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fishylunar
Copy link
Owner

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


Snyk has created this PR to upgrade esbuild from 0.18.13 to 0.19.12.

ℹ️ 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 20 versions ahead of your current version.
  • The recommended version was released 22 days ago, on 2024-01-23.
Release notes
Package name: esbuild
  • 0.19.12 - 2024-01-23
    • The "preserve" JSX mode now preserves JSX text verbatim (#3605)

      The JSX specification deliberately doesn't specify how JSX text is supposed to be interpreted and there is no canonical way to interpret JSX text. Two most popular interpretations are Babel and TypeScript. Yes they are different (esbuild deliberately follows TypeScript by the way).

      Previously esbuild normalized text to the TypeScript interpretation when the "preserve" JSX mode is active. However, "preserve" should arguably reproduce the original JSX text verbatim so that whatever JSX transform runs after esbuild is free to interpret it however it wants. So with this release, esbuild will now pass JSX text through unmodified:

      // Original code
      let el =
      <a href={'/'} title='&apos;&quot;'> some text
      {foo}
      more text </a>

      // Old output (with --loader=jsx --jsx=preserve)
      let el = <a href="/" title={'"}>
      {" some text"}
      {foo}
      {"more text "}
      </a>;

      // New output (with --loader=jsx --jsx=preserve)
      let el = <a href={"/"} title='&apos;&quot;'> some text
      {foo}
      more text </a>;

    • Allow JSX elements as JSX attribute values

      JSX has an obscure feature where you can use JSX elements in attribute position without surrounding them with {...}. It looks like this:

      let el = <div data-ab=<><a/><b/></>/>;

      I think I originally didn't implement it even though it's part of the JSX specification because it previously didn't work in TypeScript (and potentially also in Babel?). However, support for it was silently added in TypeScript 4.8 without me noticing and Babel has also since fixed their bugs regarding this feature. So I'm adding it to esbuild too now that I know it's widely supported.

      Keep in mind that there is some ongoing discussion about removing this feature from JSX. I agree that the syntax seems out of place (it does away with the elegance of "JSX is basically just XML with {...} escapes" for something arguably harder to read, which doesn't seem like a good trade-off), but it's in the specification and TypeScript and Babel both implement it so I'm going to have esbuild implement it too. However, I reserve the right to remove it from esbuild if it's ever removed from the specification in the future. So use it with caution.

    • Fix a bug with TypeScript type parsing (#3574)

      This release fixes a bug with esbuild's TypeScript parser where a conditional type containing a union type that ends with an infer type that ends with a constraint could fail to parse. This was caused by the "don't parse a conditional type" flag not getting passed through the union type parser. Here's an example of valid TypeScript code that previously failed to parse correctly:

      type InferUnion<T> = T extends { a: infer U extends number } | infer U extends number ? U : never
  • 0.19.11 - 2023-12-29
    • Fix TypeScript-specific class transform edge case (#3559)

      The previous release introduced an optimization that avoided transforming super() in the class constructor for TypeScript code compiled with useDefineForClassFields set to false if all class instance fields have no initializers. The rationale was that in this case, all class instance fields are omitted in the output so no changes to the constructor are needed. However, if all of this is the case and there are #private instance fields with initializers, those private instance field initializers were still being moved into the constructor. This was problematic because they were being inserted before the call to super() (since super() is now no longer transformed in that case). This release introduces an additional optimization that avoids moving the private instance field initializers into the constructor in this edge case, which generates smaller code, matches the TypeScript compiler's output more closely, and avoids this bug:

      // Original code
      class Foo extends Bar {
      #private = 1;
      public: any;
      constructor() {
      super();
      }
      }

      // Old output (with esbuild v0.19.9)
      class Foo extends Bar {
      constructor() {
      super();
      this.#private = 1;
      }
      #private;
      }

      // Old output (with esbuild v0.19.10)
      class Foo extends Bar {
      constructor() {
      this.#private = 1;
      super();
      }
      #private;
      }

      // New output
      class Foo extends Bar {
      #private = 1;
      constructor() {
      super();
      }
      }

    • Minifier: allow reording a primitive past a side-effect (#3568)

      The minifier previously allowed reordering a side-effect past a primitive, but didn't handle the case of reordering a primitive past a side-effect. This additional case is now handled:

      // Original code
      function f() {
      let x = false;
      let y = x;
      const boolean = y;
      let frag = $.template(&lt;p contenteditable="<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">boolean</span><span class="pl-kos">}</span></span>"&gt;hello world&lt;/p&gt;);
      return frag;
      }

      // Old output (with --minify)
      function f(){const e=!1;return $.template(&lt;p contenteditable="<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">e</span><span class="pl-kos">}</span></span>"&gt;hello world&lt;/p&gt;)}

      // New output (with --minify)
      function f(){return $.template('<p contenteditable="false">hello world</p>')}

    • Minifier: consider properties named using known Symbol instances to be side-effect free (#3561)

      Many things in JavaScript can have side effects including property accesses and ToString operations, so using a symbol such as Symbol.iterator as a computed property name is not obviously side-effect free. This release adds a special case for known Symbol instances so that they are considered side-effect free when used as property names. For example, this class declaration will now be considered side-effect free:

      class Foo {
        *[Symbol.iterator]() {
        }
      }
    • Provide the stop() API in node to exit esbuild's child process (#3558)

      You can now call stop() in esbuild's node API to exit esbuild's child process to reclaim the resources used. It only makes sense to do this for a long-lived node process when you know you will no longer be making any more esbuild API calls. It is not necessary to call this to allow node to exit, and it's advantageous to not call this in between calls to esbuild's API as sharing a single long-lived esbuild child process is more efficient than re-creating a new esbuild child process for every API call. This API call used to exist but was removed in version 0.9.0. This release adds it back due to a user request.

  • 0.19.10 - 2023-12-19
    Read more
  • 0.19.9 - 2023-12-10
    Read more
  • 0.19.8 - 2023-11-26
    • Add a treemap chart to esbuild's bundle analyzer (#2848)

      The bundler analyzer on esbuild's website (https://esbuild.github.io/analyze/) now has a treemap chart type in addition to the two existing chart types (sunburst and flame). This should be more familiar for people coming from other similar tools, as well as make better use of large screens.

    • Allow decorators after the export keyword (#104)

      Previously esbuild's decorator parser followed the original behavior of TypeScript's experimental decorators feature, which only allowed decorators to come before the export keyword. However, the upcoming JavaScript decorators feature also allows decorators to come after the export keyword. And with TypeScript 5.0, TypeScript now also allows experimental decorators to come after the export keyword too. So esbuild now allows this as well:

      // This old syntax has always been permitted:
      @decorator export class Foo {}
      @decorator export default class Foo {}

      // This new syntax is now permitted too:
      export @decorator class Foo {}
      export default @decorator class Foo {}

      In addition, esbuild's decorator parser has been rewritten to fix several subtle and likely unimportant edge cases with esbuild's parsing of exports and decorators in TypeScript (e.g. TypeScript apparently does automatic semicolon insertion after interface and export interface but not after export default interface).

    • Pretty-print decorators using the same whitespace as the original

      When printing code containing decorators, esbuild will now try to respect whether the original code contained newlines after the decorator or not. This can make generated code containing many decorators much more compact to read:

      // Original code
      class Foo {
      @a @b @c abc
      @x @y @z xyz
      }

      // Old output
      class Foo {
      @a
      @b
      @c
      abc;
      @x
      @y
      @z
      xyz;
      }

      // New output
      class Foo {
      @a @b @c abc;
      @x @y @z xyz;
      }

  • 0.19.7 - 2023-11-21
    Read more
  • 0.19.6 - 2023-11-19
    Read more
  • 0.19.5 - 2023-10-17
    Read more
  • 0.19.4 - 2023-09-28
    Read more
  • 0.19.3 - 2023-09-14
    Read more
  • 0.19.2 - 2023-08-14
  • 0.19.1 - 2023-08-11
  • 0.19.0 - 2023-08-08
  • 0.18.20 - 2023-08-08
  • 0.18.19 - 2023-08-07
  • 0.18.18 - 2023-08-05
  • 0.18.17 - 2023-07-26
  • 0.18.16 - 2023-07-23
  • 0.18.15 - 2023-07-20
  • 0.18.14 - 2023-07-18
  • 0.18.13 - 2023-07-15
from esbuild GitHub release notes
Commit messages
Package name: esbuild
  • d7fd1ad publish 0.19.12 to npm
  • e04a690 fix #3605: print the original JSX AST unmodified
  • f571399 allow jsx elements as jsx attribute values
  • a652e73 run `make update-compat-table`
  • 35c0d65 fix #3574: ts type parser bug with infer + extends
  • f6eae0c fix #3569: incorrect ToInt32 behavior on riscv64
  • 6ee8225 publish 0.19.11 to npm
  • f8ae3af fix #3561: treeshaking of known `Symbol` instances
  • 0811058 switch define data to flags
  • f5f8ff8 fix #3568: can reorder primitive past side-effect
  • 914f608 fix #3558: put the `stop()` api call back
  • 2aa166b fix #3559: fix recent class transform regression
  • 55e1127 publish 0.19.10 to npm
  • d968af2 fix #3511: `@ __NO_SIDE_EFFECTS__` with templates
  • 00c4ebe fix #3546: don't transform `require` glob imports
  • e1b7050 fix #3319: missing symbol usage in glob transform
  • 461ca73 add the `@ esbuild/aix-ppc64` package for ibm aix (#3550)
  • 190ca99 truncate a long url in a comment
  • 6c41900 add Safari compat data for arbitrary module namespace names (#3520)
  • f38cbe6 fix #3552: calling `stop()` now clears go timeouts
  • 7a225ff make a few code edits from some random github bot
  • aa46b2c fix some build script comments
  • de99656 mention #3551 in the release notes
  • accfb14 fix: fix panic when optional chain partially replaced with defines (#3554)

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

sonarcloud bot commented Feb 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

2 participants