google / sxg-rs

A set of tools for generating signed exchanges at serve time.
Apache License 2.0
83 stars 20 forks source link

Update dependency esbuild to v0.14.54 #337

Closed renovate-bot closed 2 years ago

renovate-bot commented 2 years ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
esbuild 0.14.51 -> 0.14.54 age adoption passing confidence

Release Notes

evanw/esbuild ### [`v0.14.54`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#​01454) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.53...v0.14.54) - Fix optimizations for calls containing spread arguments ([#​2445](https://togithub.com/evanw/esbuild/issues/2445)) This release fixes the handling of spread arguments in the optimization of `/* @​__PURE__ */` comments, empty functions, and identity functions: ```js // Original code function empty() {} function identity(x) { return x } /* @​__PURE__ */ a(...x) /* @​__PURE__ */ new b(...x) empty(...x) identity(...x) // Old output (with --minify --tree-shaking=true) ...x;...x;...x;...x; // New output (with --minify --tree-shaking=true) function identity(n){return n}[...x];[...x];[...x];identity(...x); ``` Previously esbuild assumed arguments with side effects could be directly inlined. This is almost always true except for spread arguments, which are not syntactically valid on their own and which have the side effect of causing iteration, which might have further side effects. Now esbuild will wrap these elements in an unused array so that they are syntactically valid and so that the iteration side effects are preserved. ### [`v0.14.53`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#​01453) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.52...v0.14.53) This release fixes a minor issue with the previous release: I had to rename the package `esbuild-linux-loong64` to `@esbuild/linux-loong64` in the contributed PR because someone registered the package name before I could claim it, and I missed a spot. Hopefully everything is working after this release. I plan to change all platform-specific package names to use the `@esbuild/` scope at some point to avoid this problem in the future. ### [`v0.14.52`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#​01452) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.51...v0.14.52) - Allow binary data as input to the JS `transform` and `build` APIs ([#​2424](https://togithub.com/evanw/esbuild/issues/2424)) Previously esbuild's `transform` and `build` APIs could only take a string. However, some people want to use esbuild to convert binary data to base64 text. This is problematic because JavaScript strings represent UTF-16 text and esbuild internally operates on arrays of bytes, so all strings coming from JavaScript undergo UTF-16 to UTF-8 conversion before use. This meant that using esbuild in this way was doing base64 encoding of the UTF-8 encoding of the text, which was undesired. With this release, esbuild now accepts `Uint8Array` in addition to string as an input format for the `transform` and `build` APIs. Now you can use esbuild to convert binary data to base64 text: ```js // Original code import esbuild from 'esbuild' console.log([ (await esbuild.transform('\xFF', { loader: 'base64' })).code, (await esbuild.build({ stdin: { contents: '\xFF', loader: 'base64' }, write: false })).outputFiles[0].text, ]) console.log([ (await esbuild.transform(new Uint8Array([0xFF]), { loader: 'base64' })).code, (await esbuild.build({ stdin: { contents: new Uint8Array([0xFF]), loader: 'base64' }, write: false })).outputFiles[0].text, ]) // Old output [ 'module.exports = "w78=";\n', 'module.exports = "w78=";\n' ] /* ERROR: The input to "transform" must be a string */ // New output [ 'module.exports = "w78=";\n', 'module.exports = "w78=";\n' ] [ 'module.exports = "/w==";\n', 'module.exports = "/w==";\n' ] ``` - Update the getter for `text` in build results ([#​2423](https://togithub.com/evanw/esbuild/issues/2423)) Output files in build results returned from esbuild's JavaScript API have both a `contents` and a `text` property to return the contents of the output file. The `contents` property is a binary UTF-8 Uint8Array and the `text` property is a JavaScript UTF-16 string. The `text` property is a getter that does the UTF-8 to UTF-16 conversion only if it's needed for better performance. Previously if you mutate the build results object, you had to overwrite both `contents` and `text` since the value returned from the `text` getter is the original text returned by esbuild. Some people find this confusing so with this release, the getter for `text` has been updated to do the UTF-8 to UTF-16 conversion on the current value of the `contents` property instead of the original value. - Publish builds for Linux LoongArch 64-bit ([#​1804](https://togithub.com/evanw/esbuild/issues/1804), [#​2373](https://togithub.com/evanw/esbuild/pull/2373)) This release upgrades to [Go 1.19](https://go.dev/doc/go1.19), which now includes support for LoongArch 64-bit processors. LoongArch 64-bit builds of esbuild will now be published to npm, which means that in theory they can now be installed with `npm install esbuild`. This was contributed by [@​beyond-1234](https://togithub.com/beyond-1234).

Configuration

📅 Schedule: Branch creation - "before 3am on Monday" (UTC), 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.

🔕 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.