Closed renovate[bot] closed 2 years ago
Merging #142 (75d3df9) into develop (dd33727) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## develop #142 +/- ##
========================================
Coverage 82.89% 82.89%
========================================
Files 14 14
Lines 345 345
Branches 60 60
========================================
Hits 286 286
Misses 54 54
Partials 5 5
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dd33727...75d3df9. Read the comment docs.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
This PR contains the following updates:
0.14.42
->0.14.48
Release Notes
evanw/esbuild
### [`v0.14.48`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01448) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.47...v0.14.48) - Enable using esbuild in Deno via WebAssembly ([#2323](https://togithub.com/evanw/esbuild/issues/2323)) The native implementation of esbuild is much faster than the WebAssembly version, but some people don't want to give Deno the `--allow-run` permission necessary to run esbuild and are ok waiting longer for their builds to finish when using the WebAssembly backend. With this release, you can now use esbuild via WebAssembly in Deno. To do this you will need to import from `wasm.js` instead of `mod.js`: ```js import * as esbuild from 'https://deno.land/x/esbuild@v0.14.48/wasm.js' const ts = 'let test: boolean = true' const result = await esbuild.transform(ts, { loader: 'ts' }) console.log('result:', result) ``` Make sure you run Deno with `--allow-net` so esbuild can download the WebAssembly module. Using esbuild like this starts up a worker thread that runs esbuild in parallel (unless you call `esbuild.initialize({ worker: false })` to tell esbuild to run on the main thread). If you want to, you can call `esbuild.stop()` to terminate the worker if you won't be using esbuild anymore and you want to reclaim the memory. Note that Deno appears to have a bug where background WebAssembly optimization can prevent the process from exiting for many seconds. If you are trying to use Deno and WebAssembly to run esbuild quickly, you may need to manually call `Deno.exit(0)` after your code has finished running. - Add support for font file MIME types ([#2337](https://togithub.com/evanw/esbuild/issues/2337)) This release adds support for font file MIME types to esbuild, which means they are now recognized by the built-in local web server and they are now used when a font file is loaded using the `dataurl` loader. The full set of newly-added file extension MIME type mappings is as follows: - `.eot` => `application/vnd.ms-fontobject` - `.otf` => `font/otf` - `.sfnt` => `font/sfnt` - `.ttf` => `font/ttf` - `.woff` => `font/woff` - `.woff2` => `font/woff2` - Remove `"use strict";` when targeting ESM ([#2347](https://togithub.com/evanw/esbuild/issues/2347)) All ES module code is automatically in strict mode, so a `"use strict";` directive is unnecessary. With this release, esbuild will now remove the `"use strict";` directive if the output format is ESM. This change makes the generated output file a few bytes smaller: ```js // Original code 'use strict' export let foo = 123 // Old output (with --format=esm --minify) "use strict";let t=123;export{t as foo}; // New output (with --format=esm --minify) let t=123;export{t as foo}; ``` - Attempt to have esbuild work with Deno on FreeBSD ([#2356](https://togithub.com/evanw/esbuild/issues/2356)) Deno doesn't support FreeBSD, but it's possible to build Deno for FreeBSD with some additional patches on top. This release of esbuild changes esbuild's Deno installer to download esbuild's FreeBSD binary in this situation. This configuration is unsupported although in theory everything should work. - Add some more target JavaScript engines ([#2357](https://togithub.com/evanw/esbuild/issues/2357)) This release adds the [Rhino](https://togithub.com/mozilla/rhino) and [Hermes](https://hermesengine.dev/) JavaScript engines to the set of engine identifiers that can be passed to the `--target` flag. You can use this to restrict esbuild to only using JavaScript features that are supported on those engines in the output files that esbuild generates. ### [`v0.14.47`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01447) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.46...v0.14.47) - Make global names more compact when `||=` is available ([#2331](https://togithub.com/evanw/esbuild/issues/2331)) With this release, the code esbuild generates for the `--global-name=` setting is now slightly shorter when you don't configure esbuild such that the `||=` operator is unsupported (e.g. with `--target=chrome80` or `--supported:logical-assignment=false`): ```js // Original code exports.foo = 123 // Old output (with --format=iife --global-name=foo.bar.baz --minify) var foo=foo||{};foo.bar=foo.bar||{};foo.bar.baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})(); // New output (with --format=iife --global-name=foo.bar.baz --minify) var foo;((foo||={}).bar||={}).baz=(()=>{var b=(a,o)=>()=>(o||a((o={exports:{}}).exports,o),o.exports);var c=b(f=>{f.foo=123});return c();})(); ``` - Fix `--mangle-quoted=false` with `--minify-syntax=true` If property mangling is active and `--mangle-quoted` is disabled, quoted properties are supposed to be preserved. However, there was a case when this didn't happen if `--minify-syntax` was enabled, since that internally transforms `x['y']` into `x.y` to reduce code size. This issue has been fixed: ```js // Original code x.foo = x['bar'] = { foo: y, 'bar': z } // Old output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true) x.a = x.b = { a: y, bar: z }; // New output (with --mangle-props=. --mangle-quoted=false --minify-syntax=true) x.a = x.bar = { a: y, bar: z }; ``` Notice how the property `foo` is always used unquoted but the property `bar` is always used quoted, so `foo` should be consistently mangled while `bar` should be consistently not mangled. - Fix a minification bug regarding `this` and property initializers When minification is enabled, esbuild attempts to inline the initializers of variables that have only been used once into the start of the following expression to reduce code size. However, there was a bug where this transformation could change the value of `this` when the initializer is a property access and the start of the following expression is a call expression. This release fixes the bug: ```js // Original code function foo(obj) { let fn = obj.prop; fn(); } // Old output (with --minify) function foo(f){f.prop()} // New output (with --minify) function foo(o){let f=o.prop;f()} ``` ### [`v0.14.46`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01446) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.45...v0.14.46) - Add the ability to override support for individual syntax features ([#2060](https://togithub.com/evanw/esbuild/issues/2060), [#2290](https://togithub.com/evanw/esbuild/issues/2290), [#2308](https://togithub.com/evanw/esbuild/issues/2308)) The `target` setting already lets you configure esbuild to restrict its output by only making use of syntax features that are known to be supported in the configured target environment. For example, setting `target` to `chrome50` causes esbuild to automatically transform optional chain expressions into the equivalent older JavaScript and prevents you from using BigInts, among many other things. However, sometimes you may want to customize this set of unsupported syntax features at the individual feature level. Some examples of why you might want to do this: - JavaScript runtimes often do a quick implementation of newer syntax features that is slower than the equivalent older JavaScript, and you can get a speedup by telling esbuild to pretend this syntax feature isn't supported. For example, V8 has a [long-standing performance bug regarding object spread](https://bugs.chromium.org/p/v8/issues/detail?id=11536) that can be avoided by manually copying properties instead of using object spread syntax. Right now esbuild hard-codes this optimization if you set `target` to a V8-based runtime. - There are many less-used JavaScript runtimes in addition to the ones present in browsers, and these runtimes sometimes just decide not to implement parts of the specification, which might make sense for runtimes intended for embedded environments. For example, the developers behind Facebook's JavaScript runtime [Hermes](https://hermesengine.dev/) have decided to not implement classes despite it being a major JavaScript feature that was added seven years ago and that is used in virtually every large JavaScript project. - You may be processing esbuild's output with another tool, and you may want esbuild to transform certain features and the other tool to transform certain other features. For example, if you are using esbuild to transform files individually to ES5 but you are then feeding the output into Webpack for bundling, you may want to preserve `import()` expressions even though they are a syntax error in ES5. With this release, you can now use `--supported:feature=false` to force `feature` to be unsupported. This will cause esbuild to either rewrite code that uses the feature into older code that doesn't use the feature (if esbuild is able to), or to emit a build error (if esbuild is unable to). For example, you can use `--supported:arrow=false` to turn arrow functions into function expressions and `--supported:bigint=false` to make it an error to use a BigInt literal. You can also use `--supported:feature=true` to force it to be supported, which means esbuild will pass it through without transforming it. Keep in mind that this is an advanced feature. For most use cases you will probably want to just use `target` instead of using this. The full set of currently-allowed features are as follows: **JavaScript:** - `arbitrary-module-namespace-names` - `array-spread` - `arrow` - `async-await` - `async-generator` - `bigint` - `class` - `class-field` - `class-private-accessor` - `class-private-brand-check` - `class-private-field` - `class-private-method` - `class-private-static-accessor` - `class-private-static-field` - `class-private-static-method` - `class-static-blocks` - `class-static-field` - `const-and-let` - `default-argument` - `destructuring` - `dynamic-import` - `exponent-operator` - `export-star-as` - `for-await` - `for-of` - `generator` - `hashbang` - `import-assertions` - `import-meta` - `logical-assignment` - `nested-rest-binding` - `new-target` - `node-colon-prefix-import` - `node-colon-prefix-require` - `nullish-coalescing` - `object-accessors` - `object-extensions` - `object-rest-spread` - `optional-catch-binding` - `optional-chain` - `regexp-dot-all-flag` - `regexp-lookbehind-assertions` - `regexp-match-indices` - `regexp-named-capture-groups` - `regexp-sticky-and-unicode-flags` - `regexp-unicode-property-escapes` - `rest-argument` - `template-literal` - `top-level-await` - `typeof-exotic-object-is-object` - `unicode-escapes` **CSS:** - `hex-rgba` - `rebecca-purple` - `modern-rgb-hsl` - `inset-property` - `nesting` Since you can now specify `--supported:object-rest-spread=false` yourself to work around the V8 performance issue mentioned above, esbuild will no longer automatically transform all instances of object spread when targeting a V8-based JavaScript runtime going forward. *Note that JavaScript feature transformation is very complex and allowing full customization of the set of supported syntax features could cause bugs in esbuild due to new interactions between multiple features that were never possible before. Consider this to be an experimental feature.* - Implement `extends` constraints on `infer` type variables ([#2330](https://togithub.com/evanw/esbuild/issues/2330)) TypeScript 4.7 introduced the ability to write an `extends` constraint after an `infer` type variable, which looks like this: ```ts type FirstIfStringConfiguration
📅 Schedule: Branch creation - "before 3am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.