chore(deps): update dependency esbuild to v0.14.51 #2191

Merged
konrad merged 1 commits from renovate/esbuild-0.x into main 2022-07-31 13:46:22 +00:00
Member

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.14.49 -> 0.14.51

Release Notes

evanw/esbuild

v0.14.51

Compare Source

  • Add support for React 17's automatic JSX transform (#​334, #​718, #​1172, #​2318, #​2349)

    This adds support for the new "automatic" JSX runtime from React 17+ to esbuild for both the build and transform APIs.

    New CLI flags and API options:

    • --jsx, jsx — Set this to "automatic" to opt in to this new transform
    • --jsx-dev, jsxDev — Toggles development mode for the automatic runtime
    • --jsx-import-source, jsxImportSource — Overrides the root import for runtime functions (default "react")

    New JSX pragma comments:

    • @jsxRuntime — Sets the runtime (automatic or classic)
    • @jsxImportSource — Sets the import source (only valid with automatic runtime)

    The existing @jsxFragment and @jsxFactory pragma comments are only valid with "classic" runtime.

    TSConfig resolving:
    Along with accepting the new options directly via CLI or API, option inference from tsconfig.json compiler options was also implemented:

    • "jsx": "preserve" or "jsx": "react-native" → Same as --jsx=preserve in esbuild
    • "jsx": "react" → Same as --jsx=transform in esbuild (which is the default behavior)
    • "jsx": "react-jsx" → Same as --jsx=automatic in esbuild
    • "jsx": "react-jsxdev" → Same as --jsx=automatic --jsx-dev in esbuild

    It also reads the value of "jsxImportSource" from tsconfig.json if specified.

    For react-jsx it's important to note that it doesn't implicitly disable --jsx-dev. This is to support the case where a user sets "react-jsx" in their tsconfig.json but then toggles development mode directly in esbuild.

    esbuild vs Babel vs TS vs...

    There are a few differences between the various technologies that implement automatic JSX runtimes. The JSX transform in esbuild follows a mix of Babel's and TypeScript's behavior:

    • When an element has __source or __self props:

      • Babel: Print an error about a deprecated transform plugin
      • TypeScript: Allow the props
      • swc: Hard crash
      • esbuild: Print an error — Following Babel was chosen for this one because this might help people catch configuration issues where JSX files are being parsed by multiple tools
    • Element has an "implicit true" key prop, e.g. <a key />:

      • Babel: Print an error indicating that "key" props require an explicit value
      • TypeScript: Silently omit the "key" prop
      • swc: Hard crash
      • esbuild: Print an error like Babel — This might help catch legitimate programming mistakes
    • Element has spread children, e.g. <a>{...children}</a>

      • Babel: Print an error stating that React doesn't support spread children
      • TypeScript: Use static jsx function and pass children as-is, including spread operator
      • swc: same as Babel
      • esbuild: Same as TypeScript

    Also note that TypeScript has some bugs regarding JSX development mode and the generation of lineNumber and columnNumber values. Babel's values are accurate though, so esbuild's line and column numbers match Babel. Both numbers are 1-based and columns are counted in terms of UTF-16 code units.

    This feature was contributed by @​jgoz.

v0.14.50

Compare Source

  • Emit names in source maps (#​1296)

    The source map specification includes an optional names field that can associate an identifier with a mapping entry. This can be used to record the original name for an identifier, which is useful if the identifier was renamed to something else in the generated code. When esbuild was originally written, this field wasn't widely used, but now there are some debuggers that make use of it to provide better debugging of minified code. With this release, esbuild now includes a names field in the source maps that it generates. To save space, the original name is only recorded when it's different from the final name.

  • Update parser for arrow functions with initial default type parameters in .tsx files (#​2410)

    TypeScript 4.6 introduced a change to the parsing of JSX syntax in .tsx files. Now a < token followed by an identifier and then a = token is parsed as an arrow function with a default type parameter instead of as a JSX element. This release updates esbuild's parser to match TypeScript's parser.

  • Fix an accidental infinite loop with --define substitution (#​2407)

    This is a fix for a regression that was introduced in esbuild version 0.14.44 where certain --define substitutions could result in esbuild crashing with a stack overflow. The problem was an incorrect fix for #​2292. The fix merged the code paths for --define and --jsx-factory rewriting since the value substitution is now the same for both. However, doing this accidentally made --define substitution recursive since the JSX factory needs to be able to match against --define substitutions to integrate with the --inject feature. The fix is to only do one additional level of matching against define substitutions, and to only do this for JSX factories. Now these cases are able to build successfully without a stack overflow.

  • Include the "public path" value in hashes (#​2403)

    The --public-path= configuration value affects the paths that esbuild uses to reference files from other files and is used in various situations such as cross-chunk imports in JS and references to asset files from CSS files. However, it wasn't included in the hash calculations used for file names due to an oversight. This meant that changing the public path setting incorrectly didn't result in the hashes in file names changing even though the contents of the files changed. This release fixes the issue by including a hash of the public path in all non-asset output files.

  • Fix a cross-platform consistency bug (#​2383)

    Previously esbuild would minify 0xFFFF_FFFF_FFFF_FFFF as 0xffffffffffffffff (18 bytes) on arm64 chips and as 18446744073709552e3 (19 bytes) on x86_64 chips. The reason was that the number was converted to a 64-bit unsigned integer internally for printing as hexadecimal, the 64-bit floating-point number 0xFFFF_FFFF_FFFF_FFFF is actually 0x1_0000_0000_0000_0180 (i.e. it's rounded up, not down), and converting float64 to uint64 is implementation-dependent in Go when the input is out of bounds. This was fixed by changing the upper limit for which esbuild uses hexadecimal numbers during minification to 0xFFFF_FFFF_FFFF_F800, which is the next representable 64-bit floating-point number below 0x1_0000_0000_0000_0180, and which fits in a uint64. As a result, esbuild will now consistently never minify 0xFFFF_FFFF_FFFF_FFFF as 0xffffffffffffffff anymore, which means the output should now be consistent across platforms.

  • Fix a hang with the synchronous API when the package is corrupted (#​2396)

    An error message is already thrown when the esbuild package is corrupted and esbuild can't be run. However, if you are using a synchronous call in the JavaScript API in worker mode, esbuild will use a child worker to initialize esbuild once so that the overhead of initializing esbuild can be amortized across multiple synchronous API calls. However, errors thrown during initialization weren't being propagated correctly which resulted in a hang while the main thread waited forever for the child worker to finish initializing. With this release, initialization errors are now propagated correctly so calling a synchronous API call when the package is corrupted should now result in an error instead of a hang.

  • Fix tsconfig.json files that collide with directory names (#​2411)

    TypeScript lets you write tsconfig.json files with extends clauses that refer to another config file using an implicit .json file extension. However, if the config file without the .json extension existed as a directory name, esbuild and TypeScript had different behavior. TypeScript ignores the directory and continues looking for the config file by adding the .json extension while esbuild previously terminated the search and then failed to load the config file (because it's a directory). With this release, esbuild will now ignore exact matches when resolving extends fields in tsconfig.json files if the exact match results in a directory.

  • Add platform to the transform API (#​2362)

    The platform option is mainly relevant for bundling because it mostly affects path resolution (e.g. activating the "browser" field in package.json files), so it was previously only available for the build API. With this release, it has additionally be made available for the transform API for a single reason: you can now set --platform=node when transforming a string so that esbuild will add export annotations for node, which is only relevant when --format=cjs is also present.

    This has to do with an implementation detail of node that parses the AST of CommonJS files to discover named exports when importing CommonJS from ESM. However, this new addition to esbuild's API is of questionable usefulness. Node's loader API (the main use case for using esbuild's transform API like this) actually bypasses the content returned from the loader and parses the AST that's present on the file system, so you won't actually be able to use esbuild's API for this. See the linked issue for more information.


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.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [esbuild](https://github.com/evanw/esbuild) | devDependencies | patch | [`0.14.49` -> `0.14.51`](https://renovatebot.com/diffs/npm/esbuild/0.14.49/0.14.51) | --- ### Release Notes <details> <summary>evanw/esbuild</summary> ### [`v0.14.51`](https://github.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#&#8203;01451) [Compare Source](https://github.com/evanw/esbuild/compare/v0.14.50...v0.14.51) - Add support for React 17's `automatic` JSX transform ([#&#8203;334](https://github.com/evanw/esbuild/issues/334), [#&#8203;718](https://github.com/evanw/esbuild/issues/718), [#&#8203;1172](https://github.com/evanw/esbuild/issues/1172), [#&#8203;2318](https://github.com/evanw/esbuild/issues/2318), [#&#8203;2349](https://github.com/evanw/esbuild/pull/2349)) This adds support for the [new "automatic" JSX runtime from React 17+](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) to esbuild for both the build and transform APIs. **New CLI flags and API options:** - `--jsx`, `jsx` — Set this to `"automatic"` to opt in to this new transform - `--jsx-dev`, `jsxDev` — Toggles development mode for the automatic runtime - `--jsx-import-source`, `jsxImportSource` — Overrides the root import for runtime functions (default `"react"`) **New JSX pragma comments:** - `@jsxRuntime` — Sets the runtime (`automatic` or `classic`) - `@jsxImportSource` — Sets the import source (only valid with automatic runtime) The existing `@jsxFragment` and `@jsxFactory` pragma comments are only valid with "classic" runtime. **TSConfig resolving:** Along with accepting the new options directly via CLI or API, option inference from `tsconfig.json` compiler options was also implemented: - `"jsx": "preserve"` or `"jsx": "react-native"` → Same as `--jsx=preserve` in esbuild - `"jsx": "react"` → Same as `--jsx=transform` in esbuild (which is the default behavior) - `"jsx": "react-jsx"` → Same as `--jsx=automatic` in esbuild - `"jsx": "react-jsxdev"` → Same as `--jsx=automatic --jsx-dev` in esbuild It also reads the value of `"jsxImportSource"` from `tsconfig.json` if specified. For `react-jsx` it's important to note that it doesn't implicitly disable `--jsx-dev`. This is to support the case where a user sets `"react-jsx"` in their `tsconfig.json` but then toggles development mode directly in esbuild. **esbuild vs Babel vs TS vs...** There are a few differences between the various technologies that implement automatic JSX runtimes. The JSX transform in esbuild follows a mix of Babel's and TypeScript's behavior: - When an element has `__source` or `__self` props: - Babel: Print an error about a deprecated transform plugin - TypeScript: Allow the props - swc: Hard crash - **esbuild**: Print an error — Following Babel was chosen for this one because this might help people catch configuration issues where JSX files are being parsed by multiple tools - Element has an "implicit true" key prop, e.g. `<a key />`: - Babel: Print an error indicating that "key" props require an explicit value - TypeScript: Silently omit the "key" prop - swc: Hard crash - **esbuild**: Print an error like Babel — This might help catch legitimate programming mistakes - Element has spread children, e.g. `<a>{...children}</a>` - Babel: Print an error stating that React doesn't support spread children - TypeScript: Use static jsx function and pass children as-is, including spread operator - swc: same as Babel - **esbuild**: Same as TypeScript Also note that TypeScript has some bugs regarding JSX development mode and the generation of `lineNumber` and `columnNumber` values. Babel's values are accurate though, so esbuild's line and column numbers match Babel. Both numbers are 1-based and columns are counted in terms of UTF-16 code units. This feature was contributed by [@&#8203;jgoz](https://github.com/jgoz). ### [`v0.14.50`](https://github.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#&#8203;01450) [Compare Source](https://github.com/evanw/esbuild/compare/v0.14.49...v0.14.50) - Emit `names` in source maps ([#&#8203;1296](https://github.com/evanw/esbuild/issues/1296)) The [source map specification](https://sourcemaps.info/spec.html) includes an optional `names` field that can associate an identifier with a mapping entry. This can be used to record the original name for an identifier, which is useful if the identifier was renamed to something else in the generated code. When esbuild was originally written, this field wasn't widely used, but now there are some debuggers that make use of it to provide better debugging of minified code. With this release, esbuild now includes a `names` field in the source maps that it generates. To save space, the original name is only recorded when it's different from the final name. - Update parser for arrow functions with initial default type parameters in `.tsx` files ([#&#8203;2410](https://github.com/evanw/esbuild/issues/2410)) TypeScript 4.6 introduced a [change to the parsing of JSX syntax in `.tsx` files](https://github.com/microsoft/TypeScript/issues/47062). Now a `<` token followed by an identifier and then a `=` token is parsed as an arrow function with a default type parameter instead of as a JSX element. This release updates esbuild's parser to match TypeScript's parser. - Fix an accidental infinite loop with `--define` substitution ([#&#8203;2407](https://github.com/evanw/esbuild/issues/2407)) This is a fix for a regression that was introduced in esbuild version 0.14.44 where certain `--define` substitutions could result in esbuild crashing with a stack overflow. The problem was an incorrect fix for [#&#8203;2292](https://github.com/evanw/esbuild/issues/2292). The fix merged the code paths for `--define` and `--jsx-factory` rewriting since the value substitution is now the same for both. However, doing this accidentally made `--define` substitution recursive since the JSX factory needs to be able to match against `--define` substitutions to integrate with the `--inject` feature. The fix is to only do one additional level of matching against define substitutions, and to only do this for JSX factories. Now these cases are able to build successfully without a stack overflow. - Include the "public path" value in hashes ([#&#8203;2403](https://github.com/evanw/esbuild/issues/2403)) The `--public-path=` configuration value affects the paths that esbuild uses to reference files from other files and is used in various situations such as cross-chunk imports in JS and references to asset files from CSS files. However, it wasn't included in the hash calculations used for file names due to an oversight. This meant that changing the public path setting incorrectly didn't result in the hashes in file names changing even though the contents of the files changed. This release fixes the issue by including a hash of the public path in all non-asset output files. - Fix a cross-platform consistency bug ([#&#8203;2383](https://github.com/evanw/esbuild/issues/2383)) Previously esbuild would minify `0xFFFF_FFFF_FFFF_FFFF` as `0xffffffffffffffff` (18 bytes) on arm64 chips and as `18446744073709552e3` (19 bytes) on x86\_64 chips. The reason was that the number was converted to a 64-bit unsigned integer internally for printing as hexadecimal, the 64-bit floating-point number `0xFFFF_FFFF_FFFF_FFFF` is actually `0x1_0000_0000_0000_0180` (i.e. it's rounded up, not down), and converting `float64` to `uint64` is implementation-dependent in Go when the input is out of bounds. This was fixed by changing the upper limit for which esbuild uses hexadecimal numbers during minification to `0xFFFF_FFFF_FFFF_F800`, which is the next representable 64-bit floating-point number below `0x1_0000_0000_0000_0180`, and which fits in a `uint64`. As a result, esbuild will now consistently never minify `0xFFFF_FFFF_FFFF_FFFF` as `0xffffffffffffffff` anymore, which means the output should now be consistent across platforms. - Fix a hang with the synchronous API when the package is corrupted ([#&#8203;2396](https://github.com/evanw/esbuild/issues/2396)) An error message is already thrown when the esbuild package is corrupted and esbuild can't be run. However, if you are using a synchronous call in the JavaScript API in worker mode, esbuild will use a child worker to initialize esbuild once so that the overhead of initializing esbuild can be amortized across multiple synchronous API calls. However, errors thrown during initialization weren't being propagated correctly which resulted in a hang while the main thread waited forever for the child worker to finish initializing. With this release, initialization errors are now propagated correctly so calling a synchronous API call when the package is corrupted should now result in an error instead of a hang. - Fix `tsconfig.json` files that collide with directory names ([#&#8203;2411](https://github.com/evanw/esbuild/issues/2411)) TypeScript lets you write `tsconfig.json` files with `extends` clauses that refer to another config file using an implicit `.json` file extension. However, if the config file without the `.json` extension existed as a directory name, esbuild and TypeScript had different behavior. TypeScript ignores the directory and continues looking for the config file by adding the `.json` extension while esbuild previously terminated the search and then failed to load the config file (because it's a directory). With this release, esbuild will now ignore exact matches when resolving `extends` fields in `tsconfig.json` files if the exact match results in a directory. - Add `platform` to the transform API ([#&#8203;2362](https://github.com/evanw/esbuild/issues/2362)) The `platform` option is mainly relevant for bundling because it mostly affects path resolution (e.g. activating the `"browser"` field in `package.json` files), so it was previously only available for the build API. With this release, it has additionally be made available for the transform API for a single reason: you can now set `--platform=node` when transforming a string so that esbuild will add export annotations for node, which is only relevant when `--format=cjs` is also present. This has to do with an implementation detail of node that parses the AST of CommonJS files to discover named exports when importing CommonJS from ESM. However, this new addition to esbuild's API is of questionable usefulness. Node's loader API (the main use case for using esbuild's transform API like this) actually bypasses the content returned from the loader and parses the AST that's present on the file system, so you won't actually be able to use esbuild's API for this. See the linked issue for more information. </details> --- ### 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. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTEuMiIsInVwZGF0ZWRJblZlciI6IjMyLjExMS4yIn0=-->
renovate added the
dependencies
label 2022-07-25 06:02:42 +00:00
Member

Hi renovate!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://2191-renovate-esbuild-0-x--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi renovate! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://2191-renovate-esbuild-0-x--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
renovate changed title from chore(deps): update dependency esbuild to v0.14.50 to chore(deps): update dependency esbuild to v0.14.51 2022-07-28 16:02:52 +00:00
renovate force-pushed renovate/esbuild-0.x from 9ab8cd5f95 to 3b2c29b5d9 2022-07-28 16:02:53 +00:00 Compare
konrad merged commit 0b01f2aace into main 2022-07-31 13:46:22 +00:00
konrad deleted branch renovate/esbuild-0.x 2022-07-31 13:46:23 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.