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

@babel-bot babel-bot commented Sep 23, 2018

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

Is this a breaking change?

@g-plane
Copy link
Contributor Author

@g-plane 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 g-plane commented Sep 24, 2018

Any progress?

@existentialism
Copy link
Member

@existentialism existentialism commented Sep 25, 2018

@babel babel deleted a comment from babel-bot Sep 25, 2018
@xtuc
Copy link
Member

@xtuc 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.

@xtuc
xtuc approved these changes Sep 25, 2018
Copy link
Member

@xtuc xtuc left a comment

Waiting for the TS team to approve and merge

@existentialism existentialism merged commit f38be13 into babel:master Sep 25, 2018
4 checks passed
4 checks passed
@babel-bot
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
@codecov
codecov/project 80.49% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@existentialism
Copy link
Member

@existentialism existentialism commented Sep 25, 2018

@g-plane thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants