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

Update babylon beta 3 #5394

Merged
merged 3 commits into from
Feb 28, 2017
Merged

Update babylon beta 3 #5394

merged 3 commits into from
Feb 28, 2017

Conversation

hzoo
Copy link
Member

@hzoo hzoo commented Feb 28, 2017

The changes were either simple rename or code removal

@hzoo hzoo added the PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release label Feb 28, 2017
@hzoo hzoo added this to the Babel 7 milestone Feb 28, 2017
@hzoo hzoo changed the title Update babylon 3 Update babylon beta 3 Feb 28, 2017
@@ -12,8 +12,6 @@ export function RestElement(node: Object) {

export {
RestElement as SpreadElement,
RestElement as SpreadProperty,
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing since it won't be generated anymore

@@ -0,0 +1 @@
z = { x, ...y };
Copy link
Member Author

Choose a reason for hiding this comment

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

shouldn't be there. removing

@@ -61,23 +61,3 @@ defineType("ExportNamespaceSpecifier", {
}
}
});

defineType("RestProperty", {
Copy link
Member

Choose a reason for hiding this comment

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

Should we add these as virtual types in https://github.com/babel/babel/blob/7.0/packages/babel-traverse/src/path/lib/virtual-types.js, e.g.

export const RestProperty = {
  types: ["RestElement"],
  checkPath(path: NodePath): boolean {
    return path.parentPath && path.parentPath.isObjectPattern();
  },
};
export const SpreadProperty = {
  types: ["RestElement"],
  checkPath(path: NodePath): boolean {
    return path.parentPath && path.parentPath.isObjectExpression();
  },
};

it might make it easier for people to convert a plugin from 6.x to 7.x

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok we can do that, although the visitors are still gone since ast is changed, so would that do much?

Copy link
Member

Choose a reason for hiding this comment

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

If other people write plugins that visit these types, this would keep the visitors working.

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good

Copy link
Member Author

@hzoo hzoo Feb 28, 2017

Choose a reason for hiding this comment

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

Do we want to do that with the rest of the ast changes then?

ForAwaitStatement, NumericLiteralTypeAnnotation, ExistentialTypeParam

Copy link
Member Author

Choose a reason for hiding this comment

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

And then do we want to console.warn or something for these?

Copy link
Member

Choose a reason for hiding this comment

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

It if is doable for a type, I'd vote we do it, but it won't work for all of them.

For .warn I'm not sure.

Copy link
Member

Choose a reason for hiding this comment

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

You want to do this virtual types in 6.x? imho it doesn't make sense to introduce bc code in a major version.

@hzoo
Copy link
Member Author

hzoo commented Feb 28, 2017

Ok added types - looked at babel/website#1146 for ast node changes

@hzoo hzoo merged commit 3ff77a6 into 7.0 Feb 28, 2017
@hzoo hzoo deleted the update-babylon-3 branch March 3, 2017 22:31
nitin42 pushed a commit to nitin42/babel that referenced this pull request Mar 14, 2017
* Update babylon to v7-beta.3

* convert RestProperty/SpreadProperty to RestElement/SpreadElement

* add virtual types to make it easier to upgrade
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants