Skip to content

Conversation

Miivaan
Copy link
Owner

@Miivaan Miivaan commented Jul 16, 2023

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade esbuild from 0.17.19 to 0.18.8.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 9 versions ahead of your current version.
  • The recommended version was released 22 days ago, on 2023-06-25.
Release notes
Package name: esbuild
  • 0.18.8 - 2023-06-25
    • Implement transforming async generator functions (#2780)

      With this release, esbuild will now transform async generator functions into normal generator functions when the configured target environment doesn't support them. These functions behave similar to normal generator functions except that they use the Symbol.asyncIterator interface instead of the Symbol.iterator interface and the iteration methods return promises. Here's an example (helper functions are omitted):

      // Original code
      async function foo() {
      yield Promise.resolve(1)
      await new Promise(r => setTimeout(r, 100))
      yield
      [Promise.resolve(2)]
      }
      async function bar() {
      for await (const x of foo()) {
      console.log(x)
      }
      }
      bar()

      // New output (with --target=es6)
      function foo() {
      return __asyncGenerator(this, null, function () {
      yield Promise.resolve(1);
      yield new __await(new Promise((r) => setTimeout(r, 100)));
      yield
      __yieldStar([Promise.resolve(2)]);
      });
      }
      function bar() {
      return __async(this, null, function* () {
      try {
      for (var iter = __forAwait(foo()), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
      const x = temp.value;
      console.log(x);
      }
      } catch (temp) {
      error = [temp];
      } finally {
      try {
      more && (temp = iter.return) && (yield temp.call(iter));
      } finally {
      if (error)
      throw error[0];
      }
      }
      });
      }
      bar();

      This is an older feature that was added to JavaScript in ES2018 but I didn't implement the transformation then because it's a rarely-used feature. Note that esbuild already added support for transforming for await loops (the other part of the asynchronous iteration proposal) a year ago, so support for asynchronous iteration should now be complete.

      I have never used this feature myself and code that uses this feature is hard to come by, so this transformation has not yet been tested on real-world code. If you do write code that uses this feature, please let me know if esbuild's async generator transformation doesn't work with your code.

  • 0.18.7 - 2023-06-24
    • Add support for using declarations in TypeScript 5.2+ (#3191)

      TypeScript 5.2 (due to be released in August of 2023) will introduce using declarations, which will allow you to automatically dispose of the declared resources when leaving the current scope. You can read the TypeScript PR for this feature for more information. This release of esbuild adds support for transforming this syntax to target environments without support for using declarations (which is currently all targets other than esnext). Here's an example (helper functions are omitted):

      Symbol.dispose {
      console.log("cleanup");
      }
      };
      var foo = __using(stack, new Foo());
      foo.bar();
      } catch (
      ) {
      var _error = _, _hasError = true;
      } finally {
      __callDispose(_stack, _error, _hasError);
      }">
      // Original code
      class Foo {
      [Symbol.dispose]() {
      console.log('cleanup')
      }
      }
      using foo = new Foo;
      foo.bar();

      // New output (with --target=es6)
      var _stack = [];
      try {
      var Foo = class {
      [Symbol.dispose]() {
      console.log("cleanup");
      }
      };
      var foo = __using(stack, new Foo());
      foo.bar();
      } catch (
      ) {
      var error = , _hasError = true;
      } finally {
      __callDispose(_stack, _error, _hasError);
      }

      The injected helper functions ensure that the method named Symbol.dispose is called on new Foo when control exits the scope. Note that as with all new JavaScript APIs, you'll need to polyfill Symbol.dispose if it's not present before you use it. This is not something that esbuild does for you because esbuild only handles syntax, not APIs. Polyfilling it can be done with something like this:

      Symbol.dispose ||= Symbol('Symbol.dispose')

      This feature also introduces await using declarations which are like using declarations but they call await on the disposal method (not on the initializer). Here's an example (helper functions are omitted):

      Symbol.asyncDispose {
      await new Promise((done) => {
      setTimeout(done, 1e3);
      });
      console.log("cleanup");
      }
      };
      var foo = __using(stack, new Foo(), true);
      foo.bar();
      } catch (
      ) {
      var _error = _, _hasError = true;
      } finally {
      var _promise = __callDispose(_stack, _error, _hasError);
      _promise && await _promise;
      }">
      // Original code
      class Foo {
      async [Symbol.asyncDispose]() {
      await new Promise(done => {
      setTimeout(done, 1000)
      })
      console.log('cleanup')
      }
      }
      await using foo = new Foo;
      foo.bar();

      // New output (with --target=es2022)
      var _stack = [];
      try {
      var Foo = class {
      async [Symbol.asyncDispose]() {
      await new Promise((done) => {
      setTimeout(done, 1e3);
      });
      console.log("cleanup");
      }
      };
      var foo = __using(stack, new Foo(), true);
      foo.bar();
      } catch (
      ) {
      var error = , _hasError = true;
      } finally {
      var _promise = __callDispose(_stack, _error, _hasError);
      _promise && await _promise;
      }

      The injected helper functions ensure that the method named Symbol.asyncDispose is called on new Foo when control exits the scope, and that the returned promise is awaited. Similarly to Symbol.dispose, you'll also need to polyfill Symbol.asyncDispose before you use it.

    • Add a --line-limit= flag to limit line length (#3170)

      Long lines are common in minified code. However, many tools and text editors can't handle long lines. This release introduces the --line-limit= flag to tell esbuild to wrap lines longer than the provided number of bytes. For example, --line-limit=80 tells esbuild to insert a newline soon after a given line reaches 80 bytes in length. This setting applies to both JavaScript and CSS, and works even when minification is disabled. Note that turning this setting on will make your files bigger, as the extra newlines take up additional space in the file (even after gzip compression).

  • 0.18.6 - 2023-06-20
    Read more
  • 0.18.5 - 2023-06-20
    Read more
  • 0.18.4 - 2023-06-16
    Read more
  • 0.18.3 - 2023-06-15
    • Fix a panic due to empty static class blocks (#3161)

      This release fixes a bug where an internal invariant that was introduced in the previous release was sometimes violated, which then caused a panic. It happened when bundling code containing an empty static class block with both minification and bundling enabled.

  • 0.18.2 - 2023-06-13
    Read more
  • 0.18.1 - 2023-06-12
    Read more
  • 0.18.0 - 2023-06-09
    Read more
  • 0.17.19 - 2023-05-13
    Read more
from esbuild GitHub release notes
Commit messages
Package name: esbuild

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

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.

.ts 文件里 import .vue 文件,会无法定位 Cannot import slick-theme from the slick-carousel package
2 participants