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

chore(deps): update dependency esbuild to v0.14.31 #1363

Merged
merged 1 commit into from Apr 4, 2022

Conversation

sbb-angular-renovate[bot]
Copy link
Contributor

@sbb-angular-renovate sbb-angular-renovate bot commented Apr 2, 2022

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.14.29 -> 0.14.31

Release Notes

evanw/esbuild

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
      }

Configuration

📅 Schedule: "after 10pm every weekday,before 5am every weekday,every weekend" (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.

🔕 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.

@sbb-angular-renovate sbb-angular-renovate bot changed the title chore(deps): update dependency esbuild to v0.14.30 chore(deps): update dependency esbuild to v0.14.31 Apr 4, 2022
@jeripeierSBB jeripeierSBB merged commit 111c5ac into master Apr 4, 2022
@jeripeierSBB jeripeierSBB deleted the renovate/esbuild-0.x branch April 4, 2022 05:06
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

1 participant