Skip to content

Commit

Permalink
Remove useCreateElement flag (#9873)
Browse files Browse the repository at this point in the history
* Remove useCreateElement flag

* Use Circle node #3 for ESLint
  • Loading branch information
gaearon authored Jun 7, 2017
1 parent fc15d70 commit 34927ea
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 233 deletions.
3 changes: 1 addition & 2 deletions scripts/circleci/test_entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
fi

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

# These seem out of order but extract-errors must be run after jest.
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
COMMANDS_TO_RUN+=('node ./scripts/prettier/index')
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow')
COMMANDS_TO_RUN+=('node ./scripts/tasks/jest')
Expand Down
9 changes: 0 additions & 9 deletions scripts/circleci/test_html_generation.sh

This file was deleted.

183 changes: 67 additions & 116 deletions src/renderers/__tests__/ReactHostOperationHistoryHook-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ describeStack('ReactHostOperationHistoryHook', () => {
{
instanceID: inst._debugID,
type: 'mount',
payload: ReactDOMFeatureFlags.useCreateElement
? 'DIV'
: '<div data-reactroot="" data-reactid="1"><p data-reactid="2">Hi.</p></div>',
payload: 'DIV',
},
]);
});
Expand All @@ -76,10 +74,7 @@ describeStack('ReactHostOperationHistoryHook', () => {
{
instanceID: inst._debugID,
type: 'mount',
payload: ReactDOMFeatureFlags.useCreateElement
? 'DIV'
: '<div data-reactroot="" data-reactid="1">' +
'<p data-reactid="2">Hi.</p></div>',
payload: 'DIV',
},
]);
});
Expand Down Expand Up @@ -141,32 +136,21 @@ describeStack('ReactHostOperationHistoryHook', () => {
);

var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
if (ReactDOMFeatureFlags.useCreateElement) {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update styles',
payload: {
color: 'red',
backgroundColor: 'yellow',
},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
} else {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'mount',
payload: '<div style="color:red;background-color:yellow" ' +
'data-reactroot="" data-reactid="1"></div>',
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update styles',
payload: {
color: 'red',
backgroundColor: 'yellow',
},
]);
}
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
});

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

var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
if (ReactDOMFeatureFlags.useCreateElement) {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {className: 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {tabIndex: 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
} else {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'mount',
payload: '<div class="rad" tabindex="42" data-reactroot="" ' +
'data-reactid="1"></div>',
},
]);
}
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {className: 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {tabIndex: 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
});

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

var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
if (ReactDOMFeatureFlags.useCreateElement) {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {'data-x': 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {'data-y': 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
} else {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'mount',
payload: '<div data-x="rad" data-y="42" data-reactroot="" ' +
'data-reactid="1"></div>',
},
]);
}
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {'data-x': 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {'data-y': 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'DIV',
},
]);
});

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

var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
if (ReactDOMFeatureFlags.useCreateElement) {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {className: 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {tabIndex: 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'MY-COMPONENT',
},
]);
} else {
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'mount',
payload: '<my-component className="rad" tabIndex="42" ' +
'data-reactroot="" data-reactid="1"></my-component>',
},
]);
}
assertHistoryMatches([
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {className: 'rad'},
},
{
instanceID: inst._debugID,
type: 'update attribute',
payload: {tabIndex: 42},
},
{
instanceID: inst._debugID,
type: 'mount',
payload: 'MY-COMPONENT',
},
]);
});

it('gets recorded during an update', () => {
Expand Down
1 change: 0 additions & 1 deletion src/renderers/dom/shared/ReactDOMFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

var ReactDOMFeatureFlags = {
fiberAsyncScheduling: false,
useCreateElement: true,
useFiber: true,
};

Expand Down
Loading

0 comments on commit 34927ea

Please sign in to comment.