-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
gatsby-image codemod #28112
gatsby-image codemod #28112
Conversation
packages/gatsby-plugin-image/src/__tests__/fixtures/default/options.json
Outdated
Show resolved
Hide resolved
packages/gatsby-plugin-image/src/__tests__/fixtures/default/options.json
Outdated
Show resolved
Hide resolved
Amazing work! That's loads more than I thought we would have done now! Is there a reason you're not putting it in gatsby-codemods? Using JSCodeShift would give you all the cli stuff for free, along with nice things like dry-run support and lots of test helpers. |
The reason I opted out is that jscodeshift is that recast doesn't have great documentation. After some digging we can set recast parser to Babylon and probably re-use the babel code and have our cake and eat it too. |
packages/gatsby-plugin-image/src/transforms/gatsby-plugin-image.js
Outdated
Show resolved
Hide resolved
…e.js Co-authored-by: Kyle Gill <kylerobertgill@gmail.com>
...es/gatsby-plugin-image/src/transforms/__testfixtures__/gatsby-plugin-image/mansion.output.js
Outdated
Show resolved
Hide resolved
...s/gatsby-plugin-image/src/transforms/__testfixtures__/gatsby-plugin-image/uses-src.output.js
Outdated
Show resolved
Hide resolved
…to image-codemod
packages/gatsby-codemods/src/transforms/__testfixtures__/gatsby-plugin-image/compat.output.js
Show resolved
Hide resolved
packages/gatsby-codemods/src/transforms/__testfixtures__/gatsby-plugin-image/styled.output.js
Show resolved
Hide resolved
...s/gatsby-codemods/src/transforms/__testfixtures__/gatsby-plugin-image/extends-warn.output.js
Show resolved
Hide resolved
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.
"@babel/plugin-syntax-jsx": "^7.12.1", | ||
"@babel/plugin-syntax-typescript": "^7.12.1", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3", |
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'm late, but starting from Babel 7.8.0 this was enabled by default (because it reached Stage 4), so you don't need the syntax plugin anymore! (blog post)
This is the initial progress towards a codemod for converting
gatsby-image
projects to usegatsby-plugin-image
.Main missing pieces:
tracedSVGOptions
)[ch16947]