Bump esbuild from 0.16.14 to 0.17.5 #349

Closed
dependabot[bot] wants to merge 1 commit from dependabot/npm_and_yarn/esbuild-0.17.5 into master
dependabot[bot] commented 2023-01-30 11:06:28 +01:00 (Migrated from github.com)

Bumps esbuild from 0.16.14 to 0.17.5.

Release notes

Sourced from esbuild's releases.

v0.17.5

  • Parse const type parameters from TypeScript 5.0

    The TypeScript 5.0 beta announcement adds const type parameters to the language. You can now add the const modifier on a type parameter of a function, method, or class like this:

    type HasNames = { names: readonly string[] };
    const getNamesExactly = <const T extends HasNames>(arg: T): T["names"] => arg.names;
    const names = getNamesExactly({ names: ["Alice", "Bob", "Eve"] });
    

    The type of names in the above example is readonly ["Alice", "Bob", "Eve"]. Marking the type parameter as const behaves as if you had written as const at every use instead. The above code is equivalent to the following TypeScript, which was the only option before TypeScript 5.0:

    type HasNames = { names: readonly string[] };
    const getNamesExactly = <T extends HasNames>(arg: T): T["names"] => arg.names;
    const names = getNamesExactly({ names: ["Alice", "Bob", "Eve"] } as const);
    

    You can read the announcement for more information.

  • Make parsing generic async arrow functions more strict in .tsx files

    Previously esbuild's TypeScript parser incorrectly accepted the following code as valid:

    let fn = async <T> () => {};
    

    The official TypeScript parser rejects this code because it thinks it's the identifier async followed by a JSX element starting with <T>. So with this release, esbuild will now reject this syntax in .tsx files too. You'll now have to add a comma after the type parameter to get generic arrow functions like this to parse in .tsx files:

    let fn = async <T,> () => {};
    
  • Allow the in and out type parameter modifiers on class expressions

    TypeScript 4.7 added the in and out modifiers on the type parameters of classes, interfaces, and type aliases. However, while TypeScript supported them on both class expressions and class statements, previously esbuild only supported them on class statements due to an oversight. This release now allows these modifiers on class expressions too:

    declare let Foo: any;
    Foo = class <in T> { };
    Foo = class <out T> { };
    
  • Update enum constant folding for TypeScript 5.0

    TypeScript 5.0 contains an updated definition of what it considers a constant expression:

    An expression is considered a constant expression if it is

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.17.5

  • Parse const type parameters from TypeScript 5.0

    The TypeScript 5.0 beta announcement adds const type parameters to the language. You can now add the const modifier on a type parameter of a function, method, or class like this:

    type HasNames = { names: readonly string[] };
    const getNamesExactly = <const T extends HasNames>(arg: T): T["names"] => arg.names;
    const names = getNamesExactly({ names: ["Alice", "Bob", "Eve"] });
    

    The type of names in the above example is readonly ["Alice", "Bob", "Eve"]. Marking the type parameter as const behaves as if you had written as const at every use instead. The above code is equivalent to the following TypeScript, which was the only option before TypeScript 5.0:

    type HasNames = { names: readonly string[] };
    const getNamesExactly = <T extends HasNames>(arg: T): T["names"] => arg.names;
    const names = getNamesExactly({ names: ["Alice", "Bob", "Eve"] } as const);
    

    You can read the announcement for more information.

  • Make parsing generic async arrow functions more strict in .tsx files

    Previously esbuild's TypeScript parser incorrectly accepted the following code as valid:

    let fn = async <T> () => {};
    

    The official TypeScript parser rejects this code because it thinks it's the identifier async followed by a JSX element starting with <T>. So with this release, esbuild will now reject this syntax in .tsx files too. You'll now have to add a comma after the type parameter to get generic arrow functions like this to parse in .tsx files:

    let fn = async <T,> () => {};
    
  • Allow the in and out type parameter modifiers on class expressions

    TypeScript 4.7 added the in and out modifiers on the type parameters of classes, interfaces, and type aliases. However, while TypeScript supported them on both class expressions and class statements, previously esbuild only supported them on class statements due to an oversight. This release now allows these modifiers on class expressions too:

    declare let Foo: any;
    Foo = class <in T> { };
    Foo = class <out T> { };
    
  • Update enum constant folding for TypeScript 5.0

    TypeScript 5.0 contains an updated definition of what it considers a constant expression:

... (truncated)

