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

Drop Legacy Factories #2375

Merged
merged 3 commits into from
Oct 29, 2014
Merged

Conversation

sebmarkbage
Copy link
Collaborator

This is post-0.12 changes. It drops the legacy factory from around the class.

@zpao zpao added this to the 0.13 milestone Oct 21, 2014
@sebmarkbage sebmarkbage force-pushed the droplegacyfactories branch 2 times, most recently from 7d15b28 to d88fed6 Compare October 22, 2014 05:54
mockInstance[key] = ReactCompositeComponentBase.prototype[key];
}
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a hack to restore internal methods to their unmocked state. In a follow up PR, these internals will be moved off the class instances and therefore they won't get mocked.

@sebmarkbage sebmarkbage force-pushed the droplegacyfactories branch 3 times, most recently from e33c8ea to c28d2de Compare October 24, 2014 16:23
mocks = require('mocks');

React = require('React');
ReactComponent = require('ReactComponent');
Copy link
Member

Choose a reason for hiding this comment

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

This is probably why the test is "failing"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. CI now passes.

@zpao
Copy link
Member

zpao commented Oct 28, 2014

:shipit:

These used to be exposed as strings on the legacy factories but are now
gone.
Classes are now pure classes without a legacy factory around them.

Since classes will become just any function that returns a valid instance,
let's drop isValidClass.

There's some hacks in here for auto-mocking frameworks (jest) that mock the
prototype of these classes. These hacks allow these classes to be mounted.
sebmarkbage added a commit that referenced this pull request Oct 29, 2014
@sebmarkbage sebmarkbage merged commit a54ed49 into facebook:master Oct 29, 2014
@coveralls
Copy link

coveralls commented May 2, 2016

Coverage Status

Changes Unknown when pulling 9b36b04 on sebmarkbage:droplegacyfactories into * on facebook:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants