dillon1000/react

Commit

Separate React Composite and Class

ReactClass is now composed by ReactCompositeComponent rather than
inherit from it.

The state transition functions currently use ReactInstanceMap to map an
instance back to an internal representation.

I updated some tests to use public APIs. Other unit tests still reach into
internals but now we can find them using ReactInstanceMap.

I will do more cleanup in follow ups. The purpose of this diff is to
preserve semantics and most of the existing code.

This effectively enables support for ES6 classes. All you would need to
expose is ReactClassMixin.
Browse files
Changed paths23 files
First-parent comparison
M src/browser/ui/ReactBrowserComponentMixin.js ModifiedM src/browser/ui/ReactMount.js ModifiedM src/browser/ui/__tests__/ReactDOMComponent-test.js ModifiedM src/browser/ui/__tests__/ReactRenderDocument-test.js ModifiedM src/class/ReactClass.js ModifiedM src/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/ReactElementValidator.js ModifiedA src/core/ReactInstanceMap.js AddedM src/core/ReactOwner.js ModifiedM src/core/ReactPropTransferer.js ModifiedM src/core/ReactRef.js ModifiedM src/core/__tests__/ReactComponent-test.js ModifiedM src/core/__tests__/ReactComponentLifeCycle-test.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedM src/core/__tests__/ReactCompositeComponentState-test.js ModifiedM src/core/__tests__/ReactElement-test.js ModifiedM src/core/__tests__/ReactInstanceHandles-test.js ModifiedM src/core/__tests__/ReactMultiChildReconcile-test.js ModifiedM src/core/__tests__/refs-destruction-test.js ModifiedM src/core/instantiateReactComponent.js ModifiedM src/test/ReactTestUtils.js ModifiedM src/test/reactComponentExpect.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…