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

TypeScript 5.0 support #783

Closed
alangpierce opened this issue Mar 19, 2023 · 0 comments · Fixed by #786
Closed

TypeScript 5.0 support #783

alangpierce opened this issue Mar 19, 2023 · 0 comments · Fixed by #786

Comments

@alangpierce
Copy link
Owner

TypeScript 5.0 was recently released: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/ and this issue tracks support for new syntax.

Changes relevant to Sucrase:

  • const type parameters: This will hopefully be straightforward to implement. My plan is to pull this in as part of catching up on babel-parser changes.
  • export type *: This also will hopefully be straightforward and picked up as part of babel porting.
  • Decorators: Unfortunately, I think a decorators transform would be very difficult to implement in Sucrase, and I have a strong preference for keeping Sucrase scoped to non-standard language features (moving forward) rather than downleveling ES features. That means that Sucrase's job is to correctly preserve decorators (and any bug reports in that behavior are valid!), and anyone wanting decorators will need to wait for engine support. This issue tracks implementation for various engines: Implementation Status tc39/proposal-decorators#476 , and particularly see the V8 issue at https://bugs.chromium.org/p/v8/issues/detail?id=12763&q=decorators&can=2 . I could be convinced to take on a new transform or accept a PR, especially if there's a way that avoids too much complexity, but I'm hoping that engines will add support soon enough.
  • --verbatimModuleSyntax: I'm hoping to implement an option like this soon, but I won't consider it necessary as part of this tracking issue. It's great to see this as a new option, and I'm hoping that the community moves to this as a default mode since the behavior is much more clear and it would make the Sucrase implementation much simpler and faster.
alangpierce added a commit that referenced this issue Mar 20, 2023
Instructions: https://github.com/alangpierce/sucrase/wiki/Porting-changes-from-Babel's-parser

Fixes #783

f7e231fc97 Allow negative number in ambient const initializer (#15338)
🚫 Only affects error handling.

89f38880ce v7.20.13
🚫 Release only.

41aac8b803 fix: `new (foo?.bar)()` incorrectly throws exception `OptionalChainingNoNew` (#15377)
🚫 Only affects error handling.

91b24d5d55 chore: Remove meaningless `typeof undefined` (#15395)
🚫 Babel-internal change.

3aee4e367a Disallows specifiers after export * as ns (#15385)
🚫 Only affects error handling.

e5e923d99c Disallow await as bound name in using declaration (#15391)
🚫 Only affects error handling.

6e1cc6e958 v7.20.15
🚫 Release only.

812ad554ab polish: improve "`await` as identifier" error in modules (#15400)
🚫 Only affects error handling.

d3bd1a3f2f [ts] Fix restrictions for optional parameters (#15414)
🚫 Appears to only affect error handling.

9be2c7fd79 [ts] treat single type param with a constraint as unambiguous (#15436)
🚫 Only affects error handling.

3c26949819 Add `annexb: false` parser option to disable Annex B (#15320)
🚫 I believe all Annex B syntax support was removed long ago.

6e8ce9da64 [ts] Support `export type * from` (#15381)
✅ Ported and added test.

2a7495f2c8 Parser option to allow `new.target` outside functions (#15114)
🚫 Only affects error handling.

eae47c9ec8 Implement decorators as presented at `2023-01` TC39 meeting (#15405)
✅ No parser changes were necessary, but added support for decorators after export with imports transform.

2f3ef392d6 [ts] Support `const` modifier in type parameters (#15384)
✅ This was already accidentally working, but I added some logic to make it work intentionally and added a test.

34136c53f8 docs: fix typos (#15432)
🚫 Babel-internal change.

de7d75a78b v7.21.0
🚫 Release only.

7feaa36ad5 Fix problems found while publishing 7.21.0 (#15440)
🚫 Not relevant to Sucrase.

fa77313884 v7.21.1
🚫 Release only.

a2fdc207ce fix: Throws on `new foo?.bar!()` (#15439)
🚫 Only affects error handling.

fc33467911 v7.21.2
🚫 Release only.

6e3dffe51a disallow mixins/implements in flow interface (#15479)
🚫 Only affects error handling.

4035521068 chore: Enable rule `no-confusing-void-expression` (#15485)
🚫 Babel-internal change.

80863c220b [ts] Allow keywords in tuple labels (#15423)
✅ Type parsing already allowed keywords, added a test for this case.

fbfbd1da8c v7.21.3
🚫 Release only.
alangpierce added a commit that referenced this issue Mar 20, 2023
Instructions: https://github.com/alangpierce/sucrase/wiki/Porting-changes-from-Babel's-parser

Fixes #783

f7e231fc97 Allow negative number in ambient const initializer (#15338)
🚫 Only affects error handling.

89f38880ce v7.20.13
🚫 Release only.

41aac8b803 fix: `new (foo?.bar)()` incorrectly throws exception `OptionalChainingNoNew` (#15377)
🚫 Only affects error handling.

91b24d5d55 chore: Remove meaningless `typeof undefined` (#15395)
🚫 Babel-internal change.

3aee4e367a Disallows specifiers after export * as ns (#15385)
🚫 Only affects error handling.

e5e923d99c Disallow await as bound name in using declaration (#15391)
🚫 Only affects error handling.

6e1cc6e958 v7.20.15
🚫 Release only.

812ad554ab polish: improve "`await` as identifier" error in modules (#15400)
🚫 Only affects error handling.

d3bd1a3f2f [ts] Fix restrictions for optional parameters (#15414)
🚫 Appears to only affect error handling.

9be2c7fd79 [ts] treat single type param with a constraint as unambiguous (#15436)
🚫 Only affects error handling.

3c26949819 Add `annexb: false` parser option to disable Annex B (#15320)
🚫 I believe all Annex B syntax support was removed long ago.

6e8ce9da64 [ts] Support `export type * from` (#15381)
✅ Ported and added test.

2a7495f2c8 Parser option to allow `new.target` outside functions (#15114)
🚫 Only affects error handling.

eae47c9ec8 Implement decorators as presented at `2023-01` TC39 meeting (#15405)
✅ No parser changes were necessary, but added support for decorators after export with imports transform.

2f3ef392d6 [ts] Support `const` modifier in type parameters (#15384)
✅ This was already accidentally working, but I added some logic to make it work intentionally and added a test.

34136c53f8 docs: fix typos (#15432)
🚫 Babel-internal change.

de7d75a78b v7.21.0
🚫 Release only.

7feaa36ad5 Fix problems found while publishing 7.21.0 (#15440)
🚫 Not relevant to Sucrase.

fa77313884 v7.21.1
🚫 Release only.

a2fdc207ce fix: Throws on `new foo?.bar!()` (#15439)
🚫 Only affects error handling.

fc33467911 v7.21.2
🚫 Release only.

6e3dffe51a disallow mixins/implements in flow interface (#15479)
🚫 Only affects error handling.

4035521068 chore: Enable rule `no-confusing-void-expression` (#15485)
🚫 Babel-internal change.

80863c220b [ts] Allow keywords in tuple labels (#15423)
✅ Type parsing already allowed keywords, added a test for this case.

fbfbd1da8c v7.21.3
🚫 Release only.
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 a pull request may close this issue.

1 participant