Bump esbuild from 0.19.8 to 0.21.5
Bumps esbuild from 0.19.8 to 0.21.5.
Release notes
Sourced from esbuild's releases.
v0.21.5
Fix
Symbol.metadataon classes without a class decorator (#3781)This release fixes a bug with esbuild's support for the decorator metadata proposal. Previously esbuild only added the
Symbol.metadataproperty to decorated classes if there was a decorator on the class element itself. However, the proposal says that theSymbol.metadataproperty should be present on all classes that have any decorators at all, not just those with a decorator on the class element itself.Allow unknown import attributes to be used with the
copyloader (#3792)Import attributes (the
withkeyword onimportstatements) are allowed to alter how that path is loaded. For example, esbuild cannot assume that it knows how to load./bagel.jsas typebagel:// This is an error with "--bundle" without also using "--external:./bagel.js" import tasty from "./bagel.js" with { type: "bagel" }Because of that, bundling this code with esbuild is an error unless the file
./bagel.jsis external to the bundle (such as with--bundle --external:./bagel.js).However, there is an additional case where it's ok for esbuild to allow this: if the file is loaded using the
copyloader. That's because thecopyloader behaves similarly to--externalin that the file is left external to the bundle. The difference is that thecopyloader copies the file into the output folder and rewrites the import path while--externaldoesn't. That means the following will now work with thecopyloader (such as with--bundle --loader:.bagel=copy):// This is no longer an error with "--bundle" and "--loader:.bagel=copy" import tasty from "./tasty.bagel" with { type: "bagel" }Support import attributes with glob-style imports (#3797)
This release adds support for import attributes (the
withoption) to glob-style imports (dynamic imports with certain string literal patterns as paths). These imports previously didn't support import attributes due to an oversight. So code like this will now work correctly:async function loadLocale(locale: string): Locale { const data = await import(`./locales/${locale}.data`, { with: { type: 'json' } }) return unpackLocale(locale, data) }Previously this didn't work even though esbuild normally supports forcing the JSON loader using an import attribute. Attempting to do this used to result in the following error:
✘ [ERROR] No loader is configured for ".data" files: locales/en-US.dataexample.ts:2:28: 2 │ const data = await import(`./locales/${locale}.data`, { with: { type: 'json' } }) ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~In addition, this change means plugins can now access the contents of
withfor glob-style imports.Support
${configDir}intsconfig.jsonfiles (#3782)This adds support for a new feature from the upcoming TypeScript 5.5 release. The character sequence
${configDir}is now respected at the start ofbaseUrlandpathsvalues, which are used by esbuild during bundling to correctly map import paths to file system paths. This feature lets basetsconfig.jsonfiles specified viaextendsrefer to the directory of the top-leveltsconfig.jsonfile. Here is an example:
... (truncated)
Changelog
Sourced from esbuild's changelog.
Changelog: 2023
This changelog documents all esbuild versions published in the year 2023 (versions 0.16.13 through 0.19.11).
0.19.11
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 withuseDefineForClassFieldsset tofalseif 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#privateinstance 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 tosuper()(sincesuper()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:
... (truncated)
Commits
fc37c2fpublish 0.21.5 to npmcb11924fixSymbol.metadataerrors in decorator testsb93a2a9fix #3781: add metadata to all decorated classes953dae9fix #3797: import attributes and glob-style import98cb2edfix #3782: support${configDir}in tsconfig.json8e6603brunmake update-compat-tabledb1b8cafix #3792: import attributes and thecopyloaderde572d0fix non-deterministic import attribute plugin testae8d1b4fix #3794:--supported:object-accessors=false67cbf87publish 0.21.4 to npm- Additional commits viewable in compare view
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill 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 versionwill 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 dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Note Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
Dependabot can't resolve your JavaScript dependency files. Because of this, Dependabot cannot update this pull request.
Dependabot can't resolve your JavaScript dependency files. Because of this, Dependabot cannot update this pull request.
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.