Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

📎 TypeScript 5.0 #4227

Closed
2 tasks done
Conaclos opened this issue Feb 22, 2023 · 9 comments · Fixed by #4275
Closed
2 tasks done

📎 TypeScript 5.0 #4227

Conaclos opened this issue Feb 22, 2023 · 9 comments · Fixed by #4275
Labels
A-Formatter Area: formatter A-Parser Area: parser L-TypeScript Area: TypeScript support in Rome S-Planned Status: planned by the team, but not in the short term task A task, an action that needs to be performed
Milestone

Comments

@Conaclos
Copy link
Contributor

Conaclos commented Feb 22, 2023

Description

Add parsing and formatter support for the syntax introduced by TypeScript 5.0

@Conaclos Conaclos added task A task, an action that needs to be performed A-Formatter Area: formatter L-TypeScript Area: TypeScript support in Rome A-Parser Area: parser S-Planned Status: planned by the team, but not in the short term labels Feb 22, 2023
@nissy-dev
Copy link
Contributor

We should support decorators ? Typescript announcement

@Conaclos
Copy link
Contributor Author

Conaclos commented Mar 2, 2023

We should support decorators ? Typescript announcement

Updated.

@ematipico
Copy link
Contributor

ematipico commented Mar 2, 2023

Personally, I would move decorators to their issue. Why? Because it's not a TypeScript thing but a JavaScript thing.

Having decorators here would send the wrong message: it could signal that we aim to support legacy decorators, which is not our intention.

@csvn
Copy link

csvn commented Mar 2, 2023

Personally, I would move decorators to their issue. Why? Because it's not a TypeScript thing but a JavaScript thing.

I think Typescript has one small difference in TS with decorators compared to the spec in TC39 though, they allow decorators before export or export default:

@component('my-foo')
export class Foo {}

@component('my-bar')
export default class Bar {}

Officially in JS this has to be written as:

export @component('my-foo') class Foo {}

export default @component('my-bar') class Bar {}

So I think there may at least be a small difference in syntax parsing/AST between JS/TS.

@ematipico
Copy link
Contributor

@csvn they recently changed the grammar: https://babeljs.io/blog/2023/02/20/7.21.0#decorators-updates

@Conaclos
Copy link
Contributor Author

Conaclos commented Mar 2, 2023

@csvn The TypeScript team talks about this change on the spec after discussion between them and the spec team in their TS 5.0 announcement.

@Conaclos
Copy link
Contributor Author

Conaclos commented Mar 2, 2023

I opened a new issue #4252 for the support of dcorators.

@csvn
Copy link

csvn commented Mar 6, 2023

@ematipico Oh, cool! I did not find that myself when I looked. Glad it's consistent, since it's (IMO) way more ergonomic to have it before export 🙂

@nissy-dev
Copy link
Contributor

I'll take const modifier support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter A-Parser Area: parser L-TypeScript Area: TypeScript support in Rome S-Planned Status: planned by the team, but not in the short term task A task, an action that needs to be performed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants