Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev dependencies #67

Merged
merged 1 commit into from May 1, 2022
Merged

Update dev dependencies #67

merged 1 commit into from May 1, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 1, 2022

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@types/node ^16.11.26 -> ^16.11.32 age adoption passing confidence
@typescript-eslint/eslint-plugin ^5.13.0 -> ^5.21.0 age adoption passing confidence
@typescript-eslint/parser ^5.13.0 -> ^5.21.0 age adoption passing confidence
c8 ^7.11.0 -> ^7.11.2 age adoption passing confidence
esbuild ^0.14.23 -> ^0.14.38 age adoption passing confidence
eslint (source) ^8.10.0 -> ^8.14.0 age adoption passing confidence
nodemon (source) ^2.0.15 -> ^2.0.16 age adoption passing confidence
sinon (source) ^13.0.1 -> ^13.0.2 age adoption passing confidence
ts-morph ^13.0.3 -> ^14.0.0 age adoption passing confidence
typedoc (source) ^0.22.12 -> ^0.22.15 age adoption passing confidence

Release Notes

typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

v5.21.0

Compare Source

Bug Fixes
  • eslint-plugin: [no-misused-promises] prioritize false returns when checking whether a function returns only void (#​4841) (ccadb60)
  • eslint-plugin: [no-namespace] fix false positive for exported namespaces when allowDeclarations=true (#​4844) (4e7c9be)
  • eslint-plugin: [space-infix-ops] fix no error when right type is function (#​4848) (d74d559)
Features
  • eslint-plugin: [parameter-properties] add rule to replace no-parameter-properties (#​4622) (88ed9ec)

v5.20.0

Compare Source

Features
  • eslint-plugin: [no-magic-numbers] ignoreTypeIndexes option (#​4789) (5e79451)

v5.19.0

Compare Source

Bug Fixes
Features
  • eslint-plugin: [unified-signatures] add ignoreDifferentlyNamedParameters option (#​4659) (fdf95e0)
  • eslint-plugin: add support for valid number and bigint intersections in restrict-plus-operands rule (#​4795) (19c600a)

v5.18.0

Compare Source

Bug Fixes
  • eslint-plugin: method-signature-style respect getter signature (#​4777) (12dd670)
Features
  • eslint-plugin: [no-shadow] ignoreOnInitialization option (#​4603) (068ea9b)
  • eslint-plugin: [no-this-alias] report on assignment expressions (#​4718) (8329498)

v5.17.0

Compare Source

Features
  • eslint-plugin: [no-unused-vars] add destructuredArrayIgnorePattern options (#​4748) (6f8db8b)

v5.16.0

Compare Source

Bug Fixes
  • eslint-plugin: [consistent-type-assertions] enforce assertionStyle for const assertions (#​4685) (8ec05be)
Features
  • eslint-plugin: [prefer-optional-chain] support logical with empty object (#​4430) (d21cfe0)

v5.15.0

Compare Source

Features

v5.14.0

Compare Source

Bug Fixes
  • eslint-plugin: [naming-convention] cover case that requires quotes (#​4582) (3ea0947)
  • eslint-plugin: [no-misused-promises] factor thenable returning function overload signatures (#​4620) (56a09e9)
  • eslint-plugin: [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error (#​4343) (a65713a)
  • eslint-plugin: [return-await] correct autofixer in binary expression (#​4401) (5fa2fad)
Features
  • eslint-plugin: [no-misused-promises] add granular options within checksVoidReturns (#​4623) (1085177)
typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

v5.21.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.20.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.19.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.18.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.17.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.16.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

v5.15.0

Compare Source

Features

v5.14.0

Compare Source

Note: Version bump only for package @​typescript-eslint/parser

bcoe/c8

v7.11.2

Compare Source

v7.11.1

Compare Source

evanw/esbuild

v0.14.38

Compare Source

  • Further fixes to TypeScript 4.7 instantiation expression parsing (#​2201)

    This release fixes some additional edge cases with parsing instantiation expressions from the upcoming version 4.7 of TypeScript. Previously it was allowed for an instantiation expression to precede a binary operator but with this release, that's no longer allowed. This was sometimes valid in the TypeScript 4.7 beta but is no longer allowed in the latest version of TypeScript 4.7. Fixing this also fixed a regression that was introduced by the previous release of esbuild:

    Code TS 4.6.3 TS 4.7.0 beta TS 4.7.0 nightly esbuild 0.14.36 esbuild 0.14.37 esbuild 0.14.38
    a<b> == c<d> Invalid a == c Invalid a == c a == c Invalid
    a<b> in c<d> Invalid Invalid Invalid Invalid a in c Invalid
    a<b>>=c<d> Invalid Invalid Invalid Invalid a >= c Invalid
    a<b>=c<d> Invalid a < b >= c a = c a < b >= c a = c a = c
    a<b>>c<d> a < b >> c a < b >> c a < b >> c a < b >> c a > c a < b >> c

    This table illustrates some of the more significant changes between all of these parsers. The most important part is that esbuild 0.14.38 now matches the behavior of the latest TypeScript compiler for all of these cases.

v0.14.37

Compare Source

  • Add support for TypeScript's moduleSuffixes field from TypeScript 4.7

    The upcoming version of TypeScript adds the moduleSuffixes field to tsconfig.json that introduces more rules to import path resolution. Setting moduleSuffixes to [".ios", ".native", ""] will try to look at the the relative files ./foo.ios.ts, ./foo.native.ts, and finally ./foo.ts for an import path of ./foo. Note that the empty string "" in moduleSuffixes is necessary for TypeScript to also look-up ./foo.ts. This was announced in the TypeScript 4.7 beta blog post.

  • Match the new ASI behavior from TypeScript nightly builds (#​2188)

    This release updates esbuild to match some very recent behavior changes in the TypeScript parser regarding automatic semicolon insertion. For more information, see TypeScript issues #​48711 and #​48654 (I'm not linking to them directly to avoid Dependabot linkback spam on these issues due to esbuild's popularity). The result is that the following TypeScript code is now considered valid TypeScript syntax:

    class A<T> {}
    new A<number> /* ASI now happens here */
    if (0) {}
    
    interface B {
      (a: number): typeof a /* ASI now happens here */
      <T>(): void
    }

    This fix was contributed by @​g-plane.

v0.14.36

Compare Source

  • Revert path metadata validation for now (#​2177)

    This release reverts the path metadata validation that was introduced in the previous release. This validation has uncovered a potential issue with how esbuild handles onResolve callbacks in plugins that will need to be fixed before path metadata validation is re-enabled.

v0.14.35

Compare Source

  • Add support for parsing typeof on #private fields from TypeScript 4.7 (#​2174)

    The upcoming version of TypeScript now lets you use #private fields in typeof type expressions:

    https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#typeof-on-private-fields

    class Container {
      #data = "hello!";
    
      get data(): typeof this.#data {
        return this.#data;
      }
    
      set data(value: typeof this.#data) {
        this.#data = value;
      }
    }

    With this release, esbuild can now parse these new type expressions as well. This feature was contributed by @​magic-akari.

  • Add Opera and IE to internal CSS feature support matrix (#​2170)

    Version 0.14.18 of esbuild added Opera and IE as available target environments, and added them to the internal JS feature support matrix. CSS feature support was overlooked, however. This release adds knowledge of Opera and IE to esbuild's internal CSS feature support matrix:

    /* Original input */
    a {
      color: rgba(0, 0, 0, 0.5);
    }
    
    /* Old output (with --target=opera49 --minify) */
    a{color:rgba(0,0,0,.5)}
    
    /* New output (with --target=opera49 --minify) */
    a{color:#&#8203;00000080}

    The fix for this issue was contributed by @​sapphi-red.

  • Change TypeScript class field behavior when targeting ES2022

    TypeScript 4.3 introduced a breaking change where class field behavior changes from assign semantics to define semantics when the target setting in tsconfig.json is set to ESNext. Specifically, the default value for TypeScript's useDefineForClassFields setting when unspecified is true if and only if target is ESNext. TypeScript 4.6 introduced another change where this behavior now happens for both ESNext and ES2022. Presumably this will be the case for ES2023 and up as well. With this release, esbuild's behavior has also been changed to match. Now configuring esbuild with --target=es2022 will also cause TypeScript files to use the new class field behavior.

  • Validate that path metadata returned by plugins is consistent

    The plugin API assumes that all metadata for the same path returned by a plugin's onResolve callback is consistent. Previously this assumption was just assumed without any enforcement. Starting with this release, esbuild will now enforce this by generating a build error if this assumption is violated. The lack of validation has not been an issue (I have never heard of this being a problem), but it still seems like a good idea to enforce it. Here's a simple example of a plugin that generates inconsistent sideEffects metadata:

    let buggyPlugin = {
      name: 'buggy',
      setup(build) {
        let count = 0
        build.onResolve({ filter: /^react$/ }, args => {
          return {
            path: require.resolve(args.path),
            sideEffects: count++ > 0,
          }
        })
      },
    }

    Since esbuild processes everything in parallel, the set of metadata that ends up being used for a given path is essentially random since it's whatever the task scheduler decides to schedule first. Thus if a plugin does not consistently provide the same metadata for a given path, subsequent builds may return different results. This new validation check prevents this problem.

    Here's the new error message that's shown when this happens:

    ✘ [ERROR] [plugin buggy] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:
    
        button.tsx:1:30:
          1 │ import { createElement } from 'react'
            ╵                               ~~~~~~~
    
      The original metadata for that path comes from when it was imported here:
    
        app.tsx:1:23:
          1 │ import * as React from 'react'
            ╵                        ~~~~~~~
    
      The difference in metadata is displayed below:
    
       {
      -  "sideEffects": true,
      +  "sideEffects": false,
       }
    
      This is a bug in the "buggy" plugin. Plugins provide metadata for a given path in an "onResolve"
      callback. All metadata provided for the same path must be consistent to ensure deterministic
      builds. Due to parallelism, one set of provided metadata will be randomly chosen for a given path,
      so providing inconsistent metadata for the same path can cause non-determinism.
    
  • Suggest enabling a missing condition when exports map fails (#​2163)

    This release adds another suggestion to the error message that happens when an exports map lookup fails if the failure could potentially be fixed by adding a missing condition. Here's what the new error message looks like (which now suggests --conditions=module as a possible workaround):

    ✘ [ERROR] Could not resolve "@&#8203;sentry/electron/main"
    
        index.js:1:24:
          1 │ import * as Sentry from '@&#8203;sentry/electron/main'
            ╵                         ~~~~~~~~~~~~~~~~~~~~~~~
    
      The path "./main" is not currently exported by package "@&#8203;sentry/electron":
    
        node_modules/@&#8203;sentry/electron/package.json:8:13:
          8 │   "exports": {
            ╵              ^
    
      None of the conditions provided ("require", "module") match any of the currently active conditions
      ("browser", "default", "import"):
    
        node_modules/@&#8203;sentry/electron/package.json:16:14:
          16 │     "./main": {
             ╵               ^
    
      Consider enabling the "module" condition if this package expects it to be enabled. You can use
      "--conditions=module" to do that:
    
        node_modules/@&#8203;sentry/electron/package.json:18:6:
          18 │       "module": "./esm/main/index.js"
             ╵       ~~~~~~~~
    
      Consider using a "require()" call to import this file, which will work because the "require"
      condition is supported by this package:
    
        index.js:1:24:
          1 │ import * as Sentry from '@&#8203;sentry/electron/main'
            ╵                         ~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "@&#8203;sentry/electron/main" as external to exclude it from the bundle, which
      will remove this error.
    

    This particular package had an issue where it was using the Webpack-specific module condition without providing a default condition. It looks like the intent in this case was to use the standard import condition instead. This specific change wasn't suggested here because this error message is for package consumers, not package authors.

v0.14.34

Compare Source

Something went wrong with the publishing script for the previous release. Publishing again.

v0.14.33

Compare Source

  • Fix a regression regarding super (#​2158)

    This fixes a regression from the previous release regarding classes with a super class, a private member, and a static field in the scenario where the static field needs to be lowered but where private members are supported by the configured target environment. In this scenario, esbuild could incorrectly inject the instance field initializers that use this into the constructor before the call to super(), which is invalid. This problem has now been fixed (notice that this is now used after super() instead of before):

    // Original code
    class Foo extends Object {
      static FOO;
      constructor() {
        super();
      }
      #foo;
    }
    
    // Old output (with --bundle)
    var _foo;
    var Foo = class extends Object {
      constructor() {
        __privateAdd(this, _foo, void 0);
        super();
      }
    };
    _foo = new WeakMap();
    __publicField(Foo, "FOO");
    
    // New output (with --bundle)
    var _foo;
    var Foo = class extends Object {
      constructor() {
        super();
        __privateAdd(this, _foo, void 0);
      }
    };
    _foo = new WeakMap();
    __publicField(Foo, "FOO");

    During parsing, esbuild scans the class and makes certain decisions about the class such as whether to lower all static fields, whether to lower each private member, or whether calls to super() need to be tracked and adjusted. Previously esbuild made two passes through the class members to compute this information. However, with the new super() call lowering logic added in the previous release, we now need three passes to capture the whole dependency chain for this case: 1) lowering static fields requires 2) lowering private members which requires 3) adjusting super() calls.

    The reason lowering static fields requires lowering private members is because lowering static fields moves their initializers outside of the class body, where they can't access private members anymore. Consider this code:

    class Foo {
      get #foo() {}
      static bar = new Foo().#foo
    }

    We can't just lower static fields without also lowering private members, since that causes a syntax error:

    class Foo {
      get #foo() {}
    }
    Foo.bar = new Foo().#foo;

    And the reason lowering private members requires adjusting super() calls is because the injected private member initializers use this, which is only accessible after super() calls in the constructor.

  • Fix an issue with --keep-names not keeping some names (#​2149)

    This release fixes a regression with --keep-names from version 0.14.26. PR #​2062 attempted to remove superfluous calls to the __name helper function by omitting calls of the form __name(foo, "foo") where the name of the symbol in the first argument is equal to the string in the second argument. This was assuming that the initializer for the symbol would automatically be assigned the expected .name property by the JavaScript VM, which turned out to be an incorrect assumption. To fix the regression, this PR has been reverted.

    The assumption is true in many cases but isn't true when the initializer is moved into another automatically-generated variable, which can sometimes be necessary during the various syntax transformations that esbuild does. For example, consider the following code:

    class Foo {
      static get #foo() { return Foo.name }
      static get foo() { return this.#foo }
    }
    let Bar = Foo
    Foo = { name: 'Bar' }
    console.log(Foo.name, Bar.name)

    This code should print Bar Foo. With --keep-names --target=es6 that code is lowered by esbuild into the following code (omitting the helper function definitions for brevity):

    var _foo, foo_get;
    const _Foo = class {
      static get foo() {
        return __privateGet(this, _foo, foo_get);
      }
    };
    let Foo = _Foo;
    __name(Foo, "Foo");
    _foo = new WeakSet();
    foo_get = /* @&#8203;__PURE__ */ __name(function() {
      return _Foo.name;
    }, "#foo");
    __privateAdd(Foo, _foo);
    let Bar = Foo;
    Foo = { name: "Bar" };
    console.log(Foo.name, Bar.name);

    The injection of the automatically-generated _Foo variable is necessary to preserve the semantics of the captured Foo binding for methods defined within the class body, even when the definition needs to be moved outside of the class body during code transformation. Due to a JavaScript quirk, this binding is immutable and does not change even if Foo is later reassigned. The PR that was reverted was incorrectly removing the call to __name(Foo, "Foo"), which turned out to be necessary after all in this case.

  • Print some large integers using hexadecimal when minifying (#​2162)

    When --minify is active, esbuild will now use one fewer byte to represent certain large integers:

    // Original code
    x = 123456787654321;
    
    // Old output (with --minify)
    x=123456787654321;
    
    // New output (with --minify)
    x=0x704885f926b1;

    This works because a hexadecimal representation can be shorter than a decimal representation starting at around 1012 and above.

    This optimization made me realize that there's probably an opportunity to optimize printed numbers for smaller gzipped size instead of or in addition to just optimizing for minimal uncompressed byte count. The gzip algorithm does better with repetitive sequences, so for example 0xFFFFFFFF is probably a better representation than 4294967295 even though the byte counts are the same. As far as I know, no JavaScript minifier does this optimization yet. I don't know enough about how gzip works to know if this is a good idea or what the right metric for this might be.

  • Add Linux ARM64 support for Deno (#​2156)

    This release adds Linux ARM64 support to esbuild's Deno API implementation, which allows esbuild to be used with Deno on a Raspberry Pi.

v0.14.32

Compare Source

  • Fix super usage in lowered private methods (#​2039)

    Previously esbuild failed to transform super property accesses inside private methods in the case when private methods have to be lowered because the target environment doesn't support them. The generated code still contained the super keyword even though the method was moved outside of the class body, which is a syntax error in JavaScript. This release fixes this transformation issue and now produces valid code:

    // Original code
    class Derived extends Base {
      #foo() { super.foo() }
      bar() { this.#foo() }
    }
    
    // Old output (with --target=es6)
    var _foo, foo_fn;
    class Derived extends Base {
      constructor() {
        super(...arguments);
        __privateAdd(this, _foo);
      }
      bar() {
        __privateMethod(this, _foo, foo_fn).call(this);
      }
    }
    _foo = new WeakSet();
    foo_fn = function() {
      super.foo();
    };
    
    // New output (with --target=es6)
    var _foo, foo_fn;
    const _Derived = class extends Base {
      constructor() {
        super(...arguments);
        __privateAdd(this, _foo);
      }
      bar() {
        __privateMethod(this, _foo, foo_fn).call(this);
      }
    };
    let Derived = _Derived;
    _foo = new WeakSet();
    foo_fn = function() {
      __superGet(_Derived.prototype, this, "foo").call(this);
    };

    Because of this change, lowered super property accesses on instances were rewritten so that they can exist outside of the class body. This rewrite affects code generation for all super property accesses on instances including those inside lowered async functions. The new approach is different but should be equivalent to the old approach:

    // Original code
    class Foo {
      foo = async () => super.foo()
    }
    
    // Old output (with --target=es6)
    class Foo {
      constructor() {
        __publicField(this, "foo", () => {
          var __superGet = (key) => super[key];
          return __async(this, null, function* () {
            return __superGet("foo").call(this);
          });
        });
      }
    }
    
    // New output (with --target=es6)
    class Foo {
      constructor() {
        __publicField(this, "foo", () => __async(this, null, function* () {
          return __superGet(Foo.prototype, this, "foo").call(this);
        }));
      }
    }
  • Fix some tree-shaking bugs regarding property side effects

    This release fixes some cases where side effects in computed properties were not being handled correctly. Specifically primitives and private names as properties should not be considered to have side effects, and object literals as properties should be considered to have side effects:

    // Original code
    let shouldRemove = { [1]: 2 }
    let shouldRemove2 = class { #foo }
    let shouldKeep = class { [{ toString() { sideEffect() } }] }
    
    // Old output (with --tree-shaking=true)
    let shouldRemove = { [1]: 2 };
    let shouldRemove2 = class {
      #foo;
    };
    
    // New output (with --tree-shaking=true)
    let shouldKeep = class {
      [{ toString() {
        sideEffect();
      } }];
    };
  • Add the wasmModule option to the initialize JS API (#​1093)

    The initialize JS API must be called when using esbuild in the browser to provide the WebAssembly module for esbuild to use. Previously the only way to do that was using the wasmURL API option like this:

    await esbuild.initialize({
      wasmURL: '/node_modules/esbuild-wasm/esbuild.wasm',
    })
    console.log(await esbuild.transform('1+2'))

    With this release, you can now also initialize esbuild using a WebAssembly.Module instance using the wasmModule API option instead. The example above is equivalent to the following code:

    await esbuild.initialize({
      wasmModule: await WebAssembly.compileStreaming(fetch('/node_modules/esbuild-wasm/esbuild.wasm'))
    })
    console.log(await esbuild.transform('1+2'))

    This could be useful for environments where you want more control over how the WebAssembly download happens or where downloading the WebAssembly module is not possible.

v0.14.31

Compare Source

  • Add support for parsing "optional variance annotations" from TypeScript 4.7 (#​2102)

    The upcoming version of TypeScript now lets you specify in and/or out on certain type parameters (specifically only on a type alias, an interface declaration, or a class declaration). These modifiers control type paramemter covariance and contravariance:

    type Provider<out T> = () => T;
    type Consumer<in T> = (x: T) => void;
    type Mapper<in T, out U> = (x: T) => U;
    type Processor<in out T> = (x: T) => T;

    With this release, esbuild can now parse these new type parameter modifiers. This feature was contributed by @​magic-akari.

  • Improve support for super() constructor calls in nested locations (#​2134)

    In JavaScript, derived classes must call super() somewhere in the constructor method before being able to access this. Class public instance fields, class private instance fields, and TypeScript constructor parameter properties can all potentially cause code which uses this to be inserted into the constructor body, which must be inserted after the super() call. To make these insertions straightforward to implement, the TypeScript compiler doesn't allow calling super() somewhere other than in a root-level statement in the constructor body in these cases.

    Previously esbuild's class transformations only worked correctly when super() was called in a root-level statement in the constructor body, just like the TypeScript compiler. But with this release, esbuild should now generate correct code as long as the call to super() appears anywhere in the constructor body:

    // Original code
    class Foo extends Bar {
      constructor(public skip = false) {
        if (skip) {
          super(null)
          return
        }
        super({ keys: [] })
      }
    }
    
    // Old output (incorrect)
    class Foo extends Bar {
      constructor(skip = false) {
        if (skip) {
          super(null);
          return;
        }
        super({ keys: [] });
        this.skip = skip;
      }
    }
    
    // New output (correct)
    class Foo extends Bar {
      constructor(skip = false) {
        var __super = (...args) => {
          super(...args);
          this.skip = skip;
        };
        if (skip) {
          __super(null);
          return;
        }
        __super({ keys: [] });
      }
    }
  • Add support for the new @container CSS rule (#​2127)

    This release adds support for @container in CSS files. This means esbuild will now pretty-print and minify these rules better since it now better understands the internal structure of these rules:

    /* Original code */
    @&#8203;container (width <= 150px) {
      #inner {
        color: yellow;
      }
    }
    
    /* Old output (with --minify) */
    @&#8203;container (width <= 150px){#inner {color: yellow;}}
    
    /* New output (with --minify) */
    @&#8203;container (width <= 150px){#inner{color:#ff0}}

    This was contributed by @​yisibl.

  • Avoid CSS cascade-dependent keywords in the font-family property (#​2135)

    In CSS, initial, inherit, and unset are CSS-wide keywords which means they have special behavior when they are specified as a property value. For example, while font-family: 'Arial' (as a string) and font-family: Arial (as an identifier) are the same, font-family: 'inherit' (as a string) uses the font family named inherit but font-family: inherit (as an identifier) inherits the font family from the parent element. This means esbuild must not unquote these CSS-wide keywords (and default, which is also reserved) during minification to avoid changing the meaning of the minified CSS.

    The current draft of the new CSS Cascading and Inheritance Level 5 specification adds another concept called cascade-dependent keywords of which there are two: revert and revert-layer. This release of esbuild guards against unquoting these additional keywords as well to avoid accidentally breaking pages that use a font with the same name:

    /* Original code */
    a { font-family: 'revert'; }
    b { font-family: 'revert-layer', 'Segoe UI', serif; }
    
    /* Old output (with --minify) */
    a{font-family:revert}b{font-family:revert-layer,Segoe UI,serif}
    
    /* New output (with --minify) */
    a{font-family:"revert"}b{font-family:"revert-layer",Segoe UI,serif}

    This fix was contributed by @​yisibl.

v0.14.30

Compare Source

  • Change the context of TypeScript parameter decorators (#​2147)

    While TypeScript parameter decorators are expressions, they are not evaluated where they exist in the code. They are moved to after the class declaration and evaluated there instead. Specifically this TypeScript code:

    class Class {
      method(@&#8203;decorator() arg) {}
    }

    becomes this JavaScript code:

    class Class {
      method(arg) {}
    }
    __decorate([
      __param(0, decorator())
    ], Class.prototype, "method", null);

    This has several consequences:

    • Whether await is allowed inside a decorator expression or not depends on whether the class declaration itself is in an async context or not. With this release, you can now use await inside a decorator expression when the class declaration is either inside an async function or is at the top-level of an ES module and top-level await is supported. Note that the TypeScript compiler currently has a bug regarding this edge case: Parameter decorators use incorrect async/await context, generated code has syntax error microsoft/TypeScript#48509.

      // Using "await" inside a decorator expression is now allowed
      async function fn(foo: Promise<any>) {
        class Class {
          method(@&#8203;decorator(await foo) arg) {}
        }
        return Class
      }

      Also while TypeScript currently allows await to be used like this in async functions, it doesn't currently allow yield to be used like this in generator functions. It's not yet clear whether this behavior with yield is a bug or by design, so I haven't made any changes to esbuild's handling of yield inside decorator expressions in this release.

    • Since the scope of a decorator expression is the scope enclosing the class declaration, they cannot access private identifiers. Previously this was incorrectly allowed but with this release, esbuild no longer allows this. Note that the TypeScript compiler currently has a bug regarding this edge case: Decorators broken with private fields, generated code has syntax error microsoft/TypeScript#48515.

      // Using private names inside a decorator expression is no longer allowed
      class Class {
        static #priv = 123
        method(@&#8203;decorator(Class.#priv) arg) {}
      }
    • Since the scope of a decorator expression is the scope enclosing the class declaration, identifiers inside parameter decorator expressions should never be resolved to a parameter of the enclosing method. Previously this could happen, which was a bug with esbuild. This bug no longer happens in this release.

      // Name collisions now resolve to the outer name instead of the inner name
      let arg = 1
      class Class {
        method(@&#8203;decorator(arg) arg = 2) {}
      }

      Specifically previous versions of esbuild generated the following incorrect JavaScript (notice the use of arg2):

      let arg = 1;
      class Class {
        method(arg2 = 2) {
        }
      }
      __decorateClass([
        __decorateParam(0, decorator(arg2))
      ], Class.prototype, "method", 1);

      This release now generates the following correct JavaScript (notice the use of arg):

      let arg = 1;
      class Class {
        method(arg2 = 2) {
        }
      }
      __decorateClass([
        __decorateParam(0, decorator(arg))
      ], Class.prototype, "method", 1);
  • Fix some obscure edge cases with super property access

    This release fixes the following obscure problems with super when targeting an older JavaScript environment such as --target=es6:

    1. The compiler could previously crash when a lowered async arrow function contained a class with a field initializer that used a super property access:

      let foo = async () => class extends Object {
        bar = super.toString
      }
    2. The compiler could previously generate incorrect code when a lowered async method of a derived class contained a nested class with a computed class member involving a super property access on the derived class:

      class Base {
        foo() { return 'bar' }
      }
      class Derived extends Base {
        async foo() {
          return new class { [super.foo()] = 'success' }
        }
      }
      new Derived().foo().then(obj => console.log(obj.bar))
    3. The compiler could previously generate incorrect code when a default-exported class contained a super property access inside a lowered static private class field:

      class Foo {
        static foo = 123
      }
      export default class extends Foo {
        static #foo = super.foo
        static bar = this.#foo
      }

v0.14.29

Compare Source

  • Fix a minification bug with a double-nested if inside a label followed by else (#​2139)

    This fixes a minification bug that affects the edge case where if is followed by else and the if contains a label that contains a nested if. Normally esbuild's AST printer automatically wraps the body of a single-statement if in braces to avoid the "dangling else" if/else ambiguity common to C-like languages (where the else accidentally becomes associated with the inner if instead of the outer if). However, I was missing automatic wrapping of label statements, which did not have test coverage because they are a rarely-used feature. This release fixes the bug:

    // Original code
    if (a)
      b: {
        if (c) break b
      }
    else if (d)
      e()
    
    // Old output (with --minify)
    if(a)e:if(c)break e;else d&&e();
    
    // New output (with --minify)
    if(a){e:if(c)break e}else d&&e();
  • Fix edge case regarding baseUrl and paths in tsconfig.json (#​2119)

    In tsconfig.json, TypeScript forbids non-relative values inside paths if baseUrl is not present, and esbuild does too. However, TypeScript checked this after the entire tsconfig.json hierarchy was parsed while esbuild incorrectly checked this immediately when parsing the file containing the paths map. This caused incorrect warnings to be generated for tsconfig.json files that specify a baseUrl value and that inherit a paths value from an extends clause. Now esbuild will only check for non-relative paths values after the entire hierarchy has been parsed to avoid generating incorrect warnings.

  • Better handle errors where the esbuild binary executable is corrupted or missing (#​2129)

    If the esbuild binary executable is corrupted or missing, previously there was one situation where esbuild's JavaScript API could hang instead of generating an error. This release changes esbuild's library code to generate an error instead in this case.

v0.14.28

Compare Source

  • Add support for some new CSS rules (#​2115, #​2116, #​2117)

    This release adds support for @font-palette-values, @counter-style, and @font-feature-values. This means esbuild will now pretty-print and minify these rules better since it now better understands the internal structure of these rules:

    /* Original code */
    @&#8203;font-palette-values --Foo { base-palette: 1; }
    @&#8203;counter-style bar { symbols: b a r; }
    @&#8203;font-feature-values Bop { @&#8203;styleset { test: 1; } }
    
    /* Old output (with --minify) */
    @&#8203;font-palette-values --Foo{base-palette: 1;}@&#8203;counter-style bar{symbols: b a r;}@&#8203;font-feature-values Bop{@&#8203;styleset {test: 1;}}
    
    /* New output (with --minify) */
    @&#8203;font-palette-values --Foo{base-palette:1}@&#8203;counter-style bar{symbols:b a r}@&#8203;font-feature-values Bop{@&#8203;styleset{test:1}}
  • Upgrade to Go 1.18.0 (#​2105)

    Binary executables for this version are now published with Go version 1.18.0. The Go release notes say that the linker generates smaller binaries and that on 64-bit ARM chips, compiled binaries run around 10% faster. On an M1 MacBook Pro, esbuild's benchmark runs approximately 8% faster than before and the binary executable is approximately 4% smaller than before.

    This also fixes a regression from version 0.14.26 of esbuild where the browser builds of the esbuild-wasm package could fail to be bundled due to the use of built-in node libraries. The primary WebAssembly shim for Go 1.18.0 no longer uses built-in node libraries.

v0.14.27

Compare Source

  • Avoid generating an enumerable default import for CommonJS files in Babel mode (#​2097)

    Importing a CommonJS module into an ES module can be done in two different ways. In node mode the default import is always set to module.exports, while in Babel mode the default import passes through to module.exports.default instead. Node mode is triggered when the i


Configuration

📅 Schedule: "before 3am on the first day of the month" (UTC).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


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

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/dev-dependencies branch from 261ff9c to aec112d Compare May 1, 2022 14:19
@codecov
Copy link

codecov bot commented May 1, 2022

Codecov Report

Merging #67 (aec112d) into master (4f8d874) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master       #67   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines         1437      1437           
  Branches        80        85    +5     
=========================================
  Hits          1437      1437           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f8d874...aec112d. Read the comment docs.

@adamburgess adamburgess merged commit 39685e6 into master May 1, 2022
@renovate renovate bot deleted the renovate/dev-dependencies branch May 1, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants