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

Throw upgrade error when babel version is less than 6.14.0 #116

Merged
merged 3 commits into from
Aug 29, 2016

Conversation

boopathi
Copy link
Member

@boopathi boopathi commented Aug 27, 2016

@@ -1,20 +1,53 @@
const err = new Error("Babili is supported only for babel version >=6.14.0");
Copy link
Member

Choose a reason for hiding this comment

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

We can be more specific here - babel is babel-core. Can explain you need to update babel-core, or cli, etc


function isVersion(versionStr) {
const version = versionStr.split(".").map((p) => parseInt(p));
if (version[0] >= 6 && version[1] >= 14) {
Copy link
Member

Choose a reason for hiding this comment

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

return version[0] >= 6 && version[1] >= 14 ? :)

@kangax kangax merged commit 2da1cc5 into master Aug 29, 2016
@kangax kangax deleted the babel-set-version branch August 29, 2016 19:59
@kangax
Copy link
Member

kangax commented Aug 29, 2016

thanks!


function isVersion(versionStr) {
const version = versionStr.split(".").map((p) => parseInt(p));
return version[0] >= 6 && version[1] >= 14;
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 do === 6 instead of >= 6?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is reverted. because it seems not possible to check version in preset.

But yeah, cool.. it should be ===6

Copy link
Member

Choose a reason for hiding this comment

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

Oh weird. I'd have expected the version to show up properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does show up properly. But problems in supporting older versions.

  • Older versions of babel only accept an object
  • Newer versions when they accept an object with key = plugins don't execute buildPreset - so no plugin is applied in preset.
  • We use name property to measure performance of each plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants