Update dependency esbuild to v0.12.17 #623

Merged
konrad merged 1 commits from renovate/esbuild-0.x into main 2021-07-29 17:13:57 +00:00
Member

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.12.16 -> 0.12.17

Release Notes

evanw/esbuild

v0.12.17

Compare Source

  • Fix a bug with private fields and logical assignment operators (#​1418)

    This release fixes a bug where code using private fields in combination with logical assignment operators was transformed incorrectly if the target environment supported logical assignment operators but not private fields. Since logical assignment operators are assignment operators, the entire operator must be transformed even if the operator is supported. This should now work correctly:

    // Original code
    class Foo {
      #x
      foo() {
        this.#x &&= 2
        this.#x ||= 2
        this.#x ??= 2
      }
    }
    
    // Old output
    var _x;
    class Foo {
      constructor() {
        __privateAdd(this, _x, void 0);
      }
      foo() {
        this._x &&= 2;
        this._x ||= 2;
        this._x ??= 2;
      }
    }
    _x = new WeakMap();
    
    // New output
    var _x, _a;
    class Foo {
      constructor() {
        __privateAdd(this, _x, void 0);
      }
      foo() {
        __privateGet(this, _x) && __privateSet(this, _x, 2);
        __privateGet(this, _x) || __privateSet(this, _x, 2);
        __privateGet(this, _x) ?? __privateSet(this, _x, 2);
      }
    }
    _x = new WeakMap();
    
  • Fix a hoisting bug in the bundler (#​1455)

    This release fixes a bug where variables declared using var inside of top-level for loop initializers were not hoisted inside lazily-initialized ES modules (such as those that are generated when bundling code that loads an ES module using require). This meant that hoisted function declarations incorrectly didn't have access to these loop variables:

    // entry.js
    console.log(require('./esm-file').test())
    
    // esm-file.js
    for (var i = 0; i < 10; i++) ;
    export function test() { return i }
    

    Old output (incorrect):

    // esm-file.js
    var esm_file_exports = {};
    __export(esm_file_exports, {
      test: () => test
    });
    function test() {
      return i;
    }
    var init_esm_file = __esm({
      "esm-file.js"() {
        for (var i = 0; i < 10; i++)
          ;
      }
    });
    
    // entry.js
    console.log((init_esm_file(), esm_file_exports).test());
    

    New output (correct):

    // esm-file.js
    var esm_file_exports = {};
    __export(esm_file_exports, {
      test: () => test
    });
    function test() {
      return i;
    }
    var i;
    var init_esm_file = __esm({
      "esm-file.js"() {
        for (i = 0; i < 10; i++)
          ;
      }
    });
    
    // entry.js
    console.log((init_esm_file(), esm_file_exports).test());
    
  • Fix a code generation bug for private methods (#​1424)

    This release fixes a bug where when private methods are transformed and the target environment is one that supports private methods (such as esnext), the member function name was uninitialized and took on the zero value by default. This resulted in the member function name becoming __create instead of the correct name since that's the name of the symbol at index 0. Now esbuild always generates a private method symbol even when private methods are supported, so this is no longer an issue:

    // Original code
    class Foo {
      #a() { return 'a' }
      #b() { return 'b' }
      static c
    }
    
    // Old output
    var _a, __create, _b, __create;
    var Foo = class {
      constructor() {
        __privateAdd(this, _a);
        __privateAdd(this, _b);
      }
    };
    _a = new WeakSet();
    __create = function() {
      return "a";
    };
    _b = new WeakSet();
    __create = function() {
      return "b";
    };
    __publicField(Foo, "c");
    
    // New output
    var _a, a_fn, _b, b_fn;
    var Foo = class {
      constructor() {
        __privateAdd(this, _a);
        __privateAdd(this, _b);
      }
    };
    _a = new WeakSet();
    a_fn = function() {
      return "a";
    };
    _b = new WeakSet();
    b_fn = function() {
      return "b";
    };
    __publicField(Foo, "c");
    
  • The CLI now stops watch and serve mode when stdin is closed (#​1449)

    To facilitate esbuild being called from the Erlang VM, esbuild's command-line interface will now exit when in --watch or --serve mode if stdin is closed. This change is necessary because the Erlang VM doesn't have an API for terminating a child process, so it instead closes stdin to indicate that the process is no longer needed.

    Note that this only happens when stdin is not a TTY (i.e. only when the CLI is being used non-interactively) to avoid disrupting the use case of manually moving esbuild to a background job using a Unix terminal.

    This change was contributed by @​josevalim.


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, check this box.

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.12.16` -> `0.12.17`](https://renovatebot.com/diffs/npm/esbuild/0.12.16/0.12.17) | --- ### Release Notes <details> <summary>evanw/esbuild</summary> ### [`v0.12.17`](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#&#8203;01217) [Compare Source](https://github.com/evanw/esbuild/compare/v0.12.16...v0.12.17) - Fix a bug with private fields and logical assignment operators ([#&#8203;1418](https://github.com/evanw/esbuild/issues/1418)) This release fixes a bug where code using private fields in combination with [logical assignment operators](https://github.com/tc39/proposal-logical-assignment) was transformed incorrectly if the target environment supported logical assignment operators but not private fields. Since logical assignment operators are assignment operators, the entire operator must be transformed even if the operator is supported. This should now work correctly: ```js // Original code class Foo { #x foo() { this.#x &&= 2 this.#x ||= 2 this.#x ??= 2 } } // Old output var _x; class Foo { constructor() { __privateAdd(this, _x, void 0); } foo() { this._x &&= 2; this._x ||= 2; this._x ??= 2; } } _x = new WeakMap(); // New output var _x, _a; class Foo { constructor() { __privateAdd(this, _x, void 0); } foo() { __privateGet(this, _x) && __privateSet(this, _x, 2); __privateGet(this, _x) || __privateSet(this, _x, 2); __privateGet(this, _x) ?? __privateSet(this, _x, 2); } } _x = new WeakMap(); ``` - Fix a hoisting bug in the bundler ([#&#8203;1455](https://github.com/evanw/esbuild/issues/1455)) This release fixes a bug where variables declared using `var` inside of top-level `for` loop initializers were not hoisted inside lazily-initialized ES modules (such as those that are generated when bundling code that loads an ES module using `require`). This meant that hoisted function declarations incorrectly didn't have access to these loop variables: ```js // entry.js console.log(require('./esm-file').test()) // esm-file.js for (var i = 0; i < 10; i++) ; export function test() { return i } ``` Old output (incorrect): ```js // esm-file.js var esm_file_exports = {}; __export(esm_file_exports, { test: () => test }); function test() { return i; } var init_esm_file = __esm({ "esm-file.js"() { for (var i = 0; i < 10; i++) ; } }); // entry.js console.log((init_esm_file(), esm_file_exports).test()); ``` New output (correct): ```js // esm-file.js var esm_file_exports = {}; __export(esm_file_exports, { test: () => test }); function test() { return i; } var i; var init_esm_file = __esm({ "esm-file.js"() { for (i = 0; i < 10; i++) ; } }); // entry.js console.log((init_esm_file(), esm_file_exports).test()); ``` - Fix a code generation bug for private methods ([#&#8203;1424](https://github.com/evanw/esbuild/issues/1424)) This release fixes a bug where when private methods are transformed and the target environment is one that supports private methods (such as `esnext`), the member function name was uninitialized and took on the zero value by default. This resulted in the member function name becoming `__create` instead of the correct name since that's the name of the symbol at index 0. Now esbuild always generates a private method symbol even when private methods are supported, so this is no longer an issue: ```js // Original code class Foo { #a() { return 'a' } #b() { return 'b' } static c } // Old output var _a, __create, _b, __create; var Foo = class { constructor() { __privateAdd(this, _a); __privateAdd(this, _b); } }; _a = new WeakSet(); __create = function() { return "a"; }; _b = new WeakSet(); __create = function() { return "b"; }; __publicField(Foo, "c"); // New output var _a, a_fn, _b, b_fn; var Foo = class { constructor() { __privateAdd(this, _a); __privateAdd(this, _b); } }; _a = new WeakSet(); a_fn = function() { return "a"; }; _b = new WeakSet(); b_fn = function() { return "b"; }; __publicField(Foo, "c"); ``` - The CLI now stops watch and serve mode when stdin is closed ([#&#8203;1449](https://github.com/evanw/esbuild/pull/1449)) To facilitate esbuild being called from the Erlang VM, esbuild's command-line interface will now exit when in `--watch` or `--serve` mode if stdin is closed. This change is necessary because the Erlang VM doesn't have an API for terminating a child process, so it instead closes stdin to indicate that the process is no longer needed. Note that this only happens when stdin is not a TTY (i.e. only when the CLI is being used non-interactively) to avoid disrupting the use case of manually moving esbuild to a background job using a Unix terminal. This change was contributed by [@&#8203;josevalim](https://github.com/josevalim). </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, check this box. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
renovate added the
dependencies
label 2021-07-29 17:01:54 +00:00
renovate added 1 commit 2021-07-29 17:01:55 +00:00
continuous-integration/drone/pr Build is passing Details
b63c2a4605
Update dependency esbuild to v0.12.17
konrad merged commit 81ab488eaa into main 2021-07-29 17:13:57 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.