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

Add babel-plugin-transform-async-to-module-method to packageData.js #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented Mar 1, 2018

No description provided.

@@ -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',
Copy link
Member

@hzoo hzoo Mar 1, 2018

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

Copy link
Member Author

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 😭

@hiroppy hiroppy force-pushed the feature/introduce-babel-plugin-transform-async-to-module-method branch from cf18644 to 2f9f89a Compare March 1, 2018 23:59
@@ -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",
Copy link
Member Author

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();

Copy link
Member

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-plugin-syntax-export-extensions': ['@babel/plugin-syntax-export-default-from', '@babel/plugin-syntax-export-namespace-from'],

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

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

Successfully merging this pull request may close these issues.

3 participants