Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps): Bump esbuild from 0.19.5 to 0.19.7 (#1219)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.19.5 to 0.19.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.19.7</h2> <ul> <li> <p>Add support for bundling code that uses import attributes (<a href="https://redirect.github.com/evanw/esbuild/issues/3384">#3384</a>)</p> <p>JavaScript is gaining new syntax for associating a map of string key-value pairs with individual ESM imports. The proposal is still a work in progress and is still undergoing significant changes before being finalized. However, the first iteration has already been shipping in Chromium-based browsers for a while, and the second iteration has landed in V8 and is now shipping in node, so it makes sense for esbuild to support it. Here are the two major iterations of this proposal (so far):</p> <ol> <li> <p>Import assertions (deprecated, will not be standardized)</p> <ul> <li>Uses the <code>assert</code> keyword</li> <li>Does <em>not</em> affect module resolution</li> <li>Causes an error if the assertion fails</li> <li>Shipping in Chrome 91+ (and in esbuild 0.11.22+)</li> </ul> </li> <li> <p>Import attributes (currently set to become standardized)</p> <ul> <li>Uses the <code>with</code> keyword</li> <li>Affects module resolution</li> <li>Unknown attributes cause an error</li> <li>Shipping in node 21+</li> </ul> </li> </ol> <p>You can already use esbuild to bundle code that uses import assertions (the first iteration). However, this feature is mostly useless for bundlers because import assertions are not allowed to affect module resolution. It's basically only useful as an annotation on external imports, which esbuild will then preserve in the output for use in a browser (which would otherwise refuse to load certain imports).</p> <p>With this release, esbuild now supports bundling code that uses import attributes (the second iteration). This is much more useful for bundlers because they are allowed to affect module resolution, which means the key-value pairs can be provided to plugins. Here's an example, which uses esbuild's built-in support for the upcoming <a href="https://github.com/tc39/proposal-json-modules">JSON module standard</a>:</p> <pre lang="js"><code>// On static imports import foo from './package.json' with { type: 'json' } console.log(foo) <p>// On dynamic imports const bar = await import('./package.json', { with: { type: 'json' } }) console.log(bar) </code></pre></p> <p>One important consequence of the change in semantics between import assertions and import attributes is that two imports with identical paths but different import attributes are now considered to be different modules. This is because the import attributes are provided to the loader, which might then use those attributes during loading. For example, you could imagine an image loader that produces an image of a different size depending on the import attributes.</p> <p>Import attributes are now reported in the <a href="https://esbuild.github.io/api/#metafile">metafile</a> and are now provided to <a href="https://esbuild.github.io/plugins/#on-load">on-load plugins</a> as a map in the <code>with</code> property. For example, here's an esbuild plugin that turns all imports with a <code>type</code> import attribute equal to <code>'cheese'</code> into a module that exports the cheese emoji:</p> <pre lang="js"><code>const cheesePlugin = { name: 'cheese', setup(build) { build.onLoad({ filter: /.*/ }, args => { if (args.with.type === 'cheese') return { contents: `export default "🧀"`, } }) } } <p>require('esbuild').build({ bundle: true, write: false, </code></pre></p> </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.19.7</h2> <ul> <li> <p>Add support for bundling code that uses import attributes (<a href="https://redirect.github.com/evanw/esbuild/issues/3384">#3384</a>)</p> <p>JavaScript is gaining new syntax for associating a map of string key-value pairs with individual ESM imports. The proposal is still a work in progress and is still undergoing significant changes before being finalized. However, the first iteration has already been shipping in Chromium-based browsers for a while, and the second iteration has landed in V8 and is now shipping in node, so it makes sense for esbuild to support it. Here are the two major iterations of this proposal (so far):</p> <ol> <li> <p>Import assertions (deprecated, will not be standardized)</p> <ul> <li>Uses the <code>assert</code> keyword</li> <li>Does <em>not</em> affect module resolution</li> <li>Causes an error if the assertion fails</li> <li>Shipping in Chrome 91+ (and in esbuild 0.11.22+)</li> </ul> </li> <li> <p>Import attributes (currently set to become standardized)</p> <ul> <li>Uses the <code>with</code> keyword</li> <li>Affects module resolution</li> <li>Unknown attributes cause an error</li> <li>Shipping in node 21+</li> </ul> </li> </ol> <p>You can already use esbuild to bundle code that uses import assertions (the first iteration). However, this feature is mostly useless for bundlers because import assertions are not allowed to affect module resolution. It's basically only useful as an annotation on external imports, which esbuild will then preserve in the output for use in a browser (which would otherwise refuse to load certain imports).</p> <p>With this release, esbuild now supports bundling code that uses import attributes (the second iteration). This is much more useful for bundlers because they are allowed to affect module resolution, which means the key-value pairs can be provided to plugins. Here's an example, which uses esbuild's built-in support for the upcoming <a href="https://github.com/tc39/proposal-json-modules">JSON module standard</a>:</p> <pre lang="js"><code>// On static imports import foo from './package.json' with { type: 'json' } console.log(foo) <p>// On dynamic imports const bar = await import('./package.json', { with: { type: 'json' } }) console.log(bar) </code></pre></p> <p>One important consequence of the change in semantics between import assertions and import attributes is that two imports with identical paths but different import attributes are now considered to be different modules. This is because the import attributes are provided to the loader, which might then use those attributes during loading. For example, you could imagine an image loader that produces an image of a different size depending on the import attributes.</p> <p>Import attributes are now reported in the <a href="https://esbuild.github.io/api/#metafile">metafile</a> and are now provided to <a href="https://esbuild.github.io/plugins/#on-load">on-load plugins</a> as a map in the <code>with</code> property. For example, here's an esbuild plugin that turns all imports with a <code>type</code> import attribute equal to <code>'cheese'</code> into a module that exports the cheese emoji:</p> <pre lang="js"><code>const cheesePlugin = { name: 'cheese', setup(build) { build.onLoad({ filter: /.*/ }, args => { if (args.with.type === 'cheese') return { contents: `export default "🧀"`, } }) } } <p>require('esbuild').build({ bundle: true, </code></pre></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/a7773b340bb216d053df91b7479b5aa2a152b0de"><code>a7773b3</code></a> publish 0.19.7 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/2886b5db37d8f9b85547788a905e863d98151a5b"><code>2886b5d</code></a> more adjustments to import assertions/attributes</li> <li><a href="https://github.com/evanw/esbuild/commit/2dad8309fcec8f668abe0619f531cf0375da2e7b"><code>2dad830</code></a> add basic support for import assertions</li> <li><a href="https://github.com/evanw/esbuild/commit/6b9737a67f1ae51cea68c830937004a2031f96e6"><code>6b9737a</code></a> fix test262 crash in v8 due to renamed test</li> <li><a href="https://github.com/evanw/esbuild/commit/0d9f7652efb71f2c0cfc0b6ccbe5796c9dddc66a"><code>0d9f765</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3230">#3230</a>, fix <a href="https://redirect.github.com/evanw/esbuild/issues/3326">#3326</a>, fix <a href="https://redirect.github.com/evanw/esbuild/issues/3394">#3394</a>: update decorators</li> <li><a href="https://github.com/evanw/esbuild/commit/9fc1ed379c82645a656ec0cce534c27f244a658d"><code>9fc1ed3</code></a> ast helpers: use a context object</li> <li><a href="https://github.com/evanw/esbuild/commit/00fa0107ed4fd2b363e2fa3cd2160aeb2f787fc3"><code>00fa010</code></a> tree shaking: handle destructuring of an array</li> <li><a href="https://github.com/evanw/esbuild/commit/f361c7fe557586aa696b5db262b724ce6b241aa0"><code>f361c7f</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3477">#3477</a>: forbid <code>--keep-names</code> if not supported</li> <li><a href="https://github.com/evanw/esbuild/commit/4c64c191bd41ca6f3ed3e0c13d6d8b2f95660ec9"><code>4c64c19</code></a> compat-table: sort kangax feature map</li> <li><a href="https://github.com/evanw/esbuild/commit/cd7b93f196134a4f395b279ef9b5d09c267fb4d1"><code>cd7b93f</code></a> dev server: add a fallback <code>favicon.ico</code> handler</li> <li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.19.5...v0.19.7">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.19.5&new-version=0.19.7)](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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information