privatenumber / minification-benchmarks

🏃‍♂️🏃‍♀️🏃 JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify
MIT License
1.35k stars 31 forks source link

fix(deps): update minifiers #531

Closed renovate[bot] closed 4 months ago

renovate[bot] commented 4 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
esbuild ^0.21.4 -> ^0.21.5 age adoption passing confidence
uglify-js ^3.17.4 -> ^3.18.0 age adoption passing confidence

Release Notes

evanw/esbuild (esbuild) ### [`v0.21.5`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0215) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.21.4...v0.21.5) - Fix `Symbol.metadata` on classes without a class decorator ([#​3781](https://togithub.com/evanw/esbuild/issues/3781)) This release fixes a bug with esbuild's support for the [decorator metadata proposal](https://togithub.com/tc39/proposal-decorator-metadata). Previously esbuild only added the `Symbol.metadata` property to decorated classes if there was a decorator on the class element itself. However, the proposal says that the `Symbol.metadata` property 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 `copy` loader ([#​3792](https://togithub.com/evanw/esbuild/issues/3792)) Import attributes (the `with` keyword on `import` statements) are allowed to alter how that path is loaded. For example, esbuild cannot assume that it knows how to load `./bagel.js` as type `bagel`: ```js // 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.js` is 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 `copy` loader. That's because the `copy` loader behaves similarly to `--external` in that the file is left external to the bundle. The difference is that the `copy` loader copies the file into the output folder and rewrites the import path while `--external` doesn't. That means the following will now work with the `copy` loader (such as with `--bundle --loader:.bagel=copy`): ```js // 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](https://togithub.com/evanw/esbuild/issues/3797)) This release adds support for import attributes (the `with` option) 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: ```ts 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.data example.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 `with` for glob-style imports. - Support `${configDir}` in `tsconfig.json` files ([#​3782](https://togithub.com/evanw/esbuild/issues/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 of `baseUrl` and `paths` values, which are used by esbuild during bundling to correctly map import paths to file system paths. This feature lets base `tsconfig.json` files specified via `extends` refer to the directory of the top-level `tsconfig.json` file. Here is an example: ```json { "compilerOptions": { "paths": { "js/*": ["${configDir}/dist/js/*"] } } } ``` You can read more in [TypeScript's blog post about their upcoming 5.5 release](https://devblogs.microsoft.com/typescript/announcing-typescript-5-5-rc/#the-configdir-template-variable-for-configuration-files). Note that this feature does not make use of template literals (you need to use `"${configDir}/dist/js/*"` not `` `${configDir}/dist/js/*` ``). The syntax for `tsconfig.json` is still just JSON with comments, and JSON syntax does not allow template literals. This feature only recognizes `${configDir}` in strings for certain path-like properties, and only at the beginning of the string. - Fix internal error with `--supported:object-accessors=false` ([#​3794](https://togithub.com/evanw/esbuild/issues/3794)) This release fixes a regression in 0.21.0 where some code that was added to esbuild's internal runtime library of helper functions for JavaScript decorators fails to parse when you configure esbuild with `--supported:object-accessors=false`. The reason is that esbuild introduced code that does `{ get [name]() {} }` which uses both the `object-extensions` feature for the `[name]` and the `object-accessors` feature for the `get`, but esbuild was incorrectly only checking for `object-extensions` and not for `object-accessors`. Additional tests have been added to avoid this type of issue in the future. A workaround for this issue in earlier releases is to also add `--supported:object-extensions=false`.
mishoo/UglifyJS (uglify-js) ### [`v3.18.0`](https://togithub.com/mishoo/UglifyJS/releases/tag/v3.18.0) [Compare Source](https://togithub.com/mishoo/UglifyJS/compare/v3.17.4...v3.18.0) ##### Features - convert `const` to `let` when possible ([`21aff99`](https://togithub.com/mishoo/UglifyJS/commit/21aff996a5d54730a1b67a51f3e79a89a7abd53f)) - process input as ES module by default ([`68d62a8`](https://togithub.com/mishoo/UglifyJS/commit/68d62a8a310a67f2c8fb4334f9e210f6fed55d67), [`17c3ae6`](https://togithub.com/mishoo/UglifyJS/commit/17c3ae6cbabc61c97193de4a56b0be71fc36bfe9)) - concatenate `let` and `var` declarations ([`e5cbd3e`](https://togithub.com/mishoo/UglifyJS/commit/e5cbd3e0f36afbbd3055c151d5f77561002dc50c)) - avoid mangling of `enableHighAccuracy` & `maximumAge` DOM properties ([`aa7c338`](https://togithub.com/mishoo/UglifyJS/commit/aa7c3389e6853f5a8210da8dc1e189d2d1ad6c46)) - compress array element assignments into declaration ([`ffe0fe7`](https://togithub.com/mishoo/UglifyJS/commit/ffe0fe77625d1886d7710a1caf3f3ea600e7d7cc), [`3dfb379`](https://togithub.com/mishoo/UglifyJS/commit/3dfb3794865a24e69fb01507f462f3879f13482a)) - handle lexical `function` declaration in ES6+ ([`e7b9b4a`](https://togithub.com/mishoo/UglifyJS/commit/e7b9b4aafbc0ee1196de0a8b76c1015e53181056)) - improve ESTree interoperability with third-party tools ([`ca4185a`](https://togithub.com/mishoo/UglifyJS/commit/ca4185a0fdae65764cf6d66e6efee6595a7fb542)) ##### Bug Fixes - assignment operator ([`f0ca9cf`](https://togithub.com/mishoo/UglifyJS/commit/f0ca9cfbe65efc919149e7cd74cedd186d6413ee)) - `async` generator function ([`404794f`](https://togithub.com/mishoo/UglifyJS/commit/404794f5dba1205a5731d45d13b1365f807b2a21)) - `await` operator ([`0991077`](https://togithub.com/mishoo/UglifyJS/commit/09910771a1e8e2531c8dac09e274e345d3feb0e4)) - `BigInt` literal ([`2b1c321`](https://togithub.com/mishoo/UglifyJS/commit/2b1c321ac88bd5b51a1eb0af9731965232e7b956)) - `class` field ([`f40dbd6`](https://togithub.com/mishoo/UglifyJS/commit/f40dbd6e3364d3bffc887774178be1b6f82029a6), [`1d400f1`](https://togithub.com/mishoo/UglifyJS/commit/1d400f1a255a9e2808af92730e4526754584414f)) - `class` literal ([`548f093`](https://togithub.com/mishoo/UglifyJS/commit/548f0938e8fd608efff7d5923db64db424914764)) - default parameter ([`57dd3f6`](https://togithub.com/mishoo/UglifyJS/commit/57dd3f6a2c74decc3fe68447e56a90fe9d3593c0)) - `function` call ([`e37a148`](https://togithub.com/mishoo/UglifyJS/commit/e37a1489d401e8abed462a4e647663a8fba7c38a), [`a437a61`](https://togithub.com/mishoo/UglifyJS/commit/a437a61518f98bd4131d6713b3dbbfe5025ecdb7)) - generator function ([`574ca47`](https://togithub.com/mishoo/UglifyJS/commit/574ca47666c9f8581f4e45737b6b141a75fb03bf)) - `if` statement ([`358faaa`](https://togithub.com/mishoo/UglifyJS/commit/358faaacaaa502d031cb4e195ab7601edcd5e44d)) - immediately invoked function expression ([`1d400f1`](https://togithub.com/mishoo/UglifyJS/commit/1d400f1a255a9e2808af92730e4526754584414f), [`aef7065`](https://togithub.com/mishoo/UglifyJS/commit/aef70652620741e6312ab8b99ea38d894cf999a2), [`dd88f38`](https://togithub.com/mishoo/UglifyJS/commit/dd88f3866b87c0a1c747bc3f177dd338317e5967), [`c911704`](https://togithub.com/mishoo/UglifyJS/commit/c9117041fac7d6d83453868154ac2e0f534e9a94)) - `instanceof` operator ([`8d28052`](https://togithub.com/mishoo/UglifyJS/commit/8d28052182a4cd1261a4f24a15a1c694079ef930)) - `let` statement ([`0cbd5ea`](https://togithub.com/mishoo/UglifyJS/commit/0cbd5ea64a5f37f50ce420529933ec185cb94fb5)) - logical operator ([`7270671`](https://togithub.com/mishoo/UglifyJS/commit/72706716873355776c6fecd383f404f62cd1b67b)) - nullish coalescing operator ([`2cb6454`](https://togithub.com/mishoo/UglifyJS/commit/2cb6454b1f8739e27708a29c5a97610afa2c554e)) - `switch` statement ([`34b6143`](https://togithub.com/mishoo/UglifyJS/commit/34b6143306474b5dfc4a4f5bbce855db4fd3bafd)) - ternary expression ([`f07dc5c`](https://togithub.com/mishoo/UglifyJS/commit/f07dc5cfba57d607c8f256fb8f339a29a4aeb09a)) - unary arithmetic operator ([`30bf068`](https://togithub.com/mishoo/UglifyJS/commit/30bf06876878495637dfef2f6e31824649abd34b)) - `var` statement ([`2352909`](https://togithub.com/mishoo/UglifyJS/commit/2352909c3d9ea9b2f53768a7522decb275e81288))

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.



This PR has been generated by Mend Renovate. View repository job log here.