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
(opt-in) Improve @babel/types with env.BABEL_TYPES_8_BREAKING #10917
(opt-in) Improve @babel/types with env.BABEL_TYPES_8_BREAKING #10917
Conversation
Co-authored-by: Justin Ridgewell <justin+github@ridgewell.name>
60d964c
to
9c15a55
Compare
export function assertClassExpression(node: Object, opts?: Object = {}): void { | ||
assert("ClassExpression", node, opts); | ||
} | ||
export function assertClassDeclaration(node: Object, opts?: Object = {}): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are sorted alphabetically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is automatically generated. I had to swap then in the definitions/es2015
file, so they got swapped here.
fields: { | ||
// todo | ||
}, | ||
fields: !process.env.BABEL_TYPES_8_BREAKING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used !
everywhere so that, when deleting it for Babel 8, I only have to make one selection (from !
to :
) rather than two (from !
to ?
and then from :
to the end).
Dev-optimization? 😄
As discussed during the Dec 04 meeting, I'm introducing the stricter AST validation of #5971 behind a flag.
We decided to introduce those breaking changes when the
process.env.BABEL_TYPES_8_BREAKING
env variable is enabled, to give time to some popular projects (likereact-native
) to update their code before the Babel 8 release, to provide a smoother update experience to our users.I didn't include the changes related to the default value of
decorators
(since they are still highly experimental, I don't think we should pollute the AST unless the parser plugin is enabled). Also, I didn't include thevalidateDeep
logic, but we can introduce it later in our test runner.Our tests are already passing when
BABEL_TYPES_8_BREAKING=true
.