Skip to content

Remove core .metadata properties and resolveModuleSource#6343

Merged
loganfsmyth merged 8 commits intobabel:masterfrom
loganfsmyth:metadata-cleanup
Sep 29, 2017
Merged

Remove core .metadata properties and resolveModuleSource#6343
loganfsmyth merged 8 commits intobabel:masterfrom
loganfsmyth:metadata-cleanup

Conversation

@loganfsmyth
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

hzoo commented Sep 29, 2017

dynamicImportIds: Object;
dynamicImports: Array<Object>;
declarations: Object;
usedHelpers: Object;
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants