-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
TypeScript 3.8 Syntax Support #1436
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
Comments
As for Private Fields babel already supports it as ClassPrivateProperty
- key: PrivateName
- id: Identifier
- value: Expression
- static: boolean
- typeAnnotation: TypeAnnotation |
Perhaps a lint rule could be created to only allow types to be imported and exported with the new "type import" syntax? That makes it less likely that Babel users will get types in their JavaScript output. Is there a feature request issue for that yet? |
See Copy-pasted from babel/babel#8361 (comment). |
This was already mentioned in babel/babel#10981 (comment), but wanted to put it here as well. Would be good if we can use the same node property to identify type imports both from Flow and TS (i.e. |
@joaovieira thats how its implemented for now, i'm following up ticket at babel and i will align it if changes will be needed see #1465 |
@vkrol the |
Just out of interest: When do you guys plan to ship a version with support for TS 3.8? Type-only imports solve quite a few circularity issues in a project of mine, so I'm eager to use the new features. Unfortunately neither Babel, nor ESLint/Prettier have support yet. Edit: Not sure why I'm being downvoted. Just a rough estimate would be nice so I don't have to check the linked issues every few days. If it takes 2 months, so be it... |
Question: Does ESTree still not support private class fields? This blocks #1666 |
ESTree does not fully support it yet. Looking at the recent TC39 notes - it looks like the features are very close to proceeding to stage 4. I'm undecided if we want to move to implement the proposed AST right now. We would be the first implementors, and doing so would break any rules that rely upon the current representation babel uses. There's also no guarantee that the preliminary AST won't change before finalisation - which would be a breaking change to deal with. I think it's probably better to keep it in limbo for the moment, and keep tracking the TC39 progress. |
It’s shipped in multiple browsers - it’s highly unlikely to change in a meaningful way, like every stage 3 feature. |
I totally agree about waiting, for whatever it's worth. Don't want a repeat of the optional chaining situation. @ljharb in my opinion the deeper problem is not with whether it's at stage 3 or not - but whether the upstream support exists (in ESTree). This project can land itself in quite a mess if it implements something that later is changed (which has happened and has happened recently). ESTree would be a better place to make an issue or offer support. To me, if the AST structure is firmly decided upon, then it doesn't really matter if it's stage 4. The thought-experiment you might conduct to verify this would be to ask if anything about this issue would be different if TC-39 had happened to promote it to stage 4 in the last meeting in September. I think the answer is no: we'd still be right where we are (from the vantage point of |
@dimitropoulos that's a totally fair point, and is why I continue to hope ESTree changes its policy and starts supporting shipped stage 3 syntax by default. |
Hey. I am wondering if there is a rough estimation when this will be finished? Thanks in advance. :) |
When will private fields be ready? When will that be? What's the status of support in this project? What if I want to lint private fields? [1] I can give you this piece of string to measure in the meantime. |
Hey. I would like to ask again what's the current status? Any updates since #1436 (comment)? Thanks. |
We do all of our work in the open. Nothing is private. You can see PRs linked to this issue. |
3.8 requires new AST nodes and to support the new syntax.
Type Import (#1697) (SUPPORTED)
export * as ns
Syntax (#1698) (SUPPORTED)ECMAScript Private Fields (NOT YET SUPPORTED - see #3430)
AST: estree/estree#222
Important Note
We currently "support" such that no tooling should fail on private fields.
However, the AST that is produced is not considered stable and will change in future without a major release. Any tooling looking to lint private fields should not rely upon the representation (or be prepared to handle a breakage).
Why don't we have support yet?
In short: we are awaiting agreement on the AST representation from the ESTree spec.
For the 3.7 release we jumped the gun and eagerly implemented optional chaining using babel's AST representation, thinking that the ESTree spec, would just go with that. However ESTree is going with a different and incompatible representation entirely. This will cause our project (and users) a lot of pain as we will have to do a major, breaking change to the AST to align with what ESLint core will use.
To avoid going through the same pain again with private class fields, we're holding off on official support until ESTree has decided upon a representation.
There are a lot of projects, and a lot of volunteers that collaborate on the ESTree spec, so things take time; please be patient.
Read more:
https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/
The text was updated successfully, but these errors were encountered: