-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Drop Legacy Factories #2375
Conversation
7d15b28
to
d88fed6
Compare
mockInstance[key] = ReactCompositeComponentBase.prototype[key]; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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.
e33c8ea
to
c28d2de
Compare
mocks = require('mocks'); | ||
|
||
React = require('React'); | ||
ReactComponent = require('ReactComponent'); |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. CI now passes.
c28d2de
to
b542f6e
Compare
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.
b542f6e
to
9b36b04
Compare
Changes Unknown when pulling 9b36b04 on sebmarkbage:droplegacyfactories into * on facebook:master*. |
This is post-0.12 changes. It drops the legacy factory from around the class.