Skip to content
Merged
3 changes: 3 additions & 0 deletions scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ src/renderers/dom/shared/__tests__/ReactRenderDocument-test.js
* should throw on full document render w/ no markup
* supports findDOMNode on full-page components

src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
* should control a value in reentrant events
Copy link
Collaborator

Choose a reason for hiding this comment

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

I missed why this 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.

Ah yes. I missed this too. This is probably either a bug or behavior change regarding event timing.

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: #8839


src/renderers/shared/__tests__/ReactPerf-test.js
* should count no-op update as waste
* should count no-op update in child as waste
Expand Down
2 changes: 1 addition & 1 deletion scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* findDOMNode should find dom element after expanding a fragment
* should bubble events from the portal to the parent
* should not onMouseLeave when staying in the portal
* should not update event handlers until commit
* should not crash encountering low-priority tree
* throws if non-element passed to top-level render
* throws if something other than false, null, or an element is returned from render
Expand Down Expand Up @@ -959,7 +960,6 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMIframe-test.js

src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
* should properly control a value even if no event listener exists
* should control a value in reentrant events
* should control values in reentrant events with different targets
* should display `defaultValue` of number 0
* only assigns defaultValue if it changes
Expand Down
6 changes: 4 additions & 2 deletions src/renderers/art/ReactARTFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const TYPES = {
TEXT: 'Text',
};

const UPDATE_SIGNAL = {};

/** Helper Methods */

function addEventListeners(instance, type, listener) {
Expand Down Expand Up @@ -418,7 +420,7 @@ const ARTRenderer = ReactFiberReconciler({
// Noop
},

commitUpdate(instance, type, oldProps, newProps) {
commitUpdate(instance, updatePayload, type, oldProps, newProps) {
instance._applyProps(instance, newProps, oldProps);
},

Expand Down Expand Up @@ -482,7 +484,7 @@ const ARTRenderer = ReactFiberReconciler({
},

prepareUpdate(domElement, type, oldProps, newProps) {
return true;
return UPDATE_SIGNAL;
},

removeChild(parentInstance, child) {
Expand Down
24 changes: 15 additions & 9 deletions src/renderers/dom/fiber/ReactDOMFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ var {
createElement,
getChildNamespace,
setInitialProperties,
diffProperties,
updateProperties,
} = ReactDOMFiberComponent;
var { precacheFiberNode } = ReactDOMComponentTree;
var {
precacheFiberNode,
updateFiberEventHandlers,
} = ReactDOMComponentTree;

if (__DEV__) {
var validateDOMNesting = require('validateDOMNesting');
Expand Down Expand Up @@ -184,6 +188,7 @@ var DOMRenderer = ReactFiberReconciler({
}
const domElement : Instance = createElement(type, props, rootContainerInstance, parentNamespace);
precacheFiberNode(internalInstanceHandle, domElement);
updateFiberEventHandlers(domElement, props);
return domElement;
},

Expand All @@ -206,8 +211,9 @@ var DOMRenderer = ReactFiberReconciler({
type : string,
oldProps : Props,
newProps : Props,
rootContainerInstance : Container,
hostContext : HostContext,
) : boolean {
) : null | Array<mixed> {
if (__DEV__) {
const hostContextDev = ((hostContext : any) : HostContextDev);
if (typeof newProps.children !== typeof oldProps.children && (
Expand All @@ -218,31 +224,31 @@ var DOMRenderer = ReactFiberReconciler({
validateDOMNesting(null, String(newProps.children), null, ownAncestorInfo);
}
}
return true;
return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
},

commitMount(
domElement : Instance,
type : string,
newProps : Props,
rootContainerInstance : Container,
internalInstanceHandle : Object,
) : void {
((domElement : any) : HTMLButtonElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement).focus();
},

commitUpdate(
domElement : Instance,
updatePayload : Array<mixed>,
type : string,
oldProps : Props,
newProps : Props,
rootContainerInstance : Container,
internalInstanceHandle : Object,
) : void {
// Update the internal instance handle so that we know which props are
// the current ones.
precacheFiberNode(internalInstanceHandle, domElement);
updateProperties(domElement, type, oldProps, newProps, rootContainerInstance);
// Update the props handle so that we know which props are the ones with
// with current event handlers.
updateFiberEventHandlers(domElement, newProps);
// Apply the diff to the DOM node.
updateProperties(domElement, updatePayload, type, oldProps, newProps);
},

shouldSetTextContent(props : Props) : boolean {
Expand Down
Loading