Naila / Discord-chat-replica

Open Software License 3.0
24 stars 15 forks source link

Bump esbuild from 0.8.57 to 0.17.6 #196

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps esbuild from 0.8.57 to 0.17.6.

Release notes

Sourced from esbuild's releases.

v0.17.6

  • Fix a CSS parser crash on invalid CSS (#2892)

    Previously the following invalid CSS caused esbuild's parser to crash:

    @media screen
    

    The crash was caused by trying to construct a helpful error message assuming that there was an opening { token, which is not the case here. This release fixes the crash.

  • Inline TypeScript enums that are referenced before their declaration

    Previously esbuild inlined enums within a TypeScript file from top to bottom, which meant that references to TypeScript enum members were only inlined within the same file if they came after the enum declaration. With this release, esbuild will now inline enums even when they are referenced before they are declared:

    // Original input
    export const foo = () => Foo.FOO
    const enum Foo { FOO = 0 }
    

    // Old output (with --tree-shaking=true) export const foo = () => Foo.FOO; var Foo = /* @PURE */ ((Foo2) => { Foo2[Foo2["FOO"] = 0] = "FOO"; return Foo2; })(Foo || {});

    // New output (with --tree-shaking=true) export const foo = () => 0 /* FOO */;

    This makes esbuild's TypeScript output smaller and faster when processing code that does this. I noticed this issue when I ran the TypeScript compiler's source code through esbuild's bundler. Now that the TypeScript compiler is going to be bundled with esbuild in the upcoming TypeScript 5.0 release, improvements like this will also improve the TypeScript compiler itself!

  • Fix esbuild installation on Arch Linux (#2785, #2812, #2865)

    Someone made an unofficial esbuild package for Linux that adds the ESBUILD_BINARY_PATH=/usr/bin/esbuild environment variable to the user's default environment. This breaks all npm installations of esbuild for users with this unofficial Linux package installed, which has affected many people. Most (all?) people who encounter this problem haven't even installed this unofficial package themselves; instead it was installed for them as a dependency of another Linux package. The problematic change to add the ESBUILD_BINARY_PATH environment variable was reverted in the latest version of this unofficial package. However, old versions of this unofficial package are still there and will be around forever. With this release, ESBUILD_BINARY_PATH is now ignored by esbuild's install script when it's set to the value /usr/bin/esbuild. This should unbreak using npm to install esbuild in these problematic Linux environments.

    Note: The ESBUILD_BINARY_PATH variable is an undocumented way to override the location of esbuild's binary when esbuild's npm package is installed, which is necessary to substitute your own locally-built esbuild binary when debugging esbuild's npm package. It's only meant for very custom situations and should absolutely not be forced on others by default, especially without their knowledge. I may remove the code in esbuild's installer that reads ESBUILD_BINARY_PATH in the future to prevent these kinds of issues. It will unfortunately make debugging esbuild harder. If ESBUILD_BINARY_PATH is ever removed, it will be done in a "breaking change" release.

v0.17.5

  • Parse const type parameters from TypeScript 5.0

    The TypeScript 5.0 beta announcement adds const type parameters to the language. You can now add the const modifier on a type parameter of a function, method, or class like this:

    type HasNames = { names: readonly string[] };
    const getNamesExactly = <const T extends HasNames>(arg: T): T["names"] => arg.names;
    const names = getNamesExactly({ names: ["Alice", "Bob", "Eve"] });
    

... (truncated)

Changelog

Sourced from esbuild's changelog.

Changelog: 2021

This changelog documents all esbuild versions published in the year 2021 (versions 0.8.29 through 0.14.10).

0.14.10

  • Enable tree shaking of classes with lowered static fields (#175)

    If the configured target environment doesn't support static class fields, they are converted into a call to esbuild's __publicField function instead. However, esbuild's tree-shaking pass treated this call as a side effect, which meant that all classes with static fields were ineligible for tree shaking. This release fixes the problem by explicitly ignoring calls to the __publicField function during tree shaking side-effect determination. Tree shaking is now enabled for these classes:

    // Original code
    class Foo { static foo = 'foo' }
    class Bar { static bar = 'bar' }
    new Bar()
    

    // Old output (with --tree-shaking=true --target=es6) class Foo { } __publicField(Foo, "foo", "foo"); class Bar { } __publicField(Bar, "bar", "bar"); new Bar();

    // New output (with --tree-shaking=true --target=es6) class Bar { } __publicField(Bar, "bar", "bar"); new Bar();

  • Treat --define:foo=undefined as an undefined literal instead of an identifier (#1407)

    References to the global variable undefined are automatically replaced with the literal value for undefined, which appears as void 0 when printed. This allows for additional optimizations such as collapsing undefined ?? bar into just bar. However, this substitution was not done for values specified via --define:. As a result, esbuild could potentially miss out on certain optimizations in these cases. With this release, it's now possible to use --define: to substitute something with an undefined literal:

    // Original code
    let win = typeof window !== 'undefined' ? window : {}
    

    // Old output (with --define:window=undefined --minify) let win=typeof undefined!="undefined"?undefined:{};

    // New output (with --define:window=undefined --minify) let win={};

  • Add the --drop:debugger flag (#1809)

    Passing this flag causes all debugger; statements to be removed from the output. This is similar to the drop_debugger: true flag available in the popular UglifyJS and Terser JavaScript minifiers.

... (truncated)

Commits
  • e1143a7 publish 0.17.6 to npm
  • 7b8b0b5 fix esbuild installation on arch linux
  • 0d7c6f1 fix #2892: css parser bug with @-rules without {
  • d8a86ca work around a flake in node's execFileSync call
  • 4e53c27 avoid a new problem with go clean -testcache
  • 606c425 update test error message for go 1.20
  • d720969 avoid wasm stack overflow in tests
  • efd6590 labels don't care about scope
  • df50e53 update go 1.19.5 => 1.20
  • 362cae8 better JSX unexpected EOF error message
  • 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 1 year ago

Superseded by #197.