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

commented Sep 29, 2017

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.
@babel-bot

This comment has been minimized.

Copy link
Collaborator

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 {

This comment has been minimized.

Copy link
@hzoo

hzoo Sep 29, 2017

Member

yay lol

@hzoo
hzoo approved these changes Sep 29, 2017
Copy link
Member

left a comment

amazing, love the -469 lines, keep it up!!

@hzoo

This comment has been minimized.

Copy link
Member

commented Sep 29, 2017

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

This comment has been minimized.

Copy link
@hzoo

hzoo Sep 29, 2017

Member

this can be removed

@loganfsmyth loganfsmyth force-pushed the loganfsmyth:metadata-cleanup branch from 9b3e7b5 to a390a92 Sep 29, 2017
@loganfsmyth loganfsmyth merged commit a85a404 into babel:master Sep 29, 2017
0 of 2 checks passed
0 of 2 checks passed
ci/circleci CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@loganfsmyth loganfsmyth deleted the loganfsmyth:metadata-cleanup branch Sep 29, 2017

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

This comment has been minimized.

Copy link
@loganfsmyth

loganfsmyth Sep 29, 2017

Author Member

cc @tleunen :) Hope that's cool!

@tyscorp tyscorp referenced this pull request Oct 18, 2017
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 added 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 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.
Projects
None yet
4 participants
You can’t perform that action at this time.