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
[WIP] Use babel 7 #475
[WIP] Use babel 7 #475
Conversation
src/transforms/babel.js
Outdated
@@ -17,7 +17,8 @@ module.exports = async function(asset) { | |||
config.plugins = [require('@babel/plugin-transform-modules-commonjs')]; | |||
} | |||
|
|||
let res = babel.transformFromAst(asset.ast, asset.contents, config); | |||
let res = babel.transformFromAstSync(asset.ast, asset.contents, config); |
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.
Maybe u could use the async one and convert it into a promise and use await babel.transformAst?
As the function this is called in is asynchronous anyway.
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.
Yes, do you have a preferred way for promisifing (like a helper) or can I create a Promise here?
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.
There is this util that should work perfectly, https://github.com/parcel-bundler/parcel/blob/master/src/utils/promisify.js
Cool, thanks for working on this! 👍 I'm not sure we should upgrade yet until Babel 7 final is released. Probably shouldn't depend on the alpha. Question: is Babel 7 backward compatibile with Babel 6 plugins? Is the |
Some API have been changed between these two versions and we have a few incompatibility issues. The Babel configuration stays the same apart from the addition of |
I don't think we should use Babel 7 yet, I've been using it a lot at work and it's not been very stable |
Would be nice to have this. At least in Beta. Babel 7 has been working well for me. |
Just thought I'd mention, Meteor has been using babel 7.0.0 beta since January. It would definitely make sense for Parcel to support it. |
Any updates on the upgrade? I want to use the new bigints syntax: 100n and that needs the new babel. |
Gonna close this due to it becoming more and more conflicted with current branch and will eventually take longer to update than re-implement |
FYI the first rc release has been published a couple of minutes ago. |
I also removed
matchesPattern
which is now in@babel/types
.Edit:
I managed to break most of your tests:
returns
undefined
now. Do you have any idea why?I work continue to work on this tomorrow.