Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Support latest babel 7 only #78

Merged
merged 3 commits into from
Dec 11, 2017
Merged

Support latest babel 7 only #78

merged 3 commits into from
Dec 11, 2017

Conversation

danez
Copy link
Contributor

@danez danez commented Dec 7, 2017

This drops babel 6 as babel 7 now has also different package names which makes it rather complicated to support both.

This fixes several issues:

  • The plugins received from OptionManager are now classes and not arrays and have a prop options
  • The plugin key that the resolver was checking in the babel 7 case was wrong it is now module-resolver see here https://github.com/tleunen/babel-plugin-module-resolver/blob/master/src/index.js#L25
  • The tests are broken, because jest by default sets the env to "test" which was interfering with the test that tested different environments.
  • The babel internal test does not work as internals are not exposed this way anymore

This is basically the same as #76 with fixed tests.

"@babel/core": "^7.0.0-beta.34",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.34",
"@babel/preset-env": "^7.0.0-beta.34",
"babel-core": "^7.0.0-0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed for jest and installs the babel-core bridge. https://github.com/babel/babel-bridge
We could have used the bridge here, but I think creating a new major version is not that big of a problem here, than it is in jest.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh nice! I noticed that issue with jest when I worked on that in #76

Thank you so much for fixing it.

BREAKING CHANGE: This resolver now requires babel 7
@tleunen
Copy link
Owner

tleunen commented Dec 7, 2017

What do you suggest here? Moving @babel/core from peerDep to dep? Or releasing a new major version?

Since it's still a beta, most users are probably still using babel 6 and I'm guessing this might create more issues for them?

Otherwise, I'm all good for this PR, thank you.

@danez
Copy link
Contributor Author

danez commented Dec 8, 2017

I'm not sure. I think I would release 4.0 soon-ish, as it is needed for the babel plugin 3.x?

To not break more users i think 4.0 should be released as is. Or with babel 7 removed as it is only working with some older babel 7 version anyway. If not removed I would only fix the key check for babel 7, as it is obviously wrong now that the babel plugin sets its name here.

But I guess I would prefer releasing 4.0 without babel 7 and then do 5.x-beta for babel 7.

Complete other solution would be to support both, same as jest. But then users of babel 7 have to install @babel/core@7 and babel-core@7.0.0-bridge.0. see https://facebook.github.io/jest/docs/en/getting-started.html#using-babel

@tleunen
Copy link
Owner

tleunen commented Dec 8, 2017

Yes good idea. I'll release v4 with Babel 6, then v5 with Babel 7.

Forcing the users to install 7 and the babel-core bridge is not a viable solution imo. It's a bit an ugly hack :/

(I'll actually finally try to setup these 2 packages with lerna and keep the versions synchronized to make it easier for all users)

@tleunen tleunen merged commit f2804c5 into tleunen:master Dec 11, 2017
@danez danez deleted the patch-1 branch December 11, 2017 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants