Skip to content

Commit 34927ea

Browse files
authored
Remove useCreateElement flag (#9873)
* Remove useCreateElement flag * Use Circle node #3 for ESLint
1 parent fc15d70 commit 34927ea

File tree

8 files changed

+141
-233
lines changed

8 files changed

+141
-233
lines changed

scripts/circleci/test_entry_point.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
1313
fi
1414

1515
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
16-
COMMANDS_TO_RUN+=('./scripts/circleci/test_html_generation.sh')
16+
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
1717
fi
1818

1919
# These seem out of order but extract-errors must be run after jest.
2020
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
21-
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
2221
COMMANDS_TO_RUN+=('node ./scripts/prettier/index')
2322
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow')
2423
COMMANDS_TO_RUN+=('node ./scripts/tasks/jest')

scripts/circleci/test_html_generation.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/renderers/__tests__/ReactHostOperationHistoryHook-test.js

Lines changed: 67 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ describeStack('ReactHostOperationHistoryHook', () => {
5555
{
5656
instanceID: inst._debugID,
5757
type: 'mount',
58-
payload: ReactDOMFeatureFlags.useCreateElement
59-
? 'DIV'
60-
: '<div data-reactroot="" data-reactid="1"><p data-reactid="2">Hi.</p></div>',
58+
payload: 'DIV',
6159
},
6260
]);
6361
});
@@ -76,10 +74,7 @@ describeStack('ReactHostOperationHistoryHook', () => {
7674
{
7775
instanceID: inst._debugID,
7876
type: 'mount',
79-
payload: ReactDOMFeatureFlags.useCreateElement
80-
? 'DIV'
81-
: '<div data-reactroot="" data-reactid="1">' +
82-
'<p data-reactid="2">Hi.</p></div>',
77+
payload: 'DIV',
8378
},
8479
]);
8580
});
@@ -141,32 +136,21 @@ describeStack('ReactHostOperationHistoryHook', () => {
141136
);
142137

143138
var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
144-
if (ReactDOMFeatureFlags.useCreateElement) {
145-
assertHistoryMatches([
146-
{
147-
instanceID: inst._debugID,
148-
type: 'update styles',
149-
payload: {
150-
color: 'red',
151-
backgroundColor: 'yellow',
152-
},
153-
},
154-
{
155-
instanceID: inst._debugID,
156-
type: 'mount',
157-
payload: 'DIV',
158-
},
159-
]);
160-
} else {
161-
assertHistoryMatches([
162-
{
163-
instanceID: inst._debugID,
164-
type: 'mount',
165-
payload: '<div style="color:red;background-color:yellow" ' +
166-
'data-reactroot="" data-reactid="1"></div>',
139+
assertHistoryMatches([
140+
{
141+
instanceID: inst._debugID,
142+
type: 'update styles',
143+
payload: {
144+
color: 'red',
145+
backgroundColor: 'yellow',
167146
},
168-
]);
169-
}
147+
},
148+
{
149+
instanceID: inst._debugID,
150+
type: 'mount',
151+
payload: 'DIV',
152+
},
153+
]);
170154
});
171155

172156
it('gets recorded during an update', () => {
@@ -259,34 +243,23 @@ describeStack('ReactHostOperationHistoryHook', () => {
259243
ReactDOM.render(<div className="rad" tabIndex={42} />, node);
260244

261245
var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
262-
if (ReactDOMFeatureFlags.useCreateElement) {
263-
assertHistoryMatches([
264-
{
265-
instanceID: inst._debugID,
266-
type: 'update attribute',
267-
payload: {className: 'rad'},
268-
},
269-
{
270-
instanceID: inst._debugID,
271-
type: 'update attribute',
272-
payload: {tabIndex: 42},
273-
},
274-
{
275-
instanceID: inst._debugID,
276-
type: 'mount',
277-
payload: 'DIV',
278-
},
279-
]);
280-
} else {
281-
assertHistoryMatches([
282-
{
283-
instanceID: inst._debugID,
284-
type: 'mount',
285-
payload: '<div class="rad" tabindex="42" data-reactroot="" ' +
286-
'data-reactid="1"></div>',
287-
},
288-
]);
289-
}
246+
assertHistoryMatches([
247+
{
248+
instanceID: inst._debugID,
249+
type: 'update attribute',
250+
payload: {className: 'rad'},
251+
},
252+
{
253+
instanceID: inst._debugID,
254+
type: 'update attribute',
255+
payload: {tabIndex: 42},
256+
},
257+
{
258+
instanceID: inst._debugID,
259+
type: 'mount',
260+
payload: 'DIV',
261+
},
262+
]);
290263
});
291264

292265
it('gets recorded during an update', () => {
@@ -362,34 +335,23 @@ describeStack('ReactHostOperationHistoryHook', () => {
362335
ReactDOM.render(<div data-x="rad" data-y={42} />, node);
363336

364337
var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
365-
if (ReactDOMFeatureFlags.useCreateElement) {
366-
assertHistoryMatches([
367-
{
368-
instanceID: inst._debugID,
369-
type: 'update attribute',
370-
payload: {'data-x': 'rad'},
371-
},
372-
{
373-
instanceID: inst._debugID,
374-
type: 'update attribute',
375-
payload: {'data-y': 42},
376-
},
377-
{
378-
instanceID: inst._debugID,
379-
type: 'mount',
380-
payload: 'DIV',
381-
},
382-
]);
383-
} else {
384-
assertHistoryMatches([
385-
{
386-
instanceID: inst._debugID,
387-
type: 'mount',
388-
payload: '<div data-x="rad" data-y="42" data-reactroot="" ' +
389-
'data-reactid="1"></div>',
390-
},
391-
]);
392-
}
338+
assertHistoryMatches([
339+
{
340+
instanceID: inst._debugID,
341+
type: 'update attribute',
342+
payload: {'data-x': 'rad'},
343+
},
344+
{
345+
instanceID: inst._debugID,
346+
type: 'update attribute',
347+
payload: {'data-y': 42},
348+
},
349+
{
350+
instanceID: inst._debugID,
351+
type: 'mount',
352+
payload: 'DIV',
353+
},
354+
]);
393355
});
394356

395357
it('gets recorded during an update', () => {
@@ -440,34 +402,23 @@ describeStack('ReactHostOperationHistoryHook', () => {
440402
ReactDOM.render(<my-component className="rad" tabIndex={42} />, node);
441403

442404
var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
443-
if (ReactDOMFeatureFlags.useCreateElement) {
444-
assertHistoryMatches([
445-
{
446-
instanceID: inst._debugID,
447-
type: 'update attribute',
448-
payload: {className: 'rad'},
449-
},
450-
{
451-
instanceID: inst._debugID,
452-
type: 'update attribute',
453-
payload: {tabIndex: 42},
454-
},
455-
{
456-
instanceID: inst._debugID,
457-
type: 'mount',
458-
payload: 'MY-COMPONENT',
459-
},
460-
]);
461-
} else {
462-
assertHistoryMatches([
463-
{
464-
instanceID: inst._debugID,
465-
type: 'mount',
466-
payload: '<my-component className="rad" tabIndex="42" ' +
467-
'data-reactroot="" data-reactid="1"></my-component>',
468-
},
469-
]);
470-
}
405+
assertHistoryMatches([
406+
{
407+
instanceID: inst._debugID,
408+
type: 'update attribute',
409+
payload: {className: 'rad'},
410+
},
411+
{
412+
instanceID: inst._debugID,
413+
type: 'update attribute',
414+
payload: {tabIndex: 42},
415+
},
416+
{
417+
instanceID: inst._debugID,
418+
type: 'mount',
419+
payload: 'MY-COMPONENT',
420+
},
421+
]);
471422
});
472423

473424
it('gets recorded during an update', () => {

src/renderers/dom/shared/ReactDOMFeatureFlags.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
var ReactDOMFeatureFlags = {
1515
fiberAsyncScheduling: false,
16-
useCreateElement: true,
1716
useFiber: true,
1817
};
1918

0 commit comments

Comments
 (0)