-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add babel-plugin-transform-async-to-module-method to packageData.js #46
base: master
Are you sure you want to change the base?
Add babel-plugin-transform-async-to-module-method to packageData.js #46
Conversation
src/packageData.js
Outdated
@@ -1,5 +1,6 @@ | |||
const transformPlugins = { | |||
'babel-plugin-transform-async-to-generator': '@babel/plugin-transform-async-to-generator', | |||
'babel-plugin-transform-async-to-module-method': '@babel/plugin-transform-async-to-generator', |
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.
oh this an interesting one - technically it's that new package but we have to support adding options.. yay 😅
{
"plugins": [
- ["@babel/transform-async-to-module-method"]
+ ["@babel/transform-async-to-generator", {
+ "module": "bluebird",
+ "method": "coroutine"
+ }]
]
}
Also very few people use this package but I guess figuring it out could be useful
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.
Oops, sorry I forgot the option 😭
cf18644
to
2f9f89a
Compare
@@ -241,6 +241,7 @@ Object { | |||
"@babel/template": "7.0.0-beta.39", | |||
"@babel/traverse": "7.0.0-beta.39", | |||
"@babel/types": "7.0.0-beta.39", | |||
"[object Object]": "7.0.0-beta.39", |
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.
@hzoo hmm... It seems better to expand it as a character string? But maybe it is difficult.🤔
expect(upgradeDeps(depsFixture, VERSION)).toMatchSnapshot();
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.
just came across this while browsing older PRs!
if i'm understanding this correctly, it looks like this is upgradeDeps
trying to print { module: 'bluebird', method: 'coroutine' }
as a dependency?
think this emerges from the handling of plugins that need to be replaced by two dependencies:
babel-upgrade/src/packageData.js
Line 89 in 00c5c2f
'babel-plugin-syntax-export-extensions': ['@babel/plugin-syntax-export-default-from', '@babel/plugin-syntax-export-namespace-from'], |
babel-upgrade/src/upgradeDeps.js
Lines 24 to 25 in 00c5c2f
if (Array.isArray(newPackageName)) { | |
newPackageName.forEach(name => dependencies[name] = version); |
we could check to make sure we only print strings to deps?
some stuff i was playing with in #55 might also relate here -- i was thinking about using some sort of object shape (as seen at https://github.com/babel/babel-upgrade/pull/55/files#diff-cf061c524d265adf7cfa52b35375795cR128) to describe deps that require more complicated transformations
No description provided.