-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Remove core .metadata properties and resolveModuleSource #6343
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/5094/ |
@@ -1,15 +0,0 @@ | |||
export default class Store { |
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.
yay lol
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.
amazing, love the -469 lines, keep it up!!
|
pluginPasses: Array<Array<[Plugin, Object]>>; | ||
parserOpts: BabelParserOptions; | ||
opts: Object; | ||
dynamicImportTypes: Object; | ||
dynamicImportIds: Object; | ||
dynamicImports: Array<Object>; | ||
declarations: Object; | ||
usedHelpers: Object; |
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.
this can be removed
9b3e7b5
to
a390a92
Compare
|
||
resolveModuleSource: { | ||
version: 6, | ||
message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options", |
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.
cc @tleunen :) Hope that's cool!
Babel no longer does this internally as of babel/babel#6343. This commit implements the same traversal as part of this plugin, using the same code that was removed from Babel with some trivial modifications.
* Add dependencies on babel-types and babel-helper-module-imports * Traverse file AST ourselves to build module metadata. Babel no longer does this internally as of babel/babel#6343. This commit implements the same traversal as part of this plugin, using the same code that was removed from Babel with some trivial modifications. * Use addDefault from babel-helper-module-imports to add our imports. file.addImport is deprecated by Babel and attempting to use it will throw.
Basically tidying up. Removing:
resolveModuleSource
which ran on ES6 imports only (unless my removebabel-helper-module-imports
addition) and kind of useless anyway because it never runs onrequire()
calls.usedHelpers
which I can't think of a good usecase for and I don't see a use for.babel.analyse
since it does nothing thatbabel.transform
doesn't do.path.mark()
because it, as far as I can tell, something that is super easily to implement in your own plugin, and not used anywhere I can think.