Skip to content

Update JS SDK target to es2017 - #708

Merged
jakubno merged 2 commits into
mainfrom
update-tsup-target-to-es2017
Apr 29, 2025
Merged

Update JS SDK target to es2017#708
jakubno merged 2 commits into
mainfrom
update-tsup-target-to-es2017

Conversation

@dobrac

@dobrac dobrac commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

Updates the JS SDK target to es2017 (from es2015). This change improves error logs that include user code. This is happening because before es2017 (e.g. es2015) tsup adds polyfill for async (which we use in the API) obfuscating the code execution path.

(The previously generated code)

var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
var __await = function(promise, isYieldStar) {
  this[0] = promise;
  this[1] = isYieldStar;
};

@dobrac dobrac added Improvement Improvement for current functionality javascript Pull requests that update Javascript code labels Apr 29, 2025
@dobrac dobrac self-assigned this Apr 29, 2025
@changeset-bot

changeset-bot Bot commented Apr 29, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: acdbe72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
e2b Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jakubno
jakubno merged commit e302175 into main Apr 29, 2025
@jakubno
jakubno deleted the update-tsup-target-to-es2017 branch April 29, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Improvement for current functionality javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants