Naila / Discord-chat-replica

Open Software License 3.0
24 stars 15 forks source link

Bump esbuild from 0.8.57 to 0.14.19 #120

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps esbuild from 0.8.57 to 0.14.19.

Release notes

Sourced from esbuild's releases.

v0.14.19

  • Special-case const inlining at the top of a scope (#1317, #1981)

    The minifier now inlines const variables (even across modules during bundling) if a certain set of specific requirements are met:

    • All const variables to be inlined are at the top of their scope
    • That scope doesn't contain any import or export statements with paths
    • All constants to be inlined are null, undefined, true, false, an integer, or a short real number
    • Any expression outside of a small list of allowed ones stops constant identification

    Practically speaking this basically means that you can trigger this optimization by just putting the constants you want inlined into a separate file (e.g. constants.js) and bundling everything together.

    These specific conditions are present to avoid esbuild unintentionally causing any behavior changes by inlining constants when the variable reference could potentially be evaluated before being declared. It's possible to identify more cases where constants can be inlined but doing so may require complex call graph analysis so it has not been implemented. Although these specific heuristics may change over time, this general approach to constant inlining should continue to work going forward.

    Here's an example:

    // Original code
    const bold = 1 << 0;
    const italic = 1 << 1;
    const underline = 1 << 2;
    const font = bold | italic | underline;
    console.log(font);
    

    // Old output (with --minify --bundle) (()=>{var o=1<<0,n=1<<1,c=1<<2,t=o|n|c;console.log(t);})();

    // New output (with --minify --bundle) (()=>{console.log(7);})();

v0.14.18

  • Add the --mangle-cache= feature (#1977)

    This release adds a cache API for the newly-released --mangle-props= feature. When enabled, all mangled property renamings are recorded in the cache during the initial build. Subsequent builds reuse the renamings stored in the cache and add additional renamings for any newly-added properties. This has a few consequences:

    • You can customize what mangled properties are renamed to by editing the cache before passing it to esbuild (the cache is a map of the original name to the mangled name).

    • The cache serves as a list of all properties that were mangled. You can easily scan it to see if there are any unexpected property renamings.

    • You can disable mangling for individual properties by setting the renamed value to false instead of to a string. This is similar to the --reserve-props= setting but on a per-property basis.

    • You can ensure consistent renaming between builds (e.g. a main-thread file and a web worker, or a library and a plugin). Without this feature, each build would do an independent renaming operation and the mangled property names likely wouldn't be consistent.

    Here's how to use it:

    • CLI

      $ esbuild example.ts --mangle-props=_$ --mangle-cache=cache.json
      

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.14.19

  • Special-case const inlining at the top of a scope (#1317, #1981)

    The minifier now inlines const variables (even across modules during bundling) if a certain set of specific requirements are met:

    • All const variables to be inlined are at the top of their scope
    • That scope doesn't contain any import or export statements with paths
    • All constants to be inlined are null, undefined, true, false, an integer, or a short real number
    • Any expression outside of a small list of allowed ones stops constant identification

    Practically speaking this basically means that you can trigger this optimization by just putting the constants you want inlined into a separate file (e.g. constants.js) and bundling everything together.

    These specific conditions are present to avoid esbuild unintentionally causing any behavior changes by inlining constants when the variable reference could potentially be evaluated before being declared. It's possible to identify more cases where constants can be inlined but doing so may require complex call graph analysis so it has not been implemented. Although these specific heuristics may change over time, this general approach to constant inlining should continue to work going forward.

    Here's an example:

    // Original code
    const bold = 1 << 0;
    const italic = 1 << 1;
    const underline = 1 << 2;
    const font = bold | italic | underline;
    console.log(font);
    

    // Old output (with --minify --bundle) (()=>{var o=1<<0,n=1<<1,c=1<<2,t=o|n|c;console.log(t);})();

    // New output (with --minify --bundle) (()=>{console.log(7);})();

0.14.18

  • Add the --mangle-cache= feature (#1977)

    This release adds a cache API for the newly-released --mangle-props= feature. When enabled, all mangled property renamings are recorded in the cache during the initial build. Subsequent builds reuse the renamings stored in the cache and add additional renamings for any newly-added properties. This has a few consequences:

    • You can customize what mangled properties are renamed to by editing the cache before passing it to esbuild (the cache is a map of the original name to the mangled name).

    • The cache serves as a list of all properties that were mangled. You can easily scan it to see if there are any unexpected property renamings.

    • You can disable mangling for individual properties by setting the renamed value to false instead of to a string. This is similar to the --reserve-props= setting but on a per-property basis.

    • You can ensure consistent renaming between builds (e.g. a main-thread file and a web worker, or a library and a plugin). Without this feature, each build would do an independent renaming operation and the mangled property names likely wouldn't be consistent.

    Here's how to use it:

    • CLI

... (truncated)

Commits
  • 256ab49 publish 0.14.19 to npm
  • f479f62 fix changelog
  • 2e074f9 only minify string.length outside assign targets
  • 06843d4 minify "foo".length into 3
  • ed341b0 omit ts enum name comments when minifying names
  • 51d866a retain more enum information when not folding
  • 4da5b95 pull out utf8/utf6 code from parser
  • 41f420d add some numeric constant folding to the printer
  • e50817b minify enables "~" constant folding
  • 9dfeae7 Fix a mention of "EImportString" from "EImportCall" (#1974)
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 2 years ago

Superseded by #121.