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: reserve unknown as TSUnknownKeyword #8755

Merged
merged 1 commit into from Sep 25, 2018
Merged

TypeScript: reserve unknown as TSUnknownKeyword #8755

merged 1 commit into from Sep 25, 2018

Conversation

g-plane
Copy link
Contributor

@g-plane g-plane commented Sep 23, 2018

Q                       A
Fixed Issues? No
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link None
Any Dependency Changes? No
License MIT

unknown is reserved as a keyword since TypeScript 3.0, so I add it. The AST node name is TSUnknownKeyword.

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9151/

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Is this a breaking change?

@g-plane
Copy link
Contributor Author

g-plane commented Sep 23, 2018

Previously, the babel parser will treat unknown as an identifier whose name is unknown, and now it will be TSUnknownKeyword. That's, other identifiers won't be affected. IMHO, it won't be a breaking change for end users. Also, it will be OK for most libraries authors, unless they use the identifier unknown to do something, because the unknown will be always parsed as a keyword, not an identifier.

EDIT: This only affects type annotation, and it won't affect normal JS code.

@g-plane
Copy link
Contributor Author

g-plane commented Sep 24, 2018

Any progress?

@existentialism
Copy link
Member

existentialism commented Sep 25, 2018

/cc: @JamesHenry @babel/typescript

@existentialism existentialism added PR: New Feature 🚀 A type of pull request used for our changelog categories pkg: parser area: typescript labels Sep 25, 2018
@babel babel deleted a comment from babel-bot Sep 25, 2018
@xtuc
Copy link
Member

xtuc commented Sep 25, 2018

Doesn't look like a breaking, apart if people use their own unknown type I guess? But that's also the case in tsc.

Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

Waiting for the TS team to approve and merge

@existentialism existentialism merged commit f38be13 into babel:master Sep 25, 2018
@existentialism
Copy link
Member

@g-plane thanks!

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: New Feature 🚀 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants