-
Notifications
You must be signed in to change notification settings - Fork 65
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 babel to 7 & ava to 1 #117
base: master
Are you sure you want to change the base?
Conversation
👍 I also started taking a whack at this, and it looks like more or less what I was doing. I'll check this out and see if I can get any insight about the test failure, browser messages. |
].map(require.resolve), | ||
plugins: [ | ||
'babel-plugin-macros', | ||
'babel-plugin-transform-runtime' | ||
'@babel/plugin-transform-runtime', | ||
'@babel/plugin-proposal-class-properties' |
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 suspect the reason that you got the error about the import in the test is that there's still things missing from the plugins.
It's super confusing based on how the official babel upgrade doc is worded, but I think to get equivalent functionality we need all of the stuff used in stage 0-2. I think all the extras where added by the babel upgarde tool to the package.json
already. They probably just need to be added here.
And we might need to add them to mdx
loader as plugins as well? Some of those handle the syntax for import
.
I could absolutely be wrong about all of this.
FWIW I get three errors in the browser console, but I also get them on master. They have to do with
I'm fairly certain these are coming from out of date Rebass / styled-components dependencies, but seeing as they're on master, I don't think there a result of your changes. I think this is on the right track, but I think you need to also
Add the plugins to I got this working by mapping all to arrays, callling const babel = {
presets: [
'@babel/preset-env',
'@babel/preset-react'
].map(require.resolve),
plugins: [
'babel-plugin-macros',
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-function-bind',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-logical-assignment-operators',
['@babel/plugin-proposal-optional-chaining', { 'loose': false }],
['@babel/plugin-proposal-pipeline-operator', { 'proposal': 'minimal' }],
['@babel/plugin-proposal-nullish-coalescing-operator', { 'loose': false }],
'@babel/plugin-proposal-do-expressions',
['@babel/plugin-proposal-decorators', { 'legacy': true }],
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', { 'loose': false }],
'@babel/plugin-proposal-json-strings'
].map(p => [p].flat())
.map(([p, ...opts]) => ([require.resolve(p), ...opts]))
} |
I think you'll also want to nuke the test in |
bump |
Any progress on this? I'd want to use |
I was having issues using
x0
within a project which already had babel 7 as a dependency.For reference the error was;
I took a stab at upgrading as I've found
x0
to be the best solutions for documenting React components.This PR works against my project and also works for
x0
's own documentation. There are however some issues I've been unable to fix, they are;I suspect this is something I've missed in the babel update but couldn't figure out what was missing, hopefully someone can provide some insight.
Other than that everything seems to be working as it was but it'd be good to get some confirmation on that.