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

Update dependency esbuild to v0.18.7 #1356

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 27, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
esbuild 0.18.6 -> 0.18.7 age adoption passing confidence

Release Notes

evanw/esbuild (esbuild)

v0.18.7

Compare Source

  • 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):

    // 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):

    // 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).


Configuration

📅 Schedule: Branch creation - "every weekday" (UTC), Automerge - 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 Mend Renovate. View repository job log here.

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (0e97fbd) 62.62% compared to head (5dba21d) 62.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #1356   +/-   ##
=======================================
  Coverage   62.62%   62.62%           
=======================================
  Files           5        5           
  Lines        2130     2130           
  Branches       44       44           
=======================================
  Hits         1334     1334           
  Misses        796      796           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@monk-topmonks monk-topmonks merged commit 71be470 into trunk Jun 27, 2023
5 checks passed
@monk-topmonks monk-topmonks deleted the renovate/esbuild-0.x branch June 27, 2023 04: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