dillon1000/react

Commit

Move key/ref off props and prepare for new descriptor factories

Breaking changes

- key/ref are no longer accessible on props but they are accessible on the
  descriptors. This means that parents/owners can access it but not the
  component itself.

- Descriptor factories are now plain functions and you can't rely on the
  prototype or constructors of descriptors to identify the component type.

Existing descriptor factories are now wrapped in a legacy factory. Currently it
does nothing but it will give us a hook to track callers to factories that are
not using JSX but just invoking the function directly. It also proxies static
methods/properties to the underlying class. The newer factories don't have this
feature.

ReactTextComponent has it's own little factory because it's props is not an
object. This is a detail and will go away once ReactTextComponent no longer
needs descriptors.
Browse files
Changed paths16 files
First-parent comparison
M src/browser/ReactDOM.js ModifiedM src/browser/ReactTextComponent.js ModifiedM src/browser/ui/React.js ModifiedM src/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/ReactDescriptor.js ModifiedM src/core/ReactDescriptorValidator.js ModifiedA src/core/ReactLegacyDescriptor.js AddedM src/core/ReactPropTransferer.js ModifiedM src/core/__tests__/ReactCompositeComponent-test.js ModifiedM src/core/__tests__/ReactDescriptor-test.js ModifiedM src/core/instantiateReactComponent.js ModifiedM src/core/shouldUpdateReactComponent.js ModifiedM src/utils/__tests__/cloneWithProps-test.js ModifiedM src/utils/cloneWithProps.js ModifiedM src/utils/traverseAllChildren.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…