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

Misc fixes + Move babel-core config processing from transformation/file/options into top-level folder #5489

Merged
merged 16 commits into from
Mar 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/babel-core/src/transformation/plugin.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import OptionManager from "./file/options/option-manager";
import * as messages from "babel-messages";
import Store from "../store";
import traverse from "babel-traverse";
import clone from "lodash/clone";

const GLOBAL_VISITOR_PROPS = ["enter", "exit"];

export default class Plugin extends Store {
Copy link
Member

Choose a reason for hiding this comment

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

👍 I guess we never had to use .get/.set?

Actually what about https://github.com/babel/babel/blob/7.0/packages/babel-plugin-transform-runtime/src/index.js#L32

Copy link
Member Author

Choose a reason for hiding this comment

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

this in that example is an instance of PluginPass, not Plugin. The only place Plugin was ever even exposed was this.plugin which I'm removing in this PR too, so removing the subclassing won't hurt anything that isn't already broken by that.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok I couldn't tell so I just assumed it was Plugin (and of course the tests passes so it's good, just was confused)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah understanding where each type of class is used is super confusing.

export default class Plugin {
constructor(plugin: Object, key?: string) {
super();

this.initialized = false;
this.raw = Object.assign({}, plugin);
this.key = this.take("name") || key;
Expand Down