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

Upgrade the expected runtime environment to es2022 #19

Merged
merged 14 commits into from
Mar 29, 2022

Conversation

jstasiak
Copy link
Collaborator

I want to have this in place to implement [1] which satisfies a need we
ourselves have[2]. This is needed because the cause property is only
availble in the es2022 TS profile[3].

[1] vultix#34
[2] vultix#48
[3] microsoft/TypeScript#47020

We need TypeScript 4.6+ to be able to construct Error objects with the
cause property[1]. The property is useful to chain errors and, on the
catching side, to see what error caused the error we just caught.

I want to have this in place to implement [3] which satisfies a need we
ourselves have[4].

tslib upgraded in lockstep because otherwise we get

    FAIL  test/result.test.ts
      ● Test suite failed to run

        test/result.test.ts:121:29 - error TS2807: This syntax requires an imported helper named '__spreadArray' with 3 parameters, which is not compatible with the one in 'tslib'. Consider upgrading your version of 'tslib'.

        121     const all4 = Result.all(...([] as Result<string, number>[]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error
[2] microsoft/TypeScript#45167
[3] vultix#34
[4] vultix#48
Running npm install using NPM 8.5.5 with unchanged package.json
generates a different package-lock.json, let's commit this to avoid
spurious changes/conflicts in the future.
I want to have this in place to implement [1] which satisfies a need we
ourselves have[2]. This is needed because the cause property is only
availble in the es2022 TS profile[3].

[1] vultix#34
[2] vultix#48
[3] microsoft/TypeScript#47020
@jstasiak jstasiak requested review from a team, rbruggem, raguiar9080 and festinaj and removed request for a team March 29, 2022 12:15
@jstasiak jstasiak changed the base branch from master to upgrade-ts March 29, 2022 12:21
Copy link

@raguiar9080 raguiar9080 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Base automatically changed from upgrade-ts to master March 29, 2022 13:55
@jstasiak jstasiak merged commit 3f43893 into master Mar 29, 2022
@jstasiak jstasiak deleted the upgrade-expected-runtime-environment branch March 29, 2022 13:56
jstasiak added a commit that referenced this pull request Mar 29, 2022
This is useful to get access to the "underlying" error in global
exception-handling code for example.

Feature requested in [1] and I had a question about something similar as
well[2].

[1] vultix#34
[2] vultix#48

This change depends on #17 and #19 to be merged first (then the branch will be updated to contain these changes and the build will succeed).
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.

2 participants