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

Remove core .metadata properties and resolveModuleSource #6343

Merged
merged 8 commits into from
Sep 29, 2017

Conversation

loganfsmyth
Copy link
Member

Q                       A
Fixed Issues
Patch: Bug Fix? N
Major: Breaking Change? Y
Minor: New Feature?
Tests Added/Pass?
Spec Compliancy?
License MIT
Doc PR
Any Dependency Changes?

Basically tidying up. Removing:

  • Some automated logic to walk the AST for import statements to collect metadata about them, which is useless in most cases since plugins could be injecting things anyway.
  • resolveModuleSource which ran on ES6 imports only (unless my remove babel-helper-module-imports addition) and kind of useless anyway because it never runs on require() 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 that babel.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.

@loganfsmyth loganfsmyth added the PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release label Sep 29, 2017
@babel-bot
Copy link
Collaborator

babel-bot commented Sep 29, 2017

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay lol

Copy link
Member

@hzoo hzoo left a 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!!

@hzoo
Copy link
Member

hzoo commented Sep 29, 2017

pluginPasses: Array<Array<[Plugin, Object]>>;
parserOpts: BabelParserOptions;
opts: Object;
dynamicImportTypes: Object;
dynamicImportIds: Object;
dynamicImports: Array<Object>;
declarations: Object;
usedHelpers: Object;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

@loganfsmyth loganfsmyth merged commit a85a404 into babel:master Sep 29, 2017
@loganfsmyth loganfsmyth deleted the metadata-cleanup branch September 29, 2017 22:26

resolveModuleSource: {
version: 6,
message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options",
Copy link
Member Author

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!

jscinoz added a commit to AvokaTech/babel-plugin-lodash that referenced this pull request Oct 20, 2017
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.
jdalton pushed a commit to lodash/babel-plugin-lodash that referenced this pull request Oct 20, 2017
* 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.
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants