chore(deps): update dependency esbuild to v0.14.44 #2055

Merged
konrad merged 1 commits from renovate/esbuild-0.x into main 2022-06-16 08:39:32 +00:00
Member

This PR contains the following updates:

Package Type Update Change
esbuild devDependencies patch 0.14.43 -> 0.14.44

Release Notes

evanw/esbuild

v0.14.44

Compare Source

  • Add a copy loader (#​2255)

    You can configure the "loader" for a specific file extension in esbuild, which is a way of telling esbuild how it should treat that file. For example, the text loader means the file is imported as a string while the binary loader means the file is imported as a Uint8Array. If you want the imported file to stay a separate file, the only option was previously the file loader (which is intended to be similar to Webpack's file-loader package). This loader copies the file to the output directory and imports the path to that output file as a string. This is useful for a web application because you can refer to resources such as .png images by importing them for their URL. However, it's not helpful if you need the imported file to stay a separate file but to still behave the way it normally would when the code is run without bundling.

    With this release, there is now a new loader called copy that copies the loaded file to the output directory and then rewrites the path of the import statement or require() call to point to the copied file instead of the original file. This will automatically add a content hash to the output name by default (which can be configured with the --asset-names= setting). You can use this by specifying copy for a specific file extension, such as with --loader:.png=copy.

  • Fix a regression in arrow function lowering (#​2302)

    This release fixes a regression with lowering arrow functions to function expressions in ES5. This feature was introduced in version 0.7.2 and regressed in version 0.14.30.

    In JavaScript, regular function expressions treat this as an implicit argument that is determined by how the function is called, but arrow functions treat this as a variable that is captured in the closure from the surrounding lexical scope. This is emulated in esbuild by storing the value of this in a variable before changing the arrow function into a function expression.

    However, the code that did this didn't treat this expressions as a usage of that generated variable. Version 0.14.30 began omitting unused generated variables, which caused the transformation of this to break. This regression happened due to missing test coverage. With this release, the problem has been fixed:

    // Original code
    function foo() {
      return () => this
    }
    
    // Old output (with --target=es5)
    function foo() {
      return function() {
        return _this;
      };
    }
    
    // New output (with --target=es5)
    function foo() {
      var _this = this;
      return function() {
        return _this;
      };
    }
    

    This fix was contributed by @​nkeynes.

  • Allow entity names as define values (#​2292)

    The "define" feature allows you to replace certain expressions with certain other expressions at compile time. For example, you might want to replace the global identifier IS_PRODUCTION with the boolean value true when building for production. Previously the only expressions you could substitute in were either identifier expressions or anything that is valid JSON syntax. This limitation exists because supporting more complex expressions is more complex (for example, substituting in a require() call could potentially pull in additional files, which would need to be handled). With this release, you can now also now define something as a member expression chain of the form foo.abc.xyz.

  • Implement package self-references (#​2312)

    This release implements a rarely-used feature in node where a package can import itself by name instead of using relative imports. You can read more about this feature here: https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name. For example, assuming the package.json in a given package looks like this:

    // package.json
    {
      "name": "a-package",
      "exports": {
        ".": "./main.mjs",
        "./foo": "./foo.js"
      }
    }
    

    Then any module in that package can reference an export in the package itself:

    // ./a-module.mjs
    import { something } from 'a-package'; // Imports "something" from ./main.mjs.
    

    Self-referencing is also available when using require, both in an ES module, and in a CommonJS one. For example, this code will also work:

    // ./a-module.js
    const { something } = require('a-package/foo'); // Loads from ./foo.js.
    
  • Add a warning for assigning to an import (#​2319)

    Import bindings are immutable in JavaScript, and assigning to them will throw an error. So instead of doing this:

    import { foo } from 'foo'
    foo++
    

    You need to do something like this instead:

    import { foo, setFoo } from 'foo'
    setFoo(foo + 1)
    

    This is already an error if you try to bundle this code with esbuild. However, this was previously allowed silently when bundling is disabled, which can lead to confusion for people who don't know about this aspect of how JavaScript works. So with this release, there is now a warning when you do this:

    ▲ [WARNING] This assignment will throw because "foo" is an import [assign-to-import]
    
        example.js:2:0:
          2 │ foo++
            ╵ ~~~
    
      Imports are immutable in JavaScript. To modify the value of this import, you must export a setter
      function in the imported file (e.g. "setFoo") and then import and call that function here instead.
    

    This new warning can be turned off with --log-override:assign-to-import=silent if you don't want to see it.

  • Implement alwaysStrict in tsconfig.json (#​2264)

    This release adds alwaysStrict to the set of TypeScript tsconfig.json configuration values that esbuild supports. When this is enabled, esbuild will forbid syntax that isn't allowed in strict mode and will automatically insert "use strict"; at the top of generated output files. This matches the behavior of the TypeScript compiler: https://www.typescriptlang.org/tsconfig#alwaysStrict.


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.43` -> `0.14.44`](https://renovatebot.com/diffs/npm/esbuild/0.14.43/0.14.44) | --- ### Release Notes <details> <summary>evanw/esbuild</summary> ### [`v0.14.44`](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#&#8203;01444) [Compare Source](https://github.com/evanw/esbuild/compare/v0.14.43...v0.14.44) - Add a `copy` loader ([#&#8203;2255](https://github.com/evanw/esbuild/issues/2255)) You can configure the "loader" for a specific file extension in esbuild, which is a way of telling esbuild how it should treat that file. For example, the `text` loader means the file is imported as a string while the `binary` loader means the file is imported as a `Uint8Array`. If you want the imported file to stay a separate file, the only option was previously the `file` loader (which is intended to be similar to Webpack's [`file-loader`](https://v4.webpack.js.org/loaders/file-loader/) package). This loader copies the file to the output directory and imports the path to that output file as a string. This is useful for a web application because you can refer to resources such as `.png` images by importing them for their URL. However, it's not helpful if you need the imported file to stay a separate file but to still behave the way it normally would when the code is run without bundling. With this release, there is now a new loader called `copy` that copies the loaded file to the output directory and then rewrites the path of the import statement or `require()` call to point to the copied file instead of the original file. This will automatically add a content hash to the output name by default (which can be configured with the `--asset-names=` setting). You can use this by specifying `copy` for a specific file extension, such as with `--loader:.png=copy`. - Fix a regression in arrow function lowering ([#&#8203;2302](https://github.com/evanw/esbuild/pull/2302)) This release fixes a regression with lowering arrow functions to function expressions in ES5. This feature was introduced in version 0.7.2 and regressed in version 0.14.30. In JavaScript, regular `function` expressions treat `this` as an implicit argument that is determined by how the function is called, but arrow functions treat `this` as a variable that is captured in the closure from the surrounding lexical scope. This is emulated in esbuild by storing the value of `this` in a variable before changing the arrow function into a function expression. However, the code that did this didn't treat `this` expressions as a usage of that generated variable. Version 0.14.30 began omitting unused generated variables, which caused the transformation of `this` to break. This regression happened due to missing test coverage. With this release, the problem has been fixed: ```js // Original code function foo() { return () => this } // Old output (with --target=es5) function foo() { return function() { return _this; }; } // New output (with --target=es5) function foo() { var _this = this; return function() { return _this; }; } ``` This fix was contributed by [@&#8203;nkeynes](https://github.com/nkeynes). - Allow entity names as define values ([#&#8203;2292](https://github.com/evanw/esbuild/issues/2292)) The "define" feature allows you to replace certain expressions with certain other expressions at compile time. For example, you might want to replace the global identifier `IS_PRODUCTION` with the boolean value `true` when building for production. Previously the only expressions you could substitute in were either identifier expressions or anything that is valid JSON syntax. This limitation exists because supporting more complex expressions is more complex (for example, substituting in a `require()` call could potentially pull in additional files, which would need to be handled). With this release, you can now also now define something as a member expression chain of the form `foo.abc.xyz`. - Implement package self-references ([#&#8203;2312](https://github.com/evanw/esbuild/issues/2312)) This release implements a rarely-used feature in node where a package can import itself by name instead of using relative imports. You can read more about this feature here: https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name. For example, assuming the `package.json` in a given package looks like this: ```json // package.json { "name": "a-package", "exports": { ".": "./main.mjs", "./foo": "./foo.js" } } ``` Then any module in that package can reference an export in the package itself: ```js // ./a-module.mjs import { something } from 'a-package'; // Imports "something" from ./main.mjs. ``` Self-referencing is also available when using `require`, both in an ES module, and in a CommonJS one. For example, this code will also work: ```js // ./a-module.js const { something } = require('a-package/foo'); // Loads from ./foo.js. ``` - Add a warning for assigning to an import ([#&#8203;2319](https://github.com/evanw/esbuild/issues/2319)) Import bindings are immutable in JavaScript, and assigning to them will throw an error. So instead of doing this: ```js import { foo } from 'foo' foo++ ``` You need to do something like this instead: ```js import { foo, setFoo } from 'foo' setFoo(foo + 1) ``` This is already an error if you try to bundle this code with esbuild. However, this was previously allowed silently when bundling is disabled, which can lead to confusion for people who don't know about this aspect of how JavaScript works. So with this release, there is now a warning when you do this: ▲ [WARNING] This assignment will throw because "foo" is an import [assign-to-import] example.js:2:0: 2 │ foo++ ╵ ~~~ Imports are immutable in JavaScript. To modify the value of this import, you must export a setter function in the imported file (e.g. "setFoo") and then import and call that function here instead. This new warning can be turned off with `--log-override:assign-to-import=silent` if you don't want to see it. - Implement `alwaysStrict` in `tsconfig.json` ([#&#8203;2264](https://github.com/evanw/esbuild/issues/2264)) This release adds `alwaysStrict` to the set of TypeScript `tsconfig.json` configuration values that esbuild supports. When this is enabled, esbuild will forbid syntax that isn't allowed in strict mode and will automatically insert `"use strict";` at the top of generated output files. This matches the behavior of the TypeScript compiler: https://www.typescriptlang.org/tsconfig#alwaysStrict. </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-06-16 00:03:17 +00:00
renovate added 1 commit 2022-06-16 00:03:18 +00:00
continuous-integration/drone/pr Build is passing Details
158d7119d6
chore(deps): update dependency esbuild to v0.14.44
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://2055-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://2055-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 1ebd21ccb0 into main 2022-06-16 08:39:32 +00:00
konrad deleted branch renovate/esbuild-0.x 2022-06-16 08:39:32 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.