chore(deps): update dependency esbuild to v0.14.30 #1758

Merged
konrad merged 1 commits from renovate/esbuild-0.x into main 2022-04-02 07:02:22 +00:00
Member

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.14.29 -> 0.14.30

Release Notes

evanw/esbuild

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(@​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: https://github.com/microsoft/TypeScript/issues/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: https://github.com/microsoft/TypeScript/issues/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: 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, click this checkbox.

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.14.29` -> `0.14.30`](https://renovatebot.com/diffs/npm/esbuild/0.14.29/0.14.30) | --- ### Release Notes <details> <summary>evanw/esbuild</summary> ### [`v0.14.30`](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#&#8203;01430) [Compare Source](https://github.com/evanw/esbuild/compare/v0.14.29...v0.14.30) - Change the context of TypeScript parameter decorators ([#&#8203;2147](https://github.com/evanw/esbuild/issues/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: ```ts class Class { method(@&#8203;decorator() arg) {} } ``` becomes this JavaScript code: ```js 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: https://github.com/microsoft/TypeScript/issues/48509. ```ts // 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: https://github.com/microsoft/TypeScript/issues/48515. ```ts // 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. ```ts // 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`): ```js 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`): ```js 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: ```js 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: ```js 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: ```js class Foo { static foo = 123 } export default class extends Foo { static #foo = super.foo static bar = this.#foo } ``` </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, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
renovate added the
dependencies
label 2022-04-02 06:07:07 +00:00
renovate added 1 commit 2022-04-02 06:07:08 +00:00
continuous-integration/drone/pr Build is passing Details
6b98a68328
chore(deps): update dependency esbuild to v0.14.30
Member

Hi renovate!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://1758-renovate-esbuild-0-x--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi renovate! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://1758-renovate-esbuild-0-x--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
konrad merged commit 5dbdfd3cd5 into main 2022-04-02 07:02:22 +00:00
konrad deleted branch renovate/esbuild-0.x 2022-04-02 07:02:22 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.