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

Conversation

Projects
None yet
6 participants
@g-plane
Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Sep 23, 2018

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

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo left a comment

Is this a breaking change?

@g-plane

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

g-plane commented Sep 24, 2018

Any progress?

@existentialism

This comment has been minimized.

Copy link
Member

existentialism commented Sep 25, 2018

@babel babel deleted a comment from babel-bot Sep 25, 2018

@xtuc

This comment has been minimized.

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.

@xtuc

xtuc approved these changes Sep 25, 2018

Copy link
Member

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

babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 80.49% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@existentialism

This comment has been minimized.

Copy link
Member

existentialism commented Sep 25, 2018

@g-plane thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment