chore(deps): update dependency esbuild to v0.12.26 #729

Merged
konrad merged 1 commits from renovate/esbuild-0.x into main 2021-09-09 16:17:12 +00:00
Member

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.12.25 -> 0.12.26

Release Notes

evanw/esbuild

v0.12.26

Compare Source

  • Add --analyze to print information about the bundle (#​1568)

    The --metafile= flag tells esbuild to write information about the bundle into the provided metadata file in JSON format. It contains information about the input files and which other files each one imports, as well as the output files and which input files they include. This information is sufficient to answer many questions such as:

    • Which files are in my bundle?
    • What's are the biggest files in my bundle?
    • Why is this file included in my bundle?

    Previously you had to either write your own code to answer these questions, or use another tool such as https://bundle-buddy.com/esbuild to visualize the data. Starting with this release you can now also use --analyze to enable esbuild's built-in visualizer. It looks like this:

    $ esbuild --bundle example.jsx --outfile=out.js --minify --analyze
    
      out.js  27.6kb
    
    ⚡ Done in 6ms
    
      out.js                                                                    27.6kb  100.0%
       ├ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js  19.2kb   69.8%
       ├ node_modules/react/cjs/react.production.min.js                          5.9kb   21.4%
       ├ node_modules/object-assign/index.js                                     965b     3.4%
       ├ example.jsx                                                             137b     0.5%
       ├ node_modules/react-dom/server.browser.js                                 50b     0.2%
       └ node_modules/react/index.js                                              50b     0.2%
    

    This tells you what input files were bundled into each output file as well as the final minified size contribution of each input file as well as the percentage of the output file it takes up. You can also enable verbose analysis with --analyze=verbose to see why each input file was included (i.e. which files imported it from the entry point file):

    $ esbuild --bundle example.jsx --outfile=out.js --minify --analyze=verbose
    
      out.js  27.6kb
    
    ⚡ Done in 6ms
    
      out.js ─────────────────────────────────────────────────────────────────── 27.6kb ─ 100.0%
       ├ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js ─ 19.2kb ── 69.8%
       │  └ node_modules/react-dom/server.browser.js
       │     └ example.jsx
       ├ node_modules/react/cjs/react.production.min.js ───────────────────────── 5.9kb ── 21.4%
       │  └ node_modules/react/index.js
       │     └ example.jsx
       ├ node_modules/object-assign/index.js ──────────────────────────────────── 965b ──── 3.4%
       │  └ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js
       │     └ node_modules/react-dom/server.browser.js
       │        └ example.jsx
       ├ example.jsx ──────────────────────────────────────────────────────────── 137b ──── 0.5%
       ├ node_modules/react-dom/server.browser.js ──────────────────────────────── 50b ──── 0.2%
       │  └ example.jsx
       └ node_modules/react/index.js ───────────────────────────────────────────── 50b ──── 0.2%
          └ example.jsx
    

    There is also a JS API for this:

    const result = await esbuild.build({
      metafile: true,
      ...
    })
    console.log(await esbuild.analyzeMetafile(result.metafile, {
      verbose: true,
    }))
    

    and a Go API:

    result := api.Build(api.BuildOptions{
      Metafile: true,
      ...
    })
    fmt.Println(api.AnalyzeMetafile(result.Metafile, api.AnalyzeMetafileOptions{
      Verbose: true,
    }))
    

    Note that this is not the only way to visualize this data. If you want a visualization that's different than the information displayed here, you can easily build it yourself using the information in the metafile that is generated with the --metafile= flag.

    Also note that this data is intended for humans, not machines. The specific format of this data may change over time which will likely break any tools that try to parse it. You should not write a tool to parse this data. You should be using the information in the JSON metadata file instead. Everything in this visualization is derived from the JSON metadata so you are not losing out on any information by not using esbuild's output.

  • Allow require.resolve in non-node builds (#​1579)

    With this release, you can now use require.resolve in builds when the target platform is set to browser instead of node as long as the function window.require.resolve exists somehow. This was already possible when the platform is node but when the platform is browser, esbuild generates a no-op shim require function for compatibility reasons (e.g. because some code expects typeof require must be "function" even in the browser). The shim previously had a fallback to window.require if it exists, but additional properties of the require function such as require.resolve were not copied over to the shim. Now the shim function is only used if window.require is undefined so additional properties such as require.resolve should now work.

    This change was contributed by @​screetBloom.


Configuration

📅 Schedule: 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, check this box.

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.12.25` -> `0.12.26`](https://renovatebot.com/diffs/npm/esbuild/0.12.25/0.12.26) | --- ### Release Notes <details> <summary>evanw/esbuild</summary> ### [`v0.12.26`](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#&#8203;01226) [Compare Source](https://github.com/evanw/esbuild/compare/v0.12.25...v0.12.26) - Add `--analyze` to print information about the bundle ([#&#8203;1568](https://github.com/evanw/esbuild/issues/1568)) The `--metafile=` flag tells esbuild to write information about the bundle into the provided metadata file in JSON format. It contains information about the input files and which other files each one imports, as well as the output files and which input files they include. This information is sufficient to answer many questions such as: - Which files are in my bundle? - What's are the biggest files in my bundle? - Why is this file included in my bundle? Previously you had to either write your own code to answer these questions, or use another tool such as https://bundle-buddy.com/esbuild to visualize the data. Starting with this release you can now also use `--analyze` to enable esbuild's built-in visualizer. It looks like this: $ esbuild --bundle example.jsx --outfile=out.js --minify --analyze out.js 27.6kb ⚡ Done in 6ms out.js 27.6kb 100.0% ├ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js 19.2kb 69.8% ├ node_modules/react/cjs/react.production.min.js 5.9kb 21.4% ├ node_modules/object-assign/index.js 965b 3.4% ├ example.jsx 137b 0.5% ├ node_modules/react-dom/server.browser.js 50b 0.2% └ node_modules/react/index.js 50b 0.2% This tells you what input files were bundled into each output file as well as the final minified size contribution of each input file as well as the percentage of the output file it takes up. You can also enable verbose analysis with `--analyze=verbose` to see why each input file was included (i.e. which files imported it from the entry point file): $ esbuild --bundle example.jsx --outfile=out.js --minify --analyze=verbose out.js 27.6kb ⚡ Done in 6ms out.js ─────────────────────────────────────────────────────────────────── 27.6kb ─ 100.0% ├ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js ─ 19.2kb ── 69.8% │ └ node_modules/react-dom/server.browser.js │ └ example.jsx ├ node_modules/react/cjs/react.production.min.js ───────────────────────── 5.9kb ── 21.4% │ └ node_modules/react/index.js │ └ example.jsx ├ node_modules/object-assign/index.js ──────────────────────────────────── 965b ──── 3.4% │ └ node_modules/react-dom/cjs/react-dom-server.browser.production.min.js │ └ node_modules/react-dom/server.browser.js │ └ example.jsx ├ example.jsx ──────────────────────────────────────────────────────────── 137b ──── 0.5% ├ node_modules/react-dom/server.browser.js ──────────────────────────────── 50b ──── 0.2% │ └ example.jsx └ node_modules/react/index.js ───────────────────────────────────────────── 50b ──── 0.2% └ example.jsx There is also a JS API for this: ```js const result = await esbuild.build({ metafile: true, ... }) console.log(await esbuild.analyzeMetafile(result.metafile, { verbose: true, })) ``` and a Go API: ```js result := api.Build(api.BuildOptions{ Metafile: true, ... }) fmt.Println(api.AnalyzeMetafile(result.Metafile, api.AnalyzeMetafileOptions{ Verbose: true, })) ``` Note that this is not the only way to visualize this data. If you want a visualization that's different than the information displayed here, you can easily build it yourself using the information in the metafile that is generated with the `--metafile=` flag. Also note that this data is intended for humans, not machines. The specific format of this data may change over time which will likely break any tools that try to parse it. You should not write a tool to parse this data. You should be using the information in the JSON metadata file instead. Everything in this visualization is derived from the JSON metadata so you are not losing out on any information by not using esbuild's output. - Allow `require.resolve` in non-node builds ([#&#8203;1579](https://github.com/evanw/esbuild/issues/1579)) With this release, you can now use `require.resolve` in builds when the target platform is set to `browser` instead of `node` as long as the function `window.require.resolve` exists somehow. This was already possible when the platform is `node` but when the platform is `browser`, esbuild generates a no-op shim `require` function for compatibility reasons (e.g. because some code expects `typeof require` must be `"function"` even in the browser). The shim previously had a fallback to `window.require` if it exists, but additional properties of the `require` function such as `require.resolve` were not copied over to the shim. Now the shim function is only used if `window.require` is undefined so additional properties such as `require.resolve` should now work. This change was contributed by [@&#8203;screetBloom](https://github.com/screetBloom). </details> --- ### Configuration 📅 **Schedule**: 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, check this box. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
renovate added the
dependencies
label 2021-09-09 15:01:29 +00:00
renovate added 1 commit 2021-09-09 15:01:29 +00:00
continuous-integration/drone/pr Build is passing Details
5feca94d32
chore(deps): update dependency esbuild to v0.12.26
konrad merged commit 33f1480284 into main 2021-09-09 16:17:12 +00:00
konrad deleted branch renovate/esbuild-0.x 2021-09-09 16:17:12 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.