Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps-dev): Bump esbuild from 0.18.6 to 0.18.7 (#6761)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.18.6 to 0.18.7. <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.18.7</h2> <ul> <li> <p>Add support for <code>using</code> declarations in TypeScript 5.2+ (<a href="https://redirect.github.com/evanw/esbuild/issues/3191">#3191</a>)</p> <p>TypeScript 5.2 (due to be released in August of 2023) will introduce <code>using</code> declarations, which will allow you to automatically dispose of the declared resources when leaving the current scope. You can read the <a href="https://redirect.github.com/microsoft/TypeScript/pull/54505">TypeScript PR for this feature</a> for more information. This release of esbuild adds support for transforming this syntax to target environments without support for <code>using</code> declarations (which is currently all targets other than <code>esnext</code>). Here's an example (helper functions are omitted):</p> <pre lang="js"><code>// Original code class Foo { [Symbol.dispose]() { console.log('cleanup') } } using foo = new Foo; foo.bar(); <p>// New output (with --target=es6) var _stack = []; try { var Foo = class { <a href="">Symbol.dispose</a> { console.log("cleanup"); } }; var foo = __using(<em>stack, new Foo()); foo.bar(); } catch (</em>) { var _error = _, _hasError = true; } finally { __callDispose(_stack, _error, _hasError); } </code></pre></p> <p>The injected helper functions ensure that the method named <code>Symbol.dispose</code> is called on <code>new Foo</code> when control exits the scope. Note that as with all new JavaScript APIs, you'll need to polyfill <code>Symbol.dispose</code> if it's not present before you use it. This is not something that esbuild does for you because esbuild only handles syntax, not APIs. Polyfilling it can be done with something like this:</p> <pre lang="js"><code>Symbol.dispose ||= Symbol('Symbol.dispose') </code></pre> <p>This feature also introduces <code>await using</code> declarations which are like <code>using</code> declarations but they call <code>await</code> on the disposal method (not on the initializer). Here's an example (helper functions are omitted):</p> <pre lang="js"><code>// Original code class Foo { async [Symbol.asyncDispose]() { await new Promise(done => { setTimeout(done, 1000) }) console.log('cleanup') } } </code></pre> </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.18.7</h2> <ul> <li> <p>Add support for <code>using</code> declarations in TypeScript 5.2+ (<a href="https://redirect.github.com/evanw/esbuild/issues/3191">#3191</a>)</p> <p>TypeScript 5.2 (due to be released in August of 2023) will introduce <code>using</code> declarations, which will allow you to automatically dispose of the declared resources when leaving the current scope. You can read the <a href="https://redirect.github.com/microsoft/TypeScript/pull/54505">TypeScript PR for this feature</a> for more information. This release of esbuild adds support for transforming this syntax to target environments without support for <code>using</code> declarations (which is currently all targets other than <code>esnext</code>). Here's an example (helper functions are omitted):</p> <pre lang="js"><code>// Original code class Foo { [Symbol.dispose]() { console.log('cleanup') } } using foo = new Foo; foo.bar(); <p>// New output (with --target=es6) var _stack = []; try { var Foo = class { <a href="">Symbol.dispose</a> { console.log("cleanup"); } }; var foo = __using(<em>stack, new Foo()); foo.bar(); } catch (</em>) { var _error = _, _hasError = true; } finally { __callDispose(_stack, _error, _hasError); } </code></pre></p> <p>The injected helper functions ensure that the method named <code>Symbol.dispose</code> is called on <code>new Foo</code> when control exits the scope. Note that as with all new JavaScript APIs, you'll need to polyfill <code>Symbol.dispose</code> if it's not present before you use it. This is not something that esbuild does for you because esbuild only handles syntax, not APIs. Polyfilling it can be done with something like this:</p> <pre lang="js"><code>Symbol.dispose ||= Symbol('Symbol.dispose') </code></pre> <p>This feature also introduces <code>await using</code> declarations which are like <code>using</code> declarations but they call <code>await</code> on the disposal method (not on the initializer). Here's an example (helper functions are omitted):</p> <pre lang="js"><code>// Original code class Foo { async [Symbol.asyncDispose]() { await new Promise(done => { setTimeout(done, 1000) }) console.log('cleanup') } </code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/evanw/esbuild/commit/adb8d19b56d2ae2d65128305c875b577476fac93"><code>adb8d19</code></a> publish 0.18.7 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/6c47cbaf655c99a91f96f32b5f2b9b5180845167"><code>6c47cba</code></a> fix an issue with <code>SuppressedError</code></li> <li><a href="https://github.com/evanw/esbuild/commit/d6056b8fc4e4f66d65214f46fe67b27aeda01351"><code>d6056b8</code></a> remove tsconfig <code>target</code> warning due to complaints</li> <li><a href="https://github.com/evanw/esbuild/commit/ecb33a3f84ff410ba67264cf90c9dfffedf75479"><code>ecb33a3</code></a> implement lowering for <code>using</code> and <code>await using</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3192">#3192</a>)</li> <li><a href="https://github.com/evanw/esbuild/commit/5f57ee2592512f262dd0b7a9fa5c171399d55a20"><code>5f57ee2</code></a> a better error for <code>export let</code></li> <li><a href="https://github.com/evanw/esbuild/commit/69a0c80572d9544ef4883b1c26db2fb0539f5dad"><code>69a0c80</code></a> abstract out binding visiting code</li> <li><a href="https://github.com/evanw/esbuild/commit/71140268275932057a146fb66850e7785526fb13"><code>7114026</code></a> small fix for template strings containing newlines</li> <li><a href="https://github.com/evanw/esbuild/commit/7d5df1004c34e04050d2ddc19be3114d5c258bd5"><code>7d5df10</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3170">#3170</a>: add <code>--line-limit=</code> to limit long lines</li> <li>See full diff in <a href="https://github.com/evanw/esbuild/compare/v0.18.6...v0.18.7">compare view</a></li> </ul> </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information