Wire up ReactDOMFiberComponent in ReactDOMFiber
We'll need to do the DOM injection now.
Sebastian Markbage committed
Nov 18, 2016 at 12:01 UTC
836331ba5f69f2cc53b273ec073fae116db14302
6 files changed
+140
-139
scripts/fiber/tests-failing.txt
+3
-71
@@ -38,9 +38,6 @@ src/renderers/art/__tests__/ReactART-test.js
38
* resolves refs before componentDidMount
39
* resolves refs before componentDidUpdate
40
41
-src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
42
-* should set style attribute when styles exist
43
-
41
src/renderers/dom/shared/__tests__/ReactBrowserEventEmitter-test.js
42
* should store a listener correctly
43
* should retrieve a listener correctly
@@ -59,51 +56,19 @@ src/renderers/dom/shared/__tests__/ReactBrowserEventEmitter-test.js
56
* should infer onTouchTap from a touchStart/End
57
* should infer onTouchTap from when dragging below threshold
58
* should not onTouchTap from when dragging beyond threshold
62
-* should listen to events only once
63
-* should work with event plugins without dependencies
64
-* should work with event plugins with dependencies
59
* should bubble onTouchTap
60
61
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
68
-* should handle className
69
-* should gracefully handle various style value types
62
* should update styles when mutating style object
71
-* should update styles if initially null
72
-* should update styles if updated to null multiple times
73
-* should allow named slot projection on both web components and regular DOM elements
74
-* should remove attributes
75
-* should remove properties
76
-* should properly update custom attributes on custom elements
77
-* should clear a single style prop when changing `style`
78
-* should update arbitrary attributes for tags containing dashes
79
-* should update styles when `style` changes from null to object
63
+* should warn when mutating style
64
* should empty element when removing innerHTML
65
* should transition from innerHTML to children in nested el
82
-* should not incur unnecessary DOM mutations for attributes
83
-* should not incur unnecessary DOM mutations for string properties
84
-* should not incur unnecessary DOM mutations for boolean properties
85
-* should ignore attribute whitelist for elements with the "is: attribute
86
-* should not update when switching between null/undefined
87
-* should warn against children for void elements
88
-* should warn against dangerouslySetInnerHTML for void elements
89
-* should treat menuitem as a void element but still create the closing tag
90
-* should validate against multiple children props
91
-* should validate use of dangerouslySetInnerHTML
92
-* should validate use of dangerouslySetInnerHTML
93
-* should validate against invalid styles
66
* should track input values
67
* should track textarea values
68
* should warn for children on void elements
97
-* should support custom elements which extend native elements
98
-* should warn against children for void elements
99
-* should warn against dangerouslySetInnerHTML for void elements
100
-* should validate against multiple children props
101
-* should validate against invalid styles
69
* should report component containing invalid styles
70
* should clean up input value tracking
71
* should clean up input textarea tracking
105
-* should throw when an invalid tag name is used
106
-* should throw when an attack vector is used
72
* gives source code refs for unknown prop warning
73
* gives source code refs for unknown prop warning for update render
74
* gives source code refs for unknown prop warning for exact elements
@@ -172,32 +137,18 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
137
* should properly control a value even if no event listener exists
138
* should control a value in reentrant events
139
* should control values in reentrant events with different targets
175
-* should display `defaultValue` of number 0
176
-* should display "true" for `defaultValue` of `true`
177
-* should display "false" for `defaultValue` of `false`
140
* should update `defaultValue` for uncontrolled input
141
* should update `defaultValue` for uncontrolled date/time input
180
-* should take `defaultValue` when changing to uncontrolled input
181
-* should render name attribute if it is supplied
182
-* should display "foobar" for `defaultValue` of `objToString`
183
-* should display `value` of number 0
184
-* should allow setting `value` to `true`
185
-* should allow setting `value` to `false`
186
-* should allow setting `value` to `objToString`
187
-* should not incur unnecessary DOM mutations
142
* should properly control a value of number `0`
143
* should have the correct target value
144
* should control radio buttons
145
* should control radio buttons if the tree updates during render
146
* should have a this value of undefined if bind is not used
147
+* should update defaultValue to empty string
148
* sets type, step, min, max before value always
194
-* sets value properly with type coming later in props
195
-* does not raise a validation warning when it switches types
149
* resets value of date/time input to fix bugs in iOS Safari
150
151
src/renderers/dom/shared/wrappers/__tests__/ReactDOMOption-test.js
199
-* should ignore and warn invalid children types
200
-* should set attribute for empty value
152
* should allow ignoring `value` on option
153
154
src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js
@@ -219,26 +170,15 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js
170
* should select grandchild options nested inside an optgroup
171
172
src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js
222
-* should allow setting `defaultValue`
223
-* should display `defaultValue` of number 0
224
-* should display "false" for `defaultValue` of `false`
225
-* should display "foobar" for `defaultValue` of `objToString`
173
* should set defaultValue
227
-* should display `value` of number 0
174
+* should update defaultValue to empty string
175
* should allow setting `value` to `giraffe`
176
* should allow setting `value` to `true`
177
* should allow setting `value` to `false`
178
* should allow setting `value` to `objToString`
232
-* should take updates to `defaultValue` for uncontrolled textarea
233
-* should take updates to children in lieu of `defaultValue` for uncontrolled textarea
179
* should not incur unnecessary DOM mutations
180
* should properly control a value of number `0`
236
-* should treat children like `defaultValue`
237
-* should keep value when switching to uncontrolled element if not changed
181
* should keep value when switching to uncontrolled element if changed
239
-* should allow booleans as children
240
-* should allow objects as children
241
-* should throw with multiple or invalid children
182
183
src/renderers/dom/stack/client/__tests__/ReactDOM-test.js
184
* throws in render() if the mount callback is not a function
@@ -356,15 +296,9 @@ src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js
296
* gets recorded for composite roots
297
* gets recorded when a native is mounted deeply instead of null
298
* gets recorded during mount
359
-* gets recorded during an update
360
-* gets ignored if the styles are shallowly equal
299
* gets recorded during mount
362
-* gets recorded during an update
363
-* gets recorded as a removal during an update
300
* gets recorded during mount
365
-* gets recorded during an update
301
* gets recorded during mount
367
-* gets recorded during an update
302
* gets recorded during an update from text content
303
* gets recorded during an update from html
304
* gets recorded during an update from children
@@ -379,7 +313,6 @@ src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js
313
* gets reported when a child is removed
314
315
src/renderers/shared/shared/event/__tests__/EventPluginHub-test.js
382
-* should prevent non-function listeners, at dispatch
316
* should not prevent null listeners, at dispatch
317
318
src/renderers/shared/stack/reconciler/__tests__/ReactComponent-test.js
@@ -412,7 +345,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
345
346
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
347
* should correctly handle all possible children for render and update
415
-* should throw if rendering both HTML and children
348
349
src/renderers/shared/stack/reconciler/__tests__/ReactStatelessComponent-test.js
350
* should warn when stateless component returns array
scripts/fiber/tests-passing-except-dev.txt
+5
-22
@@ -9,9 +9,13 @@ src/isomorphic/classic/element/__tests__/ReactElementClone-test.js
9
* should check declared prop types after clone
10
11
src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js
12
+* warns for keys for arrays of elements with owner info
13
* warns for keys with component stack info
14
* should give context for PropType errors in nested components.
15
16
+src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js
17
+* warns for keys for arrays of elements with owner info
18
+
19
src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
20
* should warn when using hyphenated style names
21
* should warn when updating hyphenated style names
@@ -20,20 +24,11 @@ src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
24
* should warn about style containing a NaN value
25
26
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
23
-* should warn when mutating style
27
* should warn for unknown prop
28
* should group multiple unknown prop warnings together
29
* should warn for onDblClick prop
27
-* should warn nicely about NaN in style
28
-* should reject attribute key injection attack on markup
29
-* should reject attribute key injection attack on update
30
* should work error event on <source> element
31
* should emit a warning once for a named custom component using shady DOM
32
-* should emit a warning once for an unnamed custom component using shady DOM
33
-* should validate against use of innerHTML
34
-* should warn about contentEditable and children
35
-* should warn about contentEditable and children
36
-* should warn about the `onScroll` issue when unsupported (IE8)
32
* should not warn when server-side rendering `onScroll`
33
* warns on invalid nesting
34
* warns on invalid nesting at root
@@ -44,7 +39,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
39
* should warn about incorrect casing on properties
40
* should warn about incorrect casing on event handlers
41
* should warn about class
47
-* should warn about props that are no longer supported
42
* should suggest property name if available
43
44
src/renderers/dom/shared/__tests__/ReactDOMInvalidARIAHook-test.js
@@ -53,36 +47,24 @@ src/renderers/dom/shared/__tests__/ReactDOMInvalidARIAHook-test.js
47
* should warn for an improperly cased aria-* prop
48
49
src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
56
-* should warn with value and no onChange handler and readOnly specified
57
-* should warn with checked and no onChange handler with readOnly specified
50
* should warn if value is null
59
-* should warn if checked and defaultChecked props are specified
60
-* should warn if value and defaultValue props are specified
51
* should warn if controlled input switches to uncontrolled (value is undefined)
52
* should warn if controlled input switches to uncontrolled (value is null)
53
* should warn if controlled input switches to uncontrolled with defaultValue
64
-* should warn if uncontrolled input (value is undefined) switches to controlled
54
* should warn if uncontrolled input (value is null) switches to controlled
55
* should warn if controlled checkbox switches to uncontrolled (checked is undefined)
56
* should warn if controlled checkbox switches to uncontrolled (checked is null)
57
* should warn if controlled checkbox switches to uncontrolled with defaultChecked
69
-* should warn if uncontrolled checkbox (checked is undefined) switches to controlled
70
-* should warn if uncontrolled checkbox (checked is null) switches to controlled
58
* should warn if controlled radio switches to uncontrolled (checked is undefined)
59
* should warn if controlled radio switches to uncontrolled (checked is null)
60
* should warn if controlled radio switches to uncontrolled with defaultChecked
74
-* should warn if uncontrolled radio (checked is undefined) switches to controlled
75
-* should warn if uncontrolled radio (checked is null) switches to controlled
61
* should warn if radio checked false changes to become uncontrolled
62
63
src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js
64
* should warn if value is null
80
-* should warn if value and defaultValue props are specified
65
66
src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js
83
-* should allow numbers as children
67
* should warn if value is null
85
-* should warn if value and defaultValue are specified
68
69
src/renderers/dom/stack/client/__tests__/ReactMount-test.js
70
* should account for escaping on a checksum mismatch
@@ -115,6 +97,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
97
src/renderers/shared/stack/reconciler/__tests__/ReactStatelessComponent-test.js
98
* should warn for childContextTypes on a functional component
99
* should warn when given a ref
100
+* should use correct name in key warning
101
102
src/shared/utils/__tests__/traverseAllChildren-test.js
103
* should warn for using maps as children with owner info
scripts/fiber/tests-passing.txt
+92
-5
@@ -250,7 +250,6 @@ src/isomorphic/classic/element/__tests__/ReactElementClone-test.js
250
251
src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js
252
* warns for keys for arrays of elements in rest args
253
-* warns for keys for arrays of elements with owner info
253
* warns for keys for arrays with no owner or parent info
254
* warns for keys for arrays of elements with no owner info
255
* does not warn for keys when passing children down
@@ -450,7 +449,6 @@ src/isomorphic/modern/element/__tests__/ReactJSXElement-test.js
449
450
src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js
451
* warns for keys for arrays of elements in children position
453
-* warns for keys for arrays of elements with owner info
452
* warns for keys for iterables of elements in rest args
453
* does not warns for arrays of elements with keys
454
* does not warns for iterable elements with keys
@@ -495,6 +493,7 @@ src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
493
* should trim values
494
* should not append `px` to styles that might need a number
495
* should create vendor-prefixed markup correctly
496
+* should set style attribute when styles exist
497
* should not set style attribute when no styles exist
498
499
src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js
@@ -523,25 +522,67 @@ src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js
522
* should support custom attributes
523
524
src/renderers/dom/shared/__tests__/ReactBrowserEventEmitter-test.js
525
+* should listen to events only once
526
+* should work with event plugins without dependencies
527
+* should work with event plugins with dependencies
528
* should not crash ensureScrollValueMonitoring when createEvent returns null
529
530
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
531
+* should handle className
532
+* should gracefully handle various style value types
533
* should not warn for "0" as a unitless style value
534
+* should warn nicely about NaN in style
535
+* should update styles if initially null
536
+* should update styles if updated to null multiple times
537
+* should allow named slot projection on both web components and regular DOM elements
538
* should skip reserved props on web components
539
* should skip dangerouslySetInnerHTML on web components
540
+* should remove attributes
541
+* should remove properties
542
+* should properly update custom attributes on custom elements
543
+* should clear a single style prop when changing `style`
544
+* should reject attribute key injection attack on markup
545
+* should reject attribute key injection attack on update
546
+* should update arbitrary attributes for tags containing dashes
547
* should clear all the styles when removing `style`
548
+* should update styles when `style` changes from null to object
549
* should transition from string content to innerHTML
550
* should transition from innerHTML to string content
551
* should transition from children to innerHTML in nested el
552
+* should not incur unnecessary DOM mutations for attributes
553
+* should not incur unnecessary DOM mutations for string properties
554
+* should not incur unnecessary DOM mutations for boolean properties
555
+* should ignore attribute whitelist for elements with the "is: attribute
556
+* should not update when switching between null/undefined
557
* handles multiple child updates without interference
558
* should generate the correct markup with className
559
* should escape style names and values
560
* should handle dangerouslySetInnerHTML
561
* should not duplicate uppercased selfclosing tags
562
+* should warn against children for void elements
563
+* should warn against dangerouslySetInnerHTML for void elements
564
+* should emit a warning once for an unnamed custom component using shady DOM
565
+* should treat menuitem as a void element but still create the closing tag
566
+* should validate against multiple children props
567
+* should validate against use of innerHTML
568
+* should validate use of dangerouslySetInnerHTML
569
+* should validate use of dangerouslySetInnerHTML
570
* should allow {__html: null}
571
+* should warn about contentEditable and children
572
* should respect suppressContentEditableWarning
573
+* should validate against invalid styles
574
+* should support custom elements which extend native elements
575
+* should warn against children for void elements
576
+* should warn against dangerouslySetInnerHTML for void elements
577
+* should validate against multiple children props
578
+* should warn about contentEditable and children
579
+* should validate against invalid styles
580
* should properly escape text content and attributes values
581
* unmounts children before unsetting DOM node info
582
+* should warn about the `onScroll` issue when unsupported (IE8)
583
+* should throw when an invalid tag name is used
584
+* should throw when an attack vector is used
585
+* should warn about props that are no longer supported
586
587
src/renderers/dom/shared/__tests__/ReactDOMComponentTree-test.js
588
* finds nodes for instances
@@ -686,21 +727,44 @@ src/renderers/dom/shared/utils/__tests__/setInnerHTML-test.js
727
* sets innerHTML on it
728
729
src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
730
+* should display `defaultValue` of number 0
731
* only assigns defaultValue if it changes
732
+* should display "true" for `defaultValue` of `true`
733
+* should display "false" for `defaultValue` of `false`
734
+* should take `defaultValue` when changing to uncontrolled input
735
* should render defaultValue for SSR
736
* should render value for SSR
737
+* should render name attribute if it is supplied
738
* should render name attribute if it is supplied for SSR
739
* should not render name attribute if it is not supplied
740
* should not render name attribute if it is not supplied for SSR
741
+* should display "foobar" for `defaultValue` of `objToString`
742
+* should display `value` of number 0
743
+* should allow setting `value` to `true`
744
+* should allow setting `value` to `false`
745
+* should allow setting `value` to `objToString`
746
+* should not incur unnecessary DOM mutations
747
* should not set a value for submit buttons unnecessarily
696
-* should update defaultValue to empty string
748
+* should warn with value and no onChange handler and readOnly specified
749
+* should warn with checked and no onChange handler with readOnly specified
750
+* should warn if checked and defaultChecked props are specified
751
+* should warn if value and defaultValue props are specified
752
+* should warn if uncontrolled input (value is undefined) switches to controlled
753
+* should warn if uncontrolled checkbox (checked is undefined) switches to controlled
754
+* should warn if uncontrolled checkbox (checked is null) switches to controlled
755
+* should warn if uncontrolled radio (checked is undefined) switches to controlled
756
+* should warn if uncontrolled radio (checked is null) switches to controlled
757
* should not warn if radio value changes but never becomes controlled
758
* should not warn if radio value changes but never becomes uncontrolled
759
+* sets value properly with type coming later in props
760
+* does not raise a validation warning when it switches types
761
762
src/renderers/dom/shared/wrappers/__tests__/ReactDOMOption-test.js
763
* should flatten children to a string
764
+* should ignore and warn invalid children types
765
* should ignore null/undefined/false children without warning
766
* should be able to use dangerouslySetInnerHTML on option
767
+* should set attribute for empty value
768
769
src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js
770
* should not throw with `defaultValue` and without children
@@ -708,13 +772,27 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js
772
* should support server-side rendering
773
* should support server-side rendering with defaultValue
774
* should support server-side rendering with multiple
775
+* should warn if value and defaultValue props are specified
776
777
src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js
778
+* should allow setting `defaultValue`
779
+* should display `defaultValue` of number 0
780
+* should display "false" for `defaultValue` of `false`
781
+* should display "foobar" for `defaultValue` of `objToString`
782
* should not render value as an attribute
714
-* should update defaultValue to empty string
783
+* should display `value` of number 0
784
* should render defaultValue for SSR
785
* should render value for SSR
786
+* should take updates to `defaultValue` for uncontrolled textarea
787
+* should take updates to children in lieu of `defaultValue` for uncontrolled textarea
788
+* should treat children like `defaultValue`
789
+* should keep value when switching to uncontrolled element if not changed
790
+* should allow numbers as children
791
+* should allow booleans as children
792
+* should allow objects as children
793
+* should throw with multiple or invalid children
794
* should unmount
795
+* should warn if value and defaultValue are specified
796
797
src/renderers/dom/stack/client/__tests__/ReactDOM-test.js
798
* allows a DOM element to be used with a string
@@ -964,6 +1042,12 @@ src/renderers/shared/hooks/__tests__/ReactComponentTreeHook-test.native.js
1042
1043
src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js
1044
* gets ignored for composite roots that return null
1045
+* gets recorded during an update
1046
+* gets ignored if the styles are shallowly equal
1047
+* gets recorded during an update
1048
+* gets recorded as a removal during an update
1049
+* gets recorded during an update
1050
+* gets recorded during an update
1051
* gets ignored if new text is equal
1052
* gets ignored if new text is equal
1053
* gets ignored if the type has not changed
@@ -983,6 +1067,9 @@ src/renderers/shared/shared/__tests__/ReactTreeTraversal-test.js
1067
* should leave to the window from the shallowest
1068
* should determine the first common ancestor correctly
1069
1070
+src/renderers/shared/shared/event/__tests__/EventPluginHub-test.js
1071
+* should prevent non-function listeners, at dispatch
1072
+
1073
src/renderers/shared/shared/event/__tests__/EventPluginRegistry-test.js
1074
* should be able to inject ordering before plugins
1075
* should be able to inject plugins before and after ordering
@@ -1175,6 +1262,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildReconcile-test.js
1262
* should insert non-empty children in middle where nulls were
1263
1264
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
1265
+* should throw if rendering both HTML and children
1266
* should render between nested components and inline children
1267
1268
src/renderers/shared/stack/reconciler/__tests__/ReactStateSetters-test.js
@@ -1191,7 +1279,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactStatelessComponent-test.js
1279
* should unmount stateless component
1280
* should pass context thru stateless component
1281
* should provide a null ref
1194
-* should use correct name in key warning
1282
* should support default props and prop types
1283
* should receive context
1284
* should work with arrow functions
src/renderers/dom/fiber/ReactDOMFiber.js
+16
-31
@@ -17,9 +17,18 @@ import type { HostChildren } from 'ReactFiberReconciler';
17
var ReactFiberReconciler = require('ReactFiberReconciler');
18
var ReactDOMComponentTree = require('ReactDOMComponentTree');
19
var ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
20
+var ReactDOMFiberComponent = require('ReactDOMFiberComponent');
21
+var ReactDOMInjection = require('ReactDOMInjection');
22
+
23
+ReactDOMInjection.inject();
24
25
var warning = require('warning');
26
27
+var {
28
+ createElement,
29
+ setInitialProperties,
30
+ updateProperties,
31
+} = ReactDOMFiberComponent;
32
var { precacheFiberNode } = ReactDOMComponentTree;
33
34
type DOMContainerElement = Element & { _reactRootContainer: ?Object };
@@ -60,24 +69,12 @@ var DOMRenderer = ReactFiberReconciler({
69
children : HostChildren<Instance | TextInstance>,
70
internalInstanceHandle : Object
71
) : Instance {
63
- const domElement : Instance = document.createElement(type);
72
+ const root = document.body; // HACK
73
+
74
+ const domElement : Instance = createElement(type, props, root);
75
precacheFiberNode(internalInstanceHandle, domElement);
76
recursivelyAppendChildren(domElement, children);
66
- if (typeof props.className !== 'undefined') {
67
- domElement.className = props.className;
68
- }
69
- if (typeof props.children === 'string') {
70
- domElement.textContent = props.children;
71
- } else if (typeof props.children === 'number') {
72
- domElement.textContent = props.children.toString();
73
- } else if (typeof props.dangerouslySetInnerHTML === 'object' &&
74
- props.dangerouslySetInnerHTML !== null &&
75
- typeof props.dangerouslySetInnerHTML.__html === 'string') {
76
- domElement.innerHTML = props.dangerouslySetInnerHTML.__html;
77
- }
78
- if (typeof props.id === 'string') {
79
- domElement.id = props.id;
80
- }
77
+ setInitialProperties(domElement, type, props, root);
78
return domElement;
79
},
80
@@ -90,21 +87,9 @@ var DOMRenderer = ReactFiberReconciler({
87
},
88
89
commitUpdate(domElement : Instance, oldProps : Props, newProps : Props) : void {
93
- if (typeof newProps.className !== 'undefined') {
94
- domElement.className = newProps.className;
95
- }
96
- if (typeof newProps.children === 'string') {
97
- domElement.textContent = newProps.children;
98
- } else if (typeof newProps.children === 'number') {
99
- domElement.textContent = newProps.children.toString();
100
- } else if (typeof newProps.dangerouslySetInnerHTML === 'object' &&
101
- newProps.dangerouslySetInnerHTML !== null &&
102
- typeof newProps.dangerouslySetInnerHTML.__html === 'string') {
103
- domElement.innerHTML = newProps.dangerouslySetInnerHTML.__html;
104
- }
105
- if (typeof newProps.id === 'string') {
106
- domElement.id = newProps.id;
107
- }
90
+ var type = domElement.tagName.toLowerCase(); // HACK
91
+ var root = document.body; // HACK
92
+ updateProperties(domElement, type, oldProps, newProps, root);
93
},
94
95
createTextInstance(text : string, internalInstanceHandle : Object) : TextInstance {
src/renderers/dom/fiber/ReactDOMFiberComponent.js
+15
-9
@@ -33,7 +33,7 @@ var invariant = require('invariant');
33
var isEventSupported = require('isEventSupported');
34
var setInnerHTML = require('setInnerHTML');
35
var setTextContent = require('setTextContent');
36
-var inputValueTracking = require('inputValueTracking');
36
+// var inputValueTracking = require('inputValueTracking');
37
var warning = require('warning');
38
var didWarnShadyDOM = false;
39
@@ -434,10 +434,19 @@ function updateDOMProperties(
434
}
435
}
436
if (styleUpdates) {
437
+ var componentPlaceholder = null;
438
+ if (__DEV__) {
439
+ // HACK
440
+ var internalInstance = ReactDOMComponentTree.getInstanceFromNode(domElement);
441
+ componentPlaceholder = {
442
+ _currentElement: { type: internalInstance.type, props: internalInstance.memoizedProps },
443
+ _debugID: internalInstance._debugID,
444
+ };
445
+ }
446
CSSPropertyOperations.setValueForStyles(
447
domElement,
448
styleUpdates,
440
- null // TODO: Change CSSPropertyOperations to use getCurrentOwnerName.
449
+ componentPlaceholder // TODO: Change CSSPropertyOperations to use getCurrentOwnerName.
450
);
451
}
452
}
@@ -453,11 +462,10 @@ var ReactDOMFiberComponent = {
462
createElement: function(
463
tag : string,
464
props : Object,
456
- rootContainerElement : Element,
457
- internalInstanceHandle : Object
465
+ rootContainerElement : Element
466
) : Element {
467
+ validateDangerousTag(tag);
468
// TODO:
460
- // validateDangerousTag(tag);
469
// tag.toLowerCase(); Do we need to apply lower case only on non-custom elements?
470
471
// We create tags in the namespace of their parent container, except HTML
@@ -503,8 +511,6 @@ var ReactDOMFiberComponent = {
511
);
512
}
513
506
- ReactDOMComponentTree.precacheFiberNode(internalInstanceHandle, domElement);
507
-
514
return domElement;
515
},
516
@@ -544,7 +550,7 @@ var ReactDOMFiberComponent = {
550
props = ReactDOMFiberInput.getHostProps(domElement, props);
551
// TODO: Make sure we check if this is still unmounted or do any clean
552
// up necessary since we never stop tracking anymore.
547
- inputValueTracking.track(domElement);
553
+ //inputValueTracking.track(domElement); // TODO
554
trapBubbledEventsLocal(domElement, tag);
555
// For controlled components we always need to ensure we're listening
556
// to onChange. Even if there is no listener.
@@ -565,7 +571,7 @@ var ReactDOMFiberComponent = {
571
case 'textarea':
572
ReactDOMFiberTextarea.mountWrapper(domElement, props);
573
props = ReactDOMFiberTextarea.getHostProps(domElement, props);
568
- inputValueTracking.track(domElement); // TODO
574
+ //inputValueTracking.track(domElement); // TODO
575
trapBubbledEventsLocal(domElement, tag);
576
// For controlled components we always need to ensure we're listening
577
// to onChange. Even if there is no listener.
src/renderers/shared/fiber/ReactFiber.js
+9
-1
@@ -143,6 +143,10 @@ export type Fiber = {
143
144
};
145
146
+if (__DEV__) {
147
+ var debugCounter = 0;
148
+}
149
+
150
// This is a constructor of a POJO instead of a constructor function for a few
151
// reasons:
152
// 1) Nobody should add any instance methods on this. Instance methods can be
@@ -157,7 +161,7 @@ export type Fiber = {
161
// 5) It should be easy to port this to a C struct and keep a C implementation
162
// compatible.
163
var createFiber = function(tag : TypeOfWork, key : null | string) : Fiber {
160
- return {
164
+ var fiber = {
165
166
// Instance
167
@@ -200,6 +204,10 @@ var createFiber = function(tag : TypeOfWork, key : null | string) : Fiber {
204
alternate: null,
205
206
};
207
+ if (__DEV__) {
208
+ (fiber : any)._debugID = debugCounter++;
209
+ }
210
+ return fiber;
211
};
212
213
function shouldConstruct(Component) {