Commits
  • a8b660d publish 0.17.5 to npm
  • 0c3642e fix constant folding bug with nested operands
  • be94d37 update enum constant folding for TypeScript 5.0
  • 73523d9 parse const type parameters from TypeScript 5.0
  • 3ada8f0 test coverage for async \<A, B> in typescript
  • 8824778 tsx: reject generic arrow functions without a ,
  • 1291b59 forbid definite assignment assertions on methods
  • 71b3ef9 allow in and out with class expression params
  • 3c83a84 publish 0.17.4 to npm
  • 2252232 support replacing dot identifier names with inject
  • Additional commits viewable in compare view

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.16.14 to 0.17.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/evanw/esbuild/releases">esbuild's releases</a>.</em></p> <blockquote> <h2>v0.17.5</h2> <ul> <li> <p>Parse <code>const</code> type parameters from TypeScript 5.0</p> <p>The TypeScript 5.0 beta announcement adds <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#const-type-parameters"><code>const</code> type parameters</a> to the language. You can now add the <code>const</code> modifier on a type parameter of a function, method, or class like this:</p> <pre lang="ts"><code>type HasNames = { names: readonly string[] }; const getNamesExactly = &lt;const T extends HasNames&gt;(arg: T): T[&quot;names&quot;] =&gt; arg.names; const names = getNamesExactly({ names: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;] }); </code></pre> <p>The type of <code>names</code> in the above example is <code>readonly [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;]</code>. Marking the type parameter as <code>const</code> behaves as if you had written <code>as const</code> at every use instead. The above code is equivalent to the following TypeScript, which was the only option before TypeScript 5.0:</p> <pre lang="ts"><code>type HasNames = { names: readonly string[] }; const getNamesExactly = &lt;T extends HasNames&gt;(arg: T): T[&quot;names&quot;] =&gt; arg.names; const names = getNamesExactly({ names: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;] } as const); </code></pre> <p>You can read <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#const-type-parameters">the announcement</a> for more information.</p> </li> <li> <p>Make parsing generic <code>async</code> arrow functions more strict in <code>.tsx</code> files</p> <p>Previously esbuild's TypeScript parser incorrectly accepted the following code as valid:</p> <pre lang="tsx"><code>let fn = async &lt;T&gt; () =&gt; {}; </code></pre> <p>The official TypeScript parser rejects this code because it thinks it's the identifier <code>async</code> followed by a JSX element starting with <code>&lt;T&gt;</code>. So with this release, esbuild will now reject this syntax in <code>.tsx</code> files too. You'll now have to add a comma after the type parameter to get generic arrow functions like this to parse in <code>.tsx</code> files:</p> <pre lang="tsx"><code>let fn = async &lt;T,&gt; () =&gt; {}; </code></pre> </li> <li> <p>Allow the <code>in</code> and <code>out</code> type parameter modifiers on class expressions</p> <p>TypeScript 4.7 added the <code>in</code> and <code>out</code> modifiers on the type parameters of classes, interfaces, and type aliases. However, while TypeScript supported them on both class expressions and class statements, previously esbuild only supported them on class statements due to an oversight. This release now allows these modifiers on class expressions too:</p> <pre lang="ts"><code>declare let Foo: any; Foo = class &lt;in T&gt; { }; Foo = class &lt;out T&gt; { }; </code></pre> </li> <li> <p>Update <code>enum</code> constant folding for TypeScript 5.0</p> <p>TypeScript 5.0 contains an <a href="https://github-redirect.dependabot.com/microsoft/TypeScript/pull/50528">updated definition of what it considers a constant expression</a>:</p> <blockquote> <p>An expression is considered a <em>constant expression</em> if it is</p> </blockquote> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/evanw/esbuild/blob/main/CHANGELOG.md">esbuild's changelog</a>.</em></p> <blockquote> <h2>0.17.5</h2> <ul> <li> <p>Parse <code>const</code> type parameters from TypeScript 5.0</p> <p>The TypeScript 5.0 beta announcement adds <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#const-type-parameters"><code>const</code> type parameters</a> to the language. You can now add the <code>const</code> modifier on a type parameter of a function, method, or class like this:</p> <pre lang="ts"><code>type HasNames = { names: readonly string[] }; const getNamesExactly = &lt;const T extends HasNames&gt;(arg: T): T[&quot;names&quot;] =&gt; arg.names; const names = getNamesExactly({ names: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;] }); </code></pre> <p>The type of <code>names</code> in the above example is <code>readonly [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;]</code>. Marking the type parameter as <code>const</code> behaves as if you had written <code>as const</code> at every use instead. The above code is equivalent to the following TypeScript, which was the only option before TypeScript 5.0:</p> <pre lang="ts"><code>type HasNames = { names: readonly string[] }; const getNamesExactly = &lt;T extends HasNames&gt;(arg: T): T[&quot;names&quot;] =&gt; arg.names; const names = getNamesExactly({ names: [&quot;Alice&quot;, &quot;Bob&quot;, &quot;Eve&quot;] } as const); </code></pre> <p>You can read <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#const-type-parameters">the announcement</a> for more information.</p> </li> <li> <p>Make parsing generic <code>async</code> arrow functions more strict in <code>.tsx</code> files</p> <p>Previously esbuild's TypeScript parser incorrectly accepted the following code as valid:</p> <pre lang="tsx"><code>let fn = async &lt;T&gt; () =&gt; {}; </code></pre> <p>The official TypeScript parser rejects this code because it thinks it's the identifier <code>async</code> followed by a JSX element starting with <code>&lt;T&gt;</code>. So with this release, esbuild will now reject this syntax in <code>.tsx</code> files too. You'll now have to add a comma after the type parameter to get generic arrow functions like this to parse in <code>.tsx</code> files:</p> <pre lang="tsx"><code>let fn = async &lt;T,&gt; () =&gt; {}; </code></pre> </li> <li> <p>Allow the <code>in</code> and <code>out</code> type parameter modifiers on class expressions</p> <p>TypeScript 4.7 added the <code>in</code> and <code>out</code> modifiers on the type parameters of classes, interfaces, and type aliases. However, while TypeScript supported them on both class expressions and class statements, previously esbuild only supported them on class statements due to an oversight. This release now allows these modifiers on class expressions too:</p> <pre lang="ts"><code>declare let Foo: any; Foo = class &lt;in T&gt; { }; Foo = class &lt;out T&gt; { }; </code></pre> </li> <li> <p>Update <code>enum</code> constant folding for TypeScript 5.0</p> <p>TypeScript 5.0 contains an <a href="https://github-redirect.dependabot.com/microsoft/TypeScript/pull/50528">updated definition of what it considers a constant expression</a>:</p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/evanw/esbuild/commit/a8b660d85a0a57087a0f188857519f194f52b84c"><code>a8b660d</code></a> publish 0.17.5 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/0c3642e7cd373ec902656e24c3a2c97fe15f4e44"><code>0c3642e</code></a> fix constant folding bug with nested operands</li> <li><a href="https://github.com/evanw/esbuild/commit/be94d3787f54a74ab6094b9e9fdebad482fef546"><code>be94d37</code></a> update <code>enum</code> constant folding for TypeScript 5.0</li> <li><a href="https://github.com/evanw/esbuild/commit/73523d9d0c814d70c5697352e4d632f50e558124"><code>73523d9</code></a> parse <code>const</code> type parameters from TypeScript 5.0</li> <li><a href="https://github.com/evanw/esbuild/commit/3ada8f020b5cea9d2862c99bfd3644b13b7910e9"><code>3ada8f0</code></a> test coverage for <code>async \&lt;A, B&gt;</code> in typescript</li> <li><a href="https://github.com/evanw/esbuild/commit/8824778ae14d1a9301751d5384d6d9bd6477f1f7"><code>8824778</code></a> tsx: reject generic arrow functions without a <code>,</code></li> <li><a href="https://github.com/evanw/esbuild/commit/1291b59286cb1ba3130bb8744993e230fe55bb64"><code>1291b59</code></a> forbid definite assignment assertions on methods</li> <li><a href="https://github.com/evanw/esbuild/commit/71b3ef96cd2d355c0377eba5f0e62941ef0536c2"><code>71b3ef9</code></a> allow <code>in</code> and <code>out</code> with class expression params</li> <li><a href="https://github.com/evanw/esbuild/commit/3c83a84d01e22664923b543998b5c03c0c5d8654"><code>3c83a84</code></a> publish 0.17.4 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/22522328c95203faea1e3fd0ea3a0bd7c285306b"><code>2252232</code></a> support replacing dot identifier names with inject</li> <li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.16.14...v0.17.5">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=esbuild&package-manager=npm_and_yarn&previous-version=0.16.14&new-version=0.17.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 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-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> 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) </details>
dependabot[bot] commented 2023-02-07 11:03:39 +01:00 (Migrated from github.com)

Superseded by #351.

Superseded by #351.
Commenting is not possible because the repository is archived.
No description provided.