From cb4d89da4c74206830e9c142f2ac236ada6f4f58 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 29 Jun 2018 21:59:53 +0100 Subject: [PATCH 01/22] Split React test into multiple files --- package.json | 4 +- scripts/__snapshots__/test-react.js.snap | 20163 ---------------- scripts/prettier.js | 3 + scripts/test-react.js | 1163 - test/react/ClassComponents-test.js | 68 + .../array-from.js | 0 .../array-from2.js | 0 .../classes-with-state.js | 0 .../complex-class-into-functional-root.js | 0 .../complex-class-into-functional-root2.js | 0 .../complex-class-into-functional-root3.js | 0 .../complex-class-into-functional-root4.js | 0 .../complex-class-into-functional-root5.js | 0 .../inheritance-chain.js | 0 .../simple-classes-2.js | 0 .../simple-classes-3.js | 0 .../simple-classes.js | 0 .../simple.js | 0 test/react/FBMocks-test.js | 141 + test/react/{mocks => FBMocks}/fb1.js | 0 test/react/{mocks => FBMocks}/fb10.js | 0 test/react/{mocks => FBMocks}/fb11.js | 0 test/react/{mocks => FBMocks}/fb12.js | 0 test/react/{mocks => FBMocks}/fb13.js | 0 test/react/{mocks => FBMocks}/fb14.js | 0 test/react/{mocks => FBMocks}/fb15.js | 0 test/react/{mocks => FBMocks}/fb16.js | 0 test/react/{mocks => FBMocks}/fb17.js | 0 test/react/{mocks => FBMocks}/fb18.js | 0 test/react/{mocks => FBMocks}/fb19.js | 0 test/react/{mocks => FBMocks}/fb2.js | 0 test/react/{mocks => FBMocks}/fb20.js | 0 test/react/{mocks => FBMocks}/fb21.js | 0 test/react/{mocks => FBMocks}/fb22.js | 0 test/react/{mocks => FBMocks}/fb23.js | 0 test/react/{mocks => FBMocks}/fb3.js | 0 test/react/{mocks => FBMocks}/fb4.js | 0 test/react/{mocks => FBMocks}/fb5.js | 0 test/react/{mocks => FBMocks}/fb6.js | 0 test/react/{mocks => FBMocks}/fb7.js | 0 test/react/{mocks => FBMocks}/fb8.js | 0 test/react/{mocks => FBMocks}/fb9.js | 0 .../react/{mocks => FBMocks}/function-bind.js | 0 test/react/{mocks => FBMocks}/hacker-news.js | 0 .../react/{mocks => FBMocks}/hacker-news.json | 0 test/react/{mocks => FBMocks}/repl-example.js | 0 test/react/FactoryComponents-test.js | 24 + .../simple.js | 0 .../simple2.js | 0 test/react/FirstRenderOnly-test.js | 95 + .../get-derived-state-from-props.js | 0 .../get-derived-state-from-props2.js | 0 .../get-derived-state-from-props3.js | 0 .../get-derived-state-from-props4.js | 0 .../get-derived-state-from-props5.js | 0 .../react-context.js | 0 .../react-context2.js | 0 .../react-context3.js | 0 .../react-context4.js | 0 .../react-context5.js | 0 .../react-context6.js | 0 .../replace-this-in-callbacks.js | 0 .../replace-this-in-callbacks2.js | 0 .../replace-this-in-callbacks3.js | 0 .../simple-2.js | 0 .../simple-3.js | 0 .../simple-4.js | 0 .../simple.js | 0 .../will-mount.js | 0 test/react/FunctionalComponents-test.js | 530 + .../additional-function-regression.js | 0 .../array-from.js | 0 .../array-map.js | 0 .../array-map2.js | 0 .../array-twice.js | 0 .../circular-reference.js | 0 .../class-root-with-instance-vars-2.js | 0 .../class-root-with-instance-vars.js | 0 .../class-root-with-props.js | 0 .../class-root-with-refs.js | 2 +- .../class-root-with-render-methods.js | 0 .../class-root-with-state.js | 0 .../class-root.js | 0 .../clone-element.js | 0 .../conditional.js | 0 .../default-props.js | 0 .../delete-element-prop-key.js | 0 .../do-not-optimize.js | 0 .../dynamic-context.js | 0 .../dynamic-props.js | 0 .../dynamic-type.js | 0 .../dynamic-type2.js | 0 .../dynamic-type3.js | 0 .../dynamic-type4.js | 0 .../equivalence.js | 0 .../event-handlers.js | 0 .../key-change-fragments.js | 0 .../key-change.js | 0 .../key-nesting-2.js | 0 .../key-nesting-3.js | 0 .../key-nesting.js | 0 .../key-not-change-fragments.js | 0 .../lazy-branched-elements.js | 0 .../lazy-branched-elements2.js | 0 .../nested-array-children.js | 0 .../not-safe.js | 0 .../not-safe2.js | 0 .../not-safe3.js | 0 .../null-or-undefined-props.js | 0 .../react-element-havoc.js | 0 .../refs.js | 0 .../refs2.js | 0 .../refs3.js | 0 .../return-text.js | 0 .../return-undefined.js | 0 .../runtime-error.js | 0 .../safe.js | 0 .../safe2.js | 0 .../safe3.js | 0 .../safe4.js | 0 .../simple-10.js | 0 .../simple-11.js | 0 .../simple-12.js | 0 .../simple-13.js | 0 .../simple-14.js | 0 .../simple-15.js | 0 .../simple-16.js | 0 .../simple-17.js | 0 .../simple-18.js | 0 .../simple-19.js | 0 .../simple-2.js | 0 .../simple-20.js | 0 .../simple-21.js | 0 .../simple-3.js | 0 .../simple-4.js | 0 .../simple-5.js | 0 .../simple-6.js | 0 .../simple-7.js | 0 .../simple-8.js | 0 .../simple-9.js | 0 .../simple-assign.js | 0 .../simple-assign2.js | 0 .../simple-assign3.js | 0 .../simple-assign4.js | 0 .../simple-assign5.js | 0 .../simple-children.js | 0 .../simple-fragments.js | 0 .../simple-refs.js | 0 .../simple-with-abstract-props.js | 0 .../simple-with-jsx-spread.js | 0 .../simple-with-jsx-spread10.js | 0 .../simple-with-jsx-spread11.js | 0 .../simple-with-jsx-spread12.js | 0 .../simple-with-jsx-spread13.js | 0 .../simple-with-jsx-spread2.js | 0 .../simple-with-jsx-spread3.js | 0 .../simple-with-jsx-spread4.js | 0 .../simple-with-jsx-spread5.js | 0 .../simple-with-jsx-spread6.js | 0 .../simple-with-jsx-spread7.js | 0 .../simple-with-jsx-spread8.js | 0 .../simple-with-jsx-spread9.js | 0 .../simple-with-new-expression.js | 0 .../simple-with-unary.js | 0 .../simple.js | 0 .../two-roots.js | 0 .../type-change.js | 0 .../type-change10.js | 0 .../type-change11.js | 0 .../type-change2.js | 0 .../type-change3.js | 0 .../type-change4.js | 0 .../type-change5.js | 0 .../type-change6.js | 0 .../type-change7.js | 0 .../type-change8.js | 0 .../type-change9.js | 0 .../type-same.js | 0 .../unsafe-spread.js | 0 test/react/ReactDOM-test.js | 20 + .../{react-dom => ReactDOM}/create-portal.js | 0 test/react/RenderProps-test.js | 72 + .../react-context.js | 0 .../react-context2.js | 0 .../react-context3.js | 0 .../react-context4.js | 0 .../react-context5.js | 0 .../react-context6.js | 0 .../react-context7.js | 0 .../react-root-context.js | 0 .../react-root-context2.js | 0 .../react-root-context3.js | 0 .../react-root-context4.js | 0 .../relay-query-renderer.js | 0 .../relay-query-renderer2.js | 0 .../relay-query-renderer3.js | 0 test/react/ServerRendering-test.js | 22 + .../hacker-news.js | 0 .../hacker-news.json | 0 .../ClassComponents-test.js.snap | 1465 ++ test/react/__snapshots__/FBMocks-test.js.snap | 2691 +++ .../FactoryComponents-test.js.snap | 165 + .../FirstRenderOnly-test.js.snap | 2693 +++ .../FunctionalComponents-test.js.snap | 10464 ++++++++ .../react/__snapshots__/ReactDOM-test.js.snap | 153 + .../__snapshots__/RenderProps-test.js.snap | 2305 ++ .../ServerRendering-test.js.snap | 41 + test/react/prepareReactTests.js | 286 + 208 files changed, 21241 insertions(+), 21329 deletions(-) delete mode 100644 scripts/__snapshots__/test-react.js.snap delete mode 100644 scripts/test-react.js create mode 100644 test/react/ClassComponents-test.js rename test/react/{class-components => ClassComponents}/array-from.js (100%) rename test/react/{class-components => ClassComponents}/array-from2.js (100%) rename test/react/{class-components => ClassComponents}/classes-with-state.js (100%) rename test/react/{class-components => ClassComponents}/complex-class-into-functional-root.js (100%) rename test/react/{class-components => ClassComponents}/complex-class-into-functional-root2.js (100%) rename test/react/{class-components => ClassComponents}/complex-class-into-functional-root3.js (100%) rename test/react/{class-components => ClassComponents}/complex-class-into-functional-root4.js (100%) rename test/react/{class-components => ClassComponents}/complex-class-into-functional-root5.js (100%) rename test/react/{class-components => ClassComponents}/inheritance-chain.js (100%) rename test/react/{class-components => ClassComponents}/simple-classes-2.js (100%) rename test/react/{class-components => ClassComponents}/simple-classes-3.js (100%) rename test/react/{class-components => ClassComponents}/simple-classes.js (100%) rename test/react/{class-components => ClassComponents}/simple.js (100%) create mode 100644 test/react/FBMocks-test.js rename test/react/{mocks => FBMocks}/fb1.js (100%) rename test/react/{mocks => FBMocks}/fb10.js (100%) rename test/react/{mocks => FBMocks}/fb11.js (100%) rename test/react/{mocks => FBMocks}/fb12.js (100%) rename test/react/{mocks => FBMocks}/fb13.js (100%) rename test/react/{mocks => FBMocks}/fb14.js (100%) rename test/react/{mocks => FBMocks}/fb15.js (100%) rename test/react/{mocks => FBMocks}/fb16.js (100%) rename test/react/{mocks => FBMocks}/fb17.js (100%) rename test/react/{mocks => FBMocks}/fb18.js (100%) rename test/react/{mocks => FBMocks}/fb19.js (100%) rename test/react/{mocks => FBMocks}/fb2.js (100%) rename test/react/{mocks => FBMocks}/fb20.js (100%) rename test/react/{mocks => FBMocks}/fb21.js (100%) rename test/react/{mocks => FBMocks}/fb22.js (100%) rename test/react/{mocks => FBMocks}/fb23.js (100%) rename test/react/{mocks => FBMocks}/fb3.js (100%) rename test/react/{mocks => FBMocks}/fb4.js (100%) rename test/react/{mocks => FBMocks}/fb5.js (100%) rename test/react/{mocks => FBMocks}/fb6.js (100%) rename test/react/{mocks => FBMocks}/fb7.js (100%) rename test/react/{mocks => FBMocks}/fb8.js (100%) rename test/react/{mocks => FBMocks}/fb9.js (100%) rename test/react/{mocks => FBMocks}/function-bind.js (100%) rename test/react/{mocks => FBMocks}/hacker-news.js (100%) rename test/react/{mocks => FBMocks}/hacker-news.json (100%) rename test/react/{mocks => FBMocks}/repl-example.js (100%) create mode 100644 test/react/FactoryComponents-test.js rename test/react/{factory-components => FactoryComponents}/simple.js (100%) rename test/react/{factory-components => FactoryComponents}/simple2.js (100%) create mode 100644 test/react/FirstRenderOnly-test.js rename test/react/{first-render-only => FirstRenderOnly}/get-derived-state-from-props.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/get-derived-state-from-props2.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/get-derived-state-from-props3.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/get-derived-state-from-props4.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/get-derived-state-from-props5.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context2.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context3.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context4.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context5.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/react-context6.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/replace-this-in-callbacks.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/replace-this-in-callbacks2.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/replace-this-in-callbacks3.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/simple-2.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/simple-3.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/simple-4.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/simple.js (100%) rename test/react/{first-render-only => FirstRenderOnly}/will-mount.js (100%) create mode 100644 test/react/FunctionalComponents-test.js rename test/react/{functional-components => FunctionalComponents}/additional-function-regression.js (100%) rename test/react/{functional-components => FunctionalComponents}/array-from.js (100%) rename test/react/{functional-components => FunctionalComponents}/array-map.js (100%) rename test/react/{functional-components => FunctionalComponents}/array-map2.js (100%) rename test/react/{functional-components => FunctionalComponents}/array-twice.js (100%) rename test/react/{functional-components => FunctionalComponents}/circular-reference.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-instance-vars-2.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-instance-vars.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-props.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-refs.js (98%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-render-methods.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root-with-state.js (100%) rename test/react/{functional-components => FunctionalComponents}/class-root.js (100%) rename test/react/{functional-components => FunctionalComponents}/clone-element.js (100%) rename test/react/{functional-components => FunctionalComponents}/conditional.js (100%) rename test/react/{functional-components => FunctionalComponents}/default-props.js (100%) rename test/react/{functional-components => FunctionalComponents}/delete-element-prop-key.js (100%) rename test/react/{functional-components => FunctionalComponents}/do-not-optimize.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-context.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-props.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-type.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-type2.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-type3.js (100%) rename test/react/{functional-components => FunctionalComponents}/dynamic-type4.js (100%) rename test/react/{functional-components => FunctionalComponents}/equivalence.js (100%) rename test/react/{functional-components => FunctionalComponents}/event-handlers.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-change-fragments.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-change.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-nesting-2.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-nesting-3.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-nesting.js (100%) rename test/react/{functional-components => FunctionalComponents}/key-not-change-fragments.js (100%) rename test/react/{functional-components => FunctionalComponents}/lazy-branched-elements.js (100%) rename test/react/{functional-components => FunctionalComponents}/lazy-branched-elements2.js (100%) rename test/react/{functional-components => FunctionalComponents}/nested-array-children.js (100%) rename test/react/{functional-components => FunctionalComponents}/not-safe.js (100%) rename test/react/{functional-components => FunctionalComponents}/not-safe2.js (100%) rename test/react/{functional-components => FunctionalComponents}/not-safe3.js (100%) rename test/react/{functional-components => FunctionalComponents}/null-or-undefined-props.js (100%) rename test/react/{functional-components => FunctionalComponents}/react-element-havoc.js (100%) rename test/react/{functional-components => FunctionalComponents}/refs.js (100%) rename test/react/{functional-components => FunctionalComponents}/refs2.js (100%) rename test/react/{functional-components => FunctionalComponents}/refs3.js (100%) rename test/react/{functional-components => FunctionalComponents}/return-text.js (100%) rename test/react/{functional-components => FunctionalComponents}/return-undefined.js (100%) rename test/react/{functional-components => FunctionalComponents}/runtime-error.js (100%) rename test/react/{functional-components => FunctionalComponents}/safe.js (100%) rename test/react/{functional-components => FunctionalComponents}/safe2.js (100%) rename test/react/{functional-components => FunctionalComponents}/safe3.js (100%) rename test/react/{functional-components => FunctionalComponents}/safe4.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-10.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-11.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-12.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-13.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-14.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-15.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-16.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-17.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-18.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-19.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-2.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-20.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-21.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-3.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-4.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-5.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-6.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-7.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-8.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-9.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-assign.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-assign2.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-assign3.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-assign4.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-assign5.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-children.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-fragments.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-refs.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-abstract-props.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread10.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread11.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread12.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread13.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread2.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread3.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread4.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread5.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread6.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread7.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread8.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-jsx-spread9.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-new-expression.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple-with-unary.js (100%) rename test/react/{functional-components => FunctionalComponents}/simple.js (100%) rename test/react/{functional-components => FunctionalComponents}/two-roots.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change10.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change11.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change2.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change3.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change4.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change5.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change6.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change7.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change8.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-change9.js (100%) rename test/react/{functional-components => FunctionalComponents}/type-same.js (100%) rename test/react/{functional-components => FunctionalComponents}/unsafe-spread.js (100%) create mode 100644 test/react/ReactDOM-test.js rename test/react/{react-dom => ReactDOM}/create-portal.js (100%) create mode 100644 test/react/RenderProps-test.js rename test/react/{render-props => RenderProps}/react-context.js (100%) rename test/react/{render-props => RenderProps}/react-context2.js (100%) rename test/react/{render-props => RenderProps}/react-context3.js (100%) rename test/react/{render-props => RenderProps}/react-context4.js (100%) rename test/react/{render-props => RenderProps}/react-context5.js (100%) rename test/react/{render-props => RenderProps}/react-context6.js (100%) rename test/react/{render-props => RenderProps}/react-context7.js (100%) rename test/react/{render-props => RenderProps}/react-root-context.js (100%) rename test/react/{render-props => RenderProps}/react-root-context2.js (100%) rename test/react/{render-props => RenderProps}/react-root-context3.js (100%) rename test/react/{render-props => RenderProps}/react-root-context4.js (100%) rename test/react/{render-props => RenderProps}/relay-query-renderer.js (100%) rename test/react/{render-props => RenderProps}/relay-query-renderer2.js (100%) rename test/react/{render-props => RenderProps}/relay-query-renderer3.js (100%) create mode 100644 test/react/ServerRendering-test.js rename test/react/{server-rendering => ServerRendering}/hacker-news.js (100%) rename test/react/{server-rendering => ServerRendering}/hacker-news.json (100%) create mode 100644 test/react/__snapshots__/ClassComponents-test.js.snap create mode 100644 test/react/__snapshots__/FBMocks-test.js.snap create mode 100644 test/react/__snapshots__/FactoryComponents-test.js.snap create mode 100644 test/react/__snapshots__/FirstRenderOnly-test.js.snap create mode 100644 test/react/__snapshots__/FunctionalComponents-test.js.snap create mode 100644 test/react/__snapshots__/ReactDOM-test.js.snap create mode 100644 test/react/__snapshots__/RenderProps-test.js.snap create mode 100644 test/react/__snapshots__/ServerRendering-test.js.snap create mode 100644 test/react/prepareReactTests.js diff --git a/package.json b/package.json index d32c955e34..9ddf1b721a 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "test-error-handler-with-coverage": "./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -o coverage-sourcemapped.error -t html", "test-node-cli-mode": "bash < scripts/test-node-cli-mode.sh", "test-std-in": "bash < scripts/test-std-in.sh", - "test-react": "jest scripts/test-react", + "test-react": "jest test/react", "test": "yarn test-residual && yarn test-serializer && yarn test-sourcemaps && yarn test-error-handler && yarn test-std-in && yarn test-test262 && yarn test-internal && yarn test-internal-react && yarn test-react", "test-coverage-most": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/remap-istanbul -i coverage.most/coverage.json -o coverage-sourcemapped -t html", "test-all-coverage": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/test262-runner.js --timeout 50 --singleThreaded && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -i coverage.most/coverage.json -o coverage-sourcemapped -t html", @@ -127,7 +127,7 @@ "author": "Facebook", "jest": { "testMatch": [ - "**/scripts/test-react.js" + "**/test/react/*-test.js" ] } } diff --git a/scripts/__snapshots__/test-react.js.snap b/scripts/__snapshots__/test-react.js.snap deleted file mode 100644 index 98d092a67b..0000000000 --- a/scripts/__snapshots__/test-react.js.snap +++ /dev/null @@ -1,20163 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test React with JSX input, JSX output Class component folding Classes with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Complex class components folding into functional root component #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Complex class components folding into functional root component #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Complex class components folding into functional root component #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 12, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Complex class components folding into functional root component #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Complex class components folding into functional root component 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Inheritance chaining 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple classes #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple classes #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple classes with Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Class component folding Simple classes with Array.from 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Factory class component folding Simple factory classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "FactoryComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Factory class component folding Simple factory classes 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Replace this in callbacks 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Replace this in callbacks 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Replace this in callbacks 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Simple #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Simple #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Simple #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only componentWillMount 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only getDerivedStateFromProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only getDerivedStateFromProps 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only getDerivedStateFromProps 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only getDerivedStateFromProps 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output First render only getDerivedStateFromProps 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding __reactCompilerDoNotOptimize 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding 16.3 refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding 16.3 refs 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding 16.3 refs 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Additional functions closure scope capturing 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Circular reference 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with instance variables #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with instance variables 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with multiple render methods 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Class component as root with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type change 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Component type same 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Conditional 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Delete element prop key 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic ReactElement type #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic ReactElement type #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic ReactElement type #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic ReactElement type 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic context 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Dynamic props 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Equivalence 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Event handlers 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Handle mapped arrays 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Handle mapped arrays 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Handle mapped arrays from Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Havocing of ReactElements should not result in property assignments 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key change 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key change with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key nesting 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key nesting 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key nesting 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Key not changing with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Lazy branched elements 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Lazy branched elements 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - not-safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - safe 1 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Mutations - safe 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Null or undefined props 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding React.cloneElement 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "Override", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Render array twice 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Render nested array children 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Return text 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Return undefined 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "undefined was returned from render", - "name": "A", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 3, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Author", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 15 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 16 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 18 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 19 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple children 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with Object.assign #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with Object.assign #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with Object.assign #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with Object.assign #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with Object.assign 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with abstract props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #8 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #9 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #10 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #11 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads #13 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with multiple JSX spreads 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with new expression 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Simple with unary expressions 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Two roots 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output Functional component folding Unsafe spread 1`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; - -exports[`Test React with JSX input, JSX output Functional component folding defaultProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context from root tree 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 5, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context from root tree 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context from root tree 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props React Context from root tree 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props Relay QueryRenderer 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props Relay QueryRenderer 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output Render props Relay QueryRenderer 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SomeClassThatShouldNotMakeRootAClass", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks Function bind 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "HeaderBar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "Story", - "status": "INLINED", - }, - ], - "message": "", - "name": "StoryList", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "AppBody", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Hello", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 9, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 13, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 9, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 13 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Inner", - "status": "INLINED", - }, - ], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "Outer", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 22 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks fb-www 23 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output fb-www mocks repl example 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Foo", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output react-dom createPortal 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "ReactDOM.createPortal", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, JSX output react-dom server rendering Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Classes with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Complex class components folding into functional root component #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Complex class components folding into functional root component #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Complex class components folding into functional root component #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 12, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Complex class components folding into functional root component #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Complex class components folding into functional root component 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Inheritance chaining 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple classes #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple classes #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple classes with Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Class component folding Simple classes with Array.from 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Factory class component folding Simple factory classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "FactoryComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Factory class component folding Simple factory classes 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Replace this in callbacks 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Replace this in callbacks 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Replace this in callbacks 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Simple #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Simple #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Simple #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only componentWillMount 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only getDerivedStateFromProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only getDerivedStateFromProps 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only getDerivedStateFromProps 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only getDerivedStateFromProps 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output First render only getDerivedStateFromProps 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding __reactCompilerDoNotOptimize 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding 16.3 refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding 16.3 refs 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding 16.3 refs 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Additional functions closure scope capturing 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Circular reference 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with instance variables #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with instance variables 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with multiple render methods 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Class component as root with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type change 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Component type same 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Conditional 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Delete element prop key 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic ReactElement type #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic ReactElement type #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic ReactElement type #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic ReactElement type 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic context 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Dynamic props 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Equivalence 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Event handlers 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Handle mapped arrays 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Handle mapped arrays 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Handle mapped arrays from Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Havocing of ReactElements should not result in property assignments 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key change 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key change with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key nesting 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key nesting 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key nesting 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Key not changing with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Lazy branched elements 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Lazy branched elements 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - not-safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - safe 1 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Mutations - safe 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Null or undefined props 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding React.cloneElement 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "Override", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Render array twice 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Render nested array children 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Return text 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Return undefined 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "undefined was returned from render", - "name": "A", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 3, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Author", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 15 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 16 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 18 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 19 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple children 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with Object.assign #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with Object.assign #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with Object.assign #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with Object.assign #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with Object.assign 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with abstract props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #8 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #9 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #10 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #11 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads #13 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with multiple JSX spreads 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with new expression 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Simple with unary expressions 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Two roots 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output Functional component folding Unsafe spread 1`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; - -exports[`Test React with JSX input, create-element output Functional component folding defaultProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context from root tree 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 5, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context from root tree 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context from root tree 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props React Context from root tree 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props Relay QueryRenderer 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props Relay QueryRenderer 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output Render props Relay QueryRenderer 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SomeClassThatShouldNotMakeRootAClass", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks Function bind 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "HeaderBar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "Story", - "status": "INLINED", - }, - ], - "message": "", - "name": "StoryList", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "AppBody", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Hello", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 9, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 13, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 9, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 13 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Inner", - "status": "INLINED", - }, - ], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "Outer", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 22 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks fb-www 23 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output fb-www mocks repl example 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Foo", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output react-dom createPortal 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "ReactDOM.createPortal", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with JSX input, create-element output react-dom server rendering Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Classes with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Complex class components folding into functional root component #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Complex class components folding into functional root component #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Complex class components folding into functional root component #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 12, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Complex class components folding into functional root component #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Complex class components folding into functional root component 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Inheritance chaining 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple classes #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple classes #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple classes with Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Class component folding Simple classes with Array.from 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Factory class component folding Simple factory classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "FactoryComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Factory class component folding Simple factory classes 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Replace this in callbacks 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Replace this in callbacks 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Replace this in callbacks 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Simple #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Simple #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Simple #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only componentWillMount 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only getDerivedStateFromProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only getDerivedStateFromProps 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only getDerivedStateFromProps 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only getDerivedStateFromProps 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output First render only getDerivedStateFromProps 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding __reactCompilerDoNotOptimize 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding 16.3 refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding 16.3 refs 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding 16.3 refs 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Additional functions closure scope capturing 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Circular reference 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with instance variables #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with instance variables 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with multiple render methods 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Class component as root with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type change 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Component type same 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Conditional 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Delete element prop key 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic ReactElement type #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic ReactElement type #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic ReactElement type #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic ReactElement type 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic context 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Dynamic props 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Equivalence 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Event handlers 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Handle mapped arrays 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Handle mapped arrays 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Handle mapped arrays from Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Havocing of ReactElements should not result in property assignments 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key change 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key change with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key nesting 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key nesting 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key nesting 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Key not changing with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Lazy branched elements 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Lazy branched elements 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - not-safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - safe 1 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Mutations - safe 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Null or undefined props 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding React.cloneElement 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "Override", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Render array twice 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Render nested array children 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Return text 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Return undefined 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "undefined was returned from render", - "name": "A", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 3, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Author", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 15 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 16 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 18 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 19 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple children 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with Object.assign #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with Object.assign #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with Object.assign #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with Object.assign #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with Object.assign 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with abstract props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #8 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #9 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #10 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #11 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads #13 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with multiple JSX spreads 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with new expression 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Simple with unary expressions 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Two roots 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding Unsafe spread 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Functional component folding defaultProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context from root tree 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 5, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context from root tree 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context from root tree 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props React Context from root tree 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props Relay QueryRenderer 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props Relay QueryRenderer 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output Render props Relay QueryRenderer 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SomeClassThatShouldNotMakeRootAClass", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks Function bind 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "HeaderBar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "Story", - "status": "INLINED", - }, - ], - "message": "", - "name": "StoryList", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "AppBody", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Hello", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 9, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 13, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 9, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 13 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Inner", - "status": "INLINED", - }, - ], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "Outer", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 22 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks fb-www 23 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output fb-www mocks repl example 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Foo", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output react-dom createPortal 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "ReactDOM.createPortal", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, JSX output react-dom server rendering Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Classes with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Complex class components folding into functional root component #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Complex class components folding into functional root component #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Complex class components folding into functional root component #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 12, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Complex class components folding into functional root component #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Complex class components folding into functional root component 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Inheritance chaining 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple classes #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple classes #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple classes with Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Class component folding Simple classes with Array.from 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Factory class component folding Simple factory classes 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "FactoryComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Factory class component folding Simple factory classes 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Replace this in callbacks 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Replace this in callbacks 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Replace this in callbacks 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Simple #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Simple #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Simple #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only componentWillMount 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only getDerivedStateFromProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only getDerivedStateFromProps 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only getDerivedStateFromProps 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only getDerivedStateFromProps 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child3", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child1", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output First render only getDerivedStateFromProps 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding __reactCompilerDoNotOptimize 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding 16.3 refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding 16.3 refs 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding 16.3 refs 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "", - "status": "FORWARD_REF", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Additional functions closure scope capturing 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Circular reference 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with instance variables #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with instance variables 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with multiple render methods 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Class component as root with state 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type change 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Component type same 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Conditional 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Delete element prop key 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic ReactElement type #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic ReactElement type #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic ReactElement type #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic ReactElement type 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic context 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Dynamic props 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Equivalence 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Event handlers 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Handle mapped arrays 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Handle mapped arrays 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Handle mapped arrays from Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Havocing of ReactElements should not result in property assignments 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key change 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key change with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key nesting 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key nesting 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key nesting 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Key not changing with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Lazy branched elements 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Lazy branched elements 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - not-safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - safe 1 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - safe 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Mutations - safe 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Null or undefined props 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding React.cloneElement 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "Override", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Render array twice 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Render nested array children 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Return text 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Return undefined 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "undefined was returned from render", - "name": "A", - "status": "BAIL-OUT", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 3, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Author", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 15 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 16 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 18 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 19 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple children 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple refs 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with Object.assign #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with Object.assign #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with Object.assign #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with Object.assign #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with Object.assign 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with abstract props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #8 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #9 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #10 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #11 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads #13 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with multiple JSX spreads 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with new expression 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Simple with unary expressions 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Two roots 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "ROOT", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding Unsafe spread 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Functional component folding defaultProps 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context from root tree 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 5, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context from root tree 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context from root tree 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props React Context from root tree 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "NORMAL", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props Relay QueryRenderer 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props Relay QueryRenderer 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output Render props Relay QueryRenderer 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SomeClassThatShouldNotMakeRootAClass", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks Function bind 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "HeaderBar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "Story", - "status": "INLINED", - }, - ], - "message": "", - "name": "StoryList", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "AppBody", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 4, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "Hello", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 3 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 4 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 6 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 8 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 9 1`] = ` -ReactStatistics { - "componentsEvaluated": 9, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 13, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - ], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 9, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 13 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 14 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "RelayContainer", - "name": "WrappedApp", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 17 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Inner", - "status": "INLINED", - }, - ], - "message": "", - "name": "Middle", - "status": "INLINED", - }, - ], - "message": "", - "name": "Outer", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 20 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 21 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 22 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "React.Fragment", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks fb-www 23 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output fb-www mocks repl example 1`] = ` -ReactStatistics { - "componentsEvaluated": 7, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Yar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "Foo", - "status": "ROOT", - }, - ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output react-dom createPortal 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "ReactDOM.createPortal", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Test React with create-element input, create-element output react-dom server rendering Hacker News app 1`] = ` -ReactStatistics { - "componentsEvaluated": 0, - "evaluatedRootNodes": Array [], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 0, -} -`; diff --git a/scripts/prettier.js b/scripts/prettier.js index f5eec72c4e..b128a45053 100644 --- a/scripts/prettier.js +++ b/scripts/prettier.js @@ -35,6 +35,9 @@ const config = { scripts: { patterns: ["scripts/**/*.js"], }, + jest: { + patterns: ["test/react/**/*-test.js"], + }, }; function exec(command, args, options = {}) { diff --git a/scripts/test-react.js b/scripts/test-react.js deleted file mode 100644 index 2addf0d81f..0000000000 --- a/scripts/test-react.js +++ /dev/null @@ -1,1163 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/* @flow */ - -let fs = require("fs"); -let path = require("path"); -let { prepackSources } = require("../lib/prepack-node.js"); -let babel = require("babel-core"); -let React = require("react"); -let ReactDOM = require("react-dom"); -let ReactDOMServer = require("react-dom/server"); -let PropTypes = require("prop-types"); -let ReactRelay = require("react-relay"); -let ReactTestRenderer = require("react-test-renderer"); -let { mergeAdjacentJSONTextNodes } = require("../lib/utils/json.js"); -/* eslint-disable no-undef */ -let { expect, describe, it } = global; - -function cxShim(...args) { - let classNames = []; - for (let arg of args) { - if (typeof arg === "string") { - classNames.push(arg); - } else if (typeof arg === "object" && arg !== null) { - let keys = Object.keys(arg); - for (let key of keys) { - if (arg[key]) { - classNames.push(key); - } - } - } - } - return classNames.join(" "); -} - -// assign for tests that use the cx() global -global.cx = cxShim; - -function getDataFile(directory, name) { - let reactTestRoot = path.join(__dirname, "../test/react/"); - let data = fs.readFileSync(path.join(reactTestRoot, directory, name)).toString(); - return data; -} - -function MockURI(url) { - this.url = url; -} - -MockURI.prototype.addQueryData = function() { - this.url += "&queryData"; - return this; -}; - -MockURI.prototype.makeString = function() { - return this.url; -}; - -function runTestSuite(outputJsx, shouldTranspileSource) { - let checkForReconcilerFatalError = false; - let checkForPartialKeyOrRefError = false; - let errorsCaptured = []; - let reactTestRoot = path.join(__dirname, "../test/react/"); - let prepackOptions = { - errorHandler: diag => { - errorsCaptured.push(diag); - if (diag.severity !== "Warning" && diag.severity !== "Information") { - if (diag.errorCode === "PP0025" && !checkForPartialKeyOrRefError) { - // recover from `unable to evaluate "key" and "ref" on a ReactElement - return "Recover"; - } - return "Fail"; - } - return "Recover"; - }, - compatibility: "fb-www", - internalDebug: true, - serialize: true, - uniqueSuffix: "", - maxStackDepth: 100, - instantRender: false, - reactEnabled: true, - reactOutput: outputJsx ? "jsx" : "create-element", - reactOptimizeNestedFunctions: true, - inlineExpressions: true, - invariantLevel: 0, - stripFlow: true, - }; - - async function expectReconcilerFatalError(func) { - checkForReconcilerFatalError = true; - try { - await func(); - } catch (e) { - expect(e.__isReconcilerFatalError).toBe(true); - expect(e.message).toMatchSnapshot(); - } finally { - checkForReconcilerFatalError = false; - } - } - - async function expectPartialKeyOrRefError(func) { - checkForPartialKeyOrRefError = true; - try { - await func(); - } catch (e) { - expect(e.__isReconcilerFatalError).toBe(true); - expect(e.message).toMatchSnapshot(); - } finally { - checkForPartialKeyOrRefError = false; - } - } - - function compileSourceWithPrepack(source) { - let code = `(function(){${source}})()`; - let serialized; - errorsCaptured = []; - try { - serialized = prepackSources([{ filePath: "", fileContents: code, sourceMapContents: "" }], prepackOptions); - } catch (e) { - if (e.__isReconcilerFatalError && (checkForReconcilerFatalError || checkForPartialKeyOrRefError)) { - throw e; - } - errorsCaptured.forEach(error => { - console.error(error); - }); - throw e; - } - if (serialized == null || serialized.reactStatistics == null) { - throw new Error("React test runner failed during serialization"); - } - return { - compiledSource: serialized.code, - statistics: serialized.reactStatistics, - }; - } - - function transpileSource(source) { - return babel.transform(source, { - presets: ["babel-preset-react"], - plugins: ["transform-object-rest-spread"], - }).code; - } - - function runSource(source) { - let transformedSource = transpileSource(source); - /* eslint-disable no-new-func */ - let fn = new Function("require", "module", transformedSource); - let moduleShim = { exports: null }; - let requireShim = name => { - switch (name) { - case "React": - case "react": - return React; - case "react-dom": - case "ReactDOM": - return ReactDOM; - case "react-dom/server": - case "ReactDOMServer": - return ReactDOMServer; - case "PropTypes": - case "prop-types": - return PropTypes; - case "RelayModern": - return ReactRelay; - case "cx": - return cxShim; - case "FBEnvironment": - return {}; - case "URI": - return MockURI; - default: - throw new Error(`Unrecognized import: "${name}".`); - } - }; - try { - // $FlowFixMe flow doesn't new Function - fn(requireShim, moduleShim); - } catch (e) { - console.error(transformedSource); - throw e; - } - return moduleShim.exports; - } - - async function runTest(directory, name, firstRenderOnly = false, data) { - let source = fs.readFileSync(path.join(reactTestRoot, directory, name)).toString(); - if (shouldTranspileSource) { - source = transpileSource(source); - } - let { compiledSource, statistics } = compileSourceWithPrepack(source); - - expect(statistics).toMatchSnapshot(); - let A = runSource(source); - let B = runSource(compiledSource); - - expect(typeof A).toBe(typeof B); - if (typeof A !== "function") { - // Test without exports just verifies that the file compiles. - return; - } - - let config = { - createNodeMock(x) { - return x; - }, - }; - let rendererA = ReactTestRenderer.create(null, config); - let rendererB = ReactTestRenderer.create(null, config); - if (A == null || B == null) { - throw new Error("React test runner issue"); - } - // Use the original version of the test in case transforming messes it up. - let { getTrials: getTrialsA, independent } = A; - let { getTrials: getTrialsB } = B; - // Run tests that assert the rendered output matches. - let resultA = getTrialsA(rendererA, A, data); - let resultB = independent ? getTrialsB(rendererB, B, data) : getTrialsA(rendererB, B, data); - - // The test has returned many values for us to check - for (let i = 0; i < resultA.length; i++) { - let [nameA, valueA] = resultA[i]; - let [nameB, valueB] = resultB[i]; - if (typeof valueA === "string" && typeof valueB === "string") { - expect(valueA).toBe(valueB); - } else { - expect(mergeAdjacentJSONTextNodes(valueB, firstRenderOnly)).toEqual( - mergeAdjacentJSONTextNodes(valueA, firstRenderOnly) - ); - } - expect(nameB).toEqual(nameA); - } - } - - async function stubReactRelay(f) { - let oldReactRelay = ReactRelay; - ReactRelay = { - QueryRenderer(props) { - return props.render({ props: {}, error: null }); - }, - createFragmentContainer() { - return null; - }, - graphql() { - return null; - }, - }; - try { - await f(); - } finally { - ReactRelay = oldReactRelay; - } - } - - // Jest tests - let originalConsoleError = global.console.error; - // we don't want React's errors printed, it's too much noise - let excludeErrorsContaining = [ - "Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null", - "Consider adding an error boundary to your tree to customize error handling behavior.", - "Warning:", - ]; - global.console.error = function(...args) { - let text = args[0]; - - if (typeof text === "string") { - for (let excludeError of excludeErrorsContaining) { - if (text.indexOf(excludeError) !== -1) { - return; - } - } - } - originalConsoleError.apply(this, args); - }; - - describe(`Test React with ${shouldTranspileSource ? "create-element input" : "JSX input"}, ${ - outputJsx ? "JSX output" : "create-element output" - }`, () => { - describe("Functional component folding", () => { - let directory = "functional-components"; - - it("Simple", async () => { - await runTest(directory, "simple.js"); - }); - - it("Simple 2", async () => { - await runTest(directory, "simple-2.js"); - }); - - it("Simple 3", async () => { - await runTest(directory, "simple-3.js"); - }); - - it("Simple 4", async () => { - await runTest(directory, "simple-4.js"); - }); - - it("Simple 5", async () => { - await runTest(directory, "simple-5.js"); - }); - - it("Simple 6", async () => { - await runTest(directory, "simple-6.js"); - }); - - it("Simple 7", async () => { - await runTest(directory, "simple-7.js"); - }); - - it("Simple 8", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "simple-8.js"); - }); - }); - - it("Simple 9", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "simple-9.js"); - }); - }); - - it("Simple 10", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "simple-10.js"); - }); - }); - - it("Simple 11", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "simple-11.js"); - }); - }); - - it("Simple 12", async () => { - await runTest(directory, "simple-12.js"); - }); - - // this should intentionally fail - it("Runtime error", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "runtime-error.js"); - }); - }); - - it("Simple 13", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "simple-13.js"); - }); - }); - - it("Simple 14", async () => { - await runTest(directory, "simple-14.js"); - }); - - it("Simple 15", async () => { - await runTest(directory, "simple-15.js"); - }); - - it("Simple 16", async () => { - await runTest(directory, "simple-16.js"); - }); - - it("Simple 17", async () => { - await runTest(directory, "simple-17.js"); - }); - - it("Simple 18", async () => { - await runTest(directory, "simple-18.js"); - }); - - it("Simple 19", async () => { - await runTest(directory, "simple-19.js"); - }); - - it("Simple 20", async () => { - await runTest(directory, "simple-20.js"); - }); - - it("Simple 21", async () => { - await runTest(directory, "simple-21.js"); - }); - - it("Two roots", async () => { - await runTest(directory, "two-roots.js"); - }); - - it("Havocing of ReactElements should not result in property assignments", async () => { - await runTest(directory, "react-element-havoc.js"); - }); - - it("__reactCompilerDoNotOptimize", async () => { - await runTest(directory, "do-not-optimize.js"); - }); - - it("Mutations - not-safe 1", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "not-safe.js"); - }); - }); - - it("Mutations - not-safe 2", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "not-safe2.js"); - }); - }); - - it("Mutations - not-safe 3", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "not-safe3.js"); - }); - }); - - it("Mutations - safe 1", async () => { - await runTest(directory, "safe.js"); - }); - - it("Mutations - safe 2", async () => { - await runTest(directory, "safe2.js"); - }); - - it("Mutations - safe 3", async () => { - await runTest(directory, "safe3.js"); - }); - - it("Handle mapped arrays", async () => { - await runTest(directory, "array-map.js"); - }); - - it("Handle mapped arrays 2", async () => { - await runTest(directory, "array-map2.js"); - }); - - it("Handle mapped arrays from Array.from", async () => { - await runTest(directory, "array-from.js"); - }); - - it("Simple fragments", async () => { - await runTest(directory, "simple-fragments.js"); - }); - - it("Simple children", async () => { - await runTest(directory, "simple-children.js"); - }); - - it("Simple with new expression", async () => { - await runTest(directory, "simple-with-new-expression.js"); - }); - - it("Simple refs", async () => { - await runTest(directory, "simple-refs.js"); - }); - - it("16.3 refs", async () => { - await runTest(directory, "refs.js"); - }); - - it("16.3 refs 2", async () => { - await runTest(directory, "refs2.js"); - }); - - it("16.3 refs 3", async () => { - await runTest(directory, "refs3.js"); - }); - - it("defaultProps", async () => { - await runTest(directory, "default-props.js"); - }); - - it("Unsafe spread", async () => { - await expectPartialKeyOrRefError(async () => { - await runTest(directory, "unsafe-spread.js"); - }); - }); - - it("Simple with abstract props", async () => { - await runTest(directory, "simple-with-abstract-props.js"); - }); - - it("Simple with unary expressions", async () => { - await runTest(directory, "simple-with-unary.js"); - }); - - it("Simple with multiple JSX spreads", async () => { - await runTest(directory, "simple-with-jsx-spread.js"); - }); - - it("Simple with multiple JSX spreads #2", async () => { - await runTest(directory, "simple-with-jsx-spread2.js"); - }); - - it("Simple with multiple JSX spreads #3", async () => { - await runTest(directory, "simple-with-jsx-spread3.js"); - }); - - it("Simple with multiple JSX spreads #4", async () => { - await runTest(directory, "simple-with-jsx-spread4.js"); - }); - - it("Simple with multiple JSX spreads #5", async () => { - await runTest(directory, "simple-with-jsx-spread5.js"); - }); - - it("Simple with multiple JSX spreads #6", async () => { - await runTest(directory, "simple-with-jsx-spread6.js"); - }); - - it("Simple with multiple JSX spreads #7", async () => { - await runTest(directory, "simple-with-jsx-spread7.js"); - }); - - it("Simple with multiple JSX spreads #8", async () => { - await runTest(directory, "simple-with-jsx-spread8.js"); - }); - - it("Simple with multiple JSX spreads #9", async () => { - await runTest(directory, "simple-with-jsx-spread9.js"); - }); - - it("Simple with multiple JSX spreads #10", async () => { - await runTest(directory, "simple-with-jsx-spread10.js"); - }); - - it("Simple with multiple JSX spreads #11", async () => { - await runTest(directory, "simple-with-jsx-spread11.js"); - }); - - it("Simple with multiple JSX spreads #12", async () => { - await runTest(directory, "simple-with-jsx-spread12.js"); - }); - - it("Simple with multiple JSX spreads #13", async () => { - await runTest(directory, "simple-with-jsx-spread13.js"); - }); - - it("Simple with Object.assign", async () => { - await runTest(directory, "simple-assign.js"); - }); - - it("Simple with Object.assign #2", async () => { - await runTest(directory, "simple-assign2.js"); - }); - - it("Simple with Object.assign #3", async () => { - await runTest(directory, "simple-assign3.js"); - }); - - it("Simple with Object.assign #4", async () => { - await runTest(directory, "simple-assign4.js"); - }); - - it("Simple with Object.assign #5", async () => { - await runTest(directory, "simple-assign5.js"); - }); - - it("Circular reference", async () => { - await runTest(directory, "circular-reference.js"); - }); - - it("Conditional", async () => { - await runTest(directory, "conditional.js"); - }); - - it("Key nesting", async () => { - await runTest(directory, "key-nesting.js"); - }); - - it("Key nesting 2", async () => { - await runTest(directory, "key-nesting-2.js"); - }); - - it("Key nesting 3", async () => { - await runTest(directory, "key-nesting-3.js"); - }); - - it("Key change", async () => { - await runTest(directory, "key-change.js"); - }); - - it("Equivalence", async () => { - let createElement = React.createElement; - let count = 0; - // For this test we want to also check how React.createElement - // calls occur so we can validate that we are correctly using - // lazy branched elements. To do this, we override the createElement - // call and increment a counter for ever call. - - // $FlowFixMe: intentional for this test - React.createElement = (type, config) => { - count++; - return createElement(type, config); - }; - try { - await runTest(directory, "equivalence.js"); - } finally { - // $FlowFixMe: intentional for this test - React.createElement = createElement; - } - // The non-compiled version has 20 calls, the compiled should have 8 calls - expect(count).toEqual(28); - }); - - it("Delete element prop key", async () => { - await runTest(directory, "delete-element-prop-key.js"); - }); - - it("Key change with fragments", async () => { - await runTest(directory, "key-change-fragments.js"); - }); - - it("Key not changing with fragments", async () => { - await runTest(directory, "key-not-change-fragments.js"); - }); - - it("Component type change", async () => { - await runTest(directory, "type-change.js"); - }); - - it("Component type change 2", async () => { - await runTest(directory, "type-change2.js"); - }); - - it("Component type change 3", async () => { - await runTest(directory, "type-change3.js"); - }); - - it("Component type change 4", async () => { - await runTest(directory, "type-change4.js"); - }); - - it("Component type change 5", async () => { - await runTest(directory, "type-change5.js"); - }); - - it("Component type change 6", async () => { - await runTest(directory, "type-change6.js"); - }); - - it("Component type change 7", async () => { - await runTest(directory, "type-change7.js"); - }); - - it("Component type change 8", async () => { - await runTest(directory, "type-change8.js"); - }); - - it("Component type change 9", async () => { - await runTest(directory, "type-change9.js"); - }); - - it("Component type change 10", async () => { - await runTest(directory, "type-change10.js"); - }); - - it("Component type change 11", async () => { - await runTest(directory, "type-change11.js"); - }); - - it("Component type same", async () => { - await runTest(directory, "type-same.js"); - }); - - it("Dynamic props", async () => { - await runTest(directory, "dynamic-props.js"); - }); - - it("Dynamic context", async () => { - await runTest(directory, "dynamic-context.js"); - }); - - it("React.cloneElement", async () => { - await runTest(directory, "clone-element.js"); - }); - - it("Return text", async () => { - await runTest(directory, "return-text.js"); - }); - - it("Render array twice", async () => { - await runTest(directory, "array-twice.js"); - }); - - it("Render nested array children", async () => { - await runTest(directory, "nested-array-children.js"); - }); - - it("Return undefined", async () => { - await runTest(directory, "return-undefined.js"); - }); - - it("Null or undefined props", async () => { - await runTest(directory, "null-or-undefined-props.js"); - }); - - it("Event handlers", async () => { - await runTest(directory, "event-handlers.js"); - }); - - it("Class component as root", async () => { - await runTest(directory, "class-root.js"); - }); - - it("Class component as root with multiple render methods", async () => { - await runTest(directory, "class-root-with-render-methods.js"); - }); - - it("Class component as root with props", async () => { - await runTest(directory, "class-root-with-props.js"); - }); - - it("Class component as root with state", async () => { - await runTest(directory, "class-root-with-state.js"); - }); - - it("Class component as root with refs", async () => { - await runTest(directory, "class-root-with-refs.js"); - }); - - it("Class component as root with instance variables", async () => { - await runTest(directory, "class-root-with-instance-vars.js"); - }); - - it("Class component as root with instance variables #2", async () => { - await runTest(directory, "class-root-with-instance-vars-2.js"); - }); - - it("Additional functions closure scope capturing", async () => { - await runTest(directory, "additional-function-regression.js"); - }); - - it("Dynamic ReactElement type", async () => { - await runTest(directory, "dynamic-type.js"); - }); - - it("Dynamic ReactElement type #2", async () => { - await runTest(directory, "dynamic-type2.js"); - }); - - it("Dynamic ReactElement type #3", async () => { - await runTest(directory, "dynamic-type3.js"); - }); - - it("Dynamic ReactElement type #4", async () => { - await runTest(directory, "dynamic-type4.js"); - }); - - it("Lazy branched elements", async () => { - let createElement = React.createElement; - let count = 0; - // For this test we want to also check how React.createElement - // calls occur so we can validate that we are correctly using - // lazy branched elements. To do this, we override the createElement - // call and increment a counter for ever call. - - // $FlowFixMe: intentional for this test - React.createElement = (type, config) => { - count++; - return createElement(type, config); - }; - try { - await runTest(directory, "lazy-branched-elements.js"); - } finally { - // $FlowFixMe: intentional for this test - React.createElement = createElement; - } - // The non-compiled version has 4 calls, the compiled should have 4 calls - expect(count).toEqual(8); - }); - - it("Lazy branched elements 2", async () => { - let createElement = React.createElement; - let count = 0; - // For this test we want to also check how React.createElement - // calls occur so we can validate that we are correctly using - // lazy branched elements. To do this, we override the createElement - // call and increment a counter for ever call. - - // $FlowFixMe: intentional for this test - React.createElement = (type, config) => { - count++; - return createElement(type, config); - }; - try { - await runTest(directory, "lazy-branched-elements2.js"); - } finally { - // $FlowFixMe: intentional for this test - React.createElement = createElement; - } - // The non-compiled version has 4 calls, the compiled should have 3 calls - // (3 because one of the calls has been removing by inlining) - expect(count).toEqual(7); - }); - }); - - describe("Class component folding", () => { - let directory = "class-components"; - - it("Simple", async () => { - await runTest(directory, "simple.js"); - }); - - it("Simple classes", async () => { - await runTest(directory, "simple-classes.js"); - }); - - it("Simple classes #2", async () => { - await runTest(directory, "simple-classes-2.js"); - }); - - it("Simple classes #3", async () => { - await runTest(directory, "simple-classes-3.js"); - }); - - it("Simple classes with Array.from", async () => { - await runTest(directory, "array-from.js"); - }); - - it("Simple classes with Array.from 2", async () => { - await runTest(directory, "array-from2.js"); - }); - - it("Inheritance chaining", async () => { - await runTest(directory, "inheritance-chain.js"); - }); - - it("Classes with state", async () => { - await runTest(directory, "classes-with-state.js"); - }); - - it("Complex class components folding into functional root component", async () => { - await runTest(directory, "complex-class-into-functional-root.js"); - }); - - it("Complex class components folding into functional root component #2", async () => { - await runTest(directory, "complex-class-into-functional-root2.js"); - }); - - it("Complex class components folding into functional root component #3", async () => { - await runTest(directory, "complex-class-into-functional-root3.js"); - }); - - it("Complex class components folding into functional root component #4", async () => { - await runTest(directory, "complex-class-into-functional-root4.js"); - }); - - it("Complex class components folding into functional root component #5", async () => { - await runTest(directory, "complex-class-into-functional-root5.js"); - }); - }); - - describe("Factory class component folding", () => { - let directory = "factory-components"; - - it("Simple factory classes", async () => { - await runTest(directory, "simple.js"); - }); - - it("Simple factory classes 2", async () => { - await runTest(directory, "simple2.js"); - }); - }); - - describe("Render props", () => { - let directory = "render-props"; - - it("Relay QueryRenderer", async () => { - await runTest(directory, "relay-query-renderer.js"); - }); - - it("Relay QueryRenderer 2", async () => { - await runTest(directory, "relay-query-renderer2.js"); - }); - - it("Relay QueryRenderer 3", async () => { - await runTest(directory, "relay-query-renderer3.js"); - }); - - it("React Context", async () => { - await runTest(directory, "react-context.js"); - }); - - it("React Context 2", async () => { - await runTest(directory, "react-context2.js"); - }); - - it("React Context 3", async () => { - await runTest(directory, "react-context3.js"); - }); - - it("React Context 4", async () => { - await runTest(directory, "react-context4.js"); - }); - - it("React Context 5", async () => { - await runTest(directory, "react-context5.js"); - }); - - it("React Context 6", async () => { - await runTest(directory, "react-context6.js"); - }); - - it("React Context 7", async () => { - await runTest(directory, "react-context7.js"); - }); - - it("React Context from root tree", async () => { - await runTest(directory, "react-root-context.js"); - }); - - it("React Context from root tree 2", async () => { - await runTest(directory, "react-root-context2.js"); - }); - - it("React Context from root tree 3", async () => { - await runTest(directory, "react-root-context3.js"); - }); - - it("React Context from root tree 4", async () => { - await runTest(directory, "react-root-context4.js"); - }); - }); - - describe("First render only", () => { - let directory = "first-render-only"; - - it("Simple", async () => { - await runTest(directory, "simple.js", true); - }); - - it("Simple #2", async () => { - await runTest(directory, "simple-2.js", true); - }); - - it("Simple #3", async () => { - await runTest(directory, "simple-3.js", true); - }); - - // Should be refined in a follow up PR to check for - // functions and keys on deep referenced objects linking - // to host components - it("Simple #4", async () => { - await runTest(directory, "simple-4.js", true); - }); - - it("componentWillMount", async () => { - await runTest(directory, "will-mount.js", true); - }); - - it("getDerivedStateFromProps", async () => { - await runTest(directory, "get-derived-state-from-props.js", true); - }); - - it("getDerivedStateFromProps 2", async () => { - await runTest(directory, "get-derived-state-from-props2.js", true); - }); - - it("getDerivedStateFromProps 3", async () => { - await runTest(directory, "get-derived-state-from-props3.js", true); - }); - - it("getDerivedStateFromProps 4", async () => { - await runTest(directory, "get-derived-state-from-props4.js", true); - }); - - it("getDerivedStateFromProps 5", async () => { - await runTest(directory, "get-derived-state-from-props5.js", true); - }); - - it("React Context", async () => { - await runTest(directory, "react-context.js"); - }); - - it("React Context 2", async () => { - await runTest(directory, "react-context2.js"); - }); - - it("React Context 3", async () => { - await runTest(directory, "react-context3.js"); - }); - - it("React Context 4", async () => { - await runTest(directory, "react-context4.js"); - }); - - it("React Context 5", async () => { - await runTest(directory, "react-context5.js"); - }); - - it("React Context 6", async () => { - await runTest(directory, "react-context6.js"); - }); - - it.skip("Replace this in callbacks", async () => { - await runTest(directory, "replace-this-in-callbacks.js"); - }); - - it("Replace this in callbacks 2", async () => { - await runTest(directory, "replace-this-in-callbacks2.js"); - }); - - it("Replace this in callbacks 3", async () => { - await runTest(directory, "replace-this-in-callbacks3.js"); - }); - }); - - describe("fb-www mocks", () => { - let directory = "mocks"; - - it("fb-www", async () => { - await stubReactRelay(async () => { - await runTest(directory, "fb1.js"); - }); - }); - - it("fb-www 2", async () => { - await runTest(directory, "fb2.js"); - }); - - it("fb-www 3", async () => { - await stubReactRelay(async () => { - await runTest(directory, "fb3.js"); - }); - }); - - it("fb-www 4", async () => { - await stubReactRelay(async () => { - await runTest(directory, "fb4.js"); - }); - }); - - it("fb-www 5", async () => { - await runTest(directory, "fb5.js"); - }); - - it("fb-www 6", async () => { - await runTest(directory, "fb6.js"); - }); - - it("fb-www 7", async () => { - await runTest(directory, "fb7.js"); - }); - - it("fb-www 8", async () => { - await runTest(directory, "fb8.js"); - }); - - it("fb-www 9", async () => { - await runTest(directory, "fb9.js"); - }); - - it("fb-www 10", async () => { - await runTest(directory, "fb10.js"); - }); - - it("fb-www 11", async () => { - await runTest(directory, "fb11.js"); - }); - - it("fb-www 12", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "fb12.js"); - }); - }); - - it("fb-www 13", async () => { - await runTest(directory, "fb13.js"); - }); - - it("fb-www 14", async () => { - await runTest(directory, "fb14.js"); - }); - - it("fb-www 15", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "fb15.js"); - }); - }); - - it("fb-www 16", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "fb16.js"); - }); - }); - - it("fb-www 17", async () => { - await runTest(directory, "fb17.js"); - }); - - // Test fails for two reasons: - // - "uri.foo" on abstract string does not exist - // - unused.bar() does not exist (even if in try/catch) - it("fb-www 18", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "fb18.js"); - }); - }); - - it("fb-www 19", async () => { - await expectReconcilerFatalError(async () => { - await runTest(directory, "fb19.js"); - }); - }); - - it("fb-www 20", async () => { - await runTest(directory, "fb20.js"); - }); - - it("fb-www 21", async () => { - await runTest(directory, "fb21.js"); - }); - - it("fb-www 22", async () => { - await runTest(directory, "fb22.js"); - }); - - it("fb-www 23", async () => { - await runTest(directory, "fb23.js"); - }); - - it("repl example", async () => { - await runTest(directory, "repl-example.js"); - }); - - it("Hacker News app", async () => { - let data = JSON.parse(getDataFile(directory, "hacker-news.json")); - await runTest(directory, "hacker-news.js", false, data); - }); - - it("Function bind", async () => { - await runTest(directory, "function-bind.js"); - }); - }); - - describe("react-dom server rendering", () => { - let directory = "server-rendering"; - - it("Hacker News app", async () => { - let data = JSON.parse(getDataFile(directory, "hacker-news.json")); - await runTest(directory, "hacker-news.js", false, data); - }); - }); - - describe("react-dom", () => { - let directory = "react-dom"; - - it("createPortal", async () => { - await runTest(directory, "create-portal.js", false); - }); - }); - }); -} - -// pre non-transpiled -runTestSuite(true, false); -runTestSuite(false, false); -// pre transpiled -runTestSuite(true, true); -runTestSuite(false, true); diff --git a/test/react/ClassComponents-test.js b/test/react/ClassComponents-test.js new file mode 100644 index 0000000000..f92b6ca7ac --- /dev/null +++ b/test/react/ClassComponents-test.js @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("Simple", async () => { + await runTest(__dirname + "/ClassComponents/simple.js"); +}); + +it("Simple classes", async () => { + await runTest(__dirname + "/ClassComponents/simple-classes.js"); +}); + +it("Simple classes #2", async () => { + await runTest(__dirname + "/ClassComponents/simple-classes-2.js"); +}); + +it("Simple classes #3", async () => { + await runTest(__dirname + "/ClassComponents/simple-classes-3.js"); +}); + +it("Simple classes with Array.from", async () => { + await runTest(__dirname + "/ClassComponents/array-from.js"); +}); + +it("Simple classes with Array.from 2", async () => { + await runTest(__dirname + "/ClassComponents/array-from2.js"); +}); + +it("Inheritance chaining", async () => { + await runTest(__dirname + "/ClassComponents/inheritance-chain.js"); +}); + +it("Classes with state", async () => { + await runTest(__dirname + "/ClassComponents/classes-with-state.js"); +}); + +it("Complex class components folding into functional root component", async () => { + await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root.js"); +}); + +it("Complex class components folding into functional root component #2", async () => { + await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root2.js"); +}); + +it("Complex class components folding into functional root component #3", async () => { + await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root3.js"); +}); + +it("Complex class components folding into functional root component #4", async () => { + await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root4.js"); +}); + +it("Complex class components folding into functional root component #5", async () => { + await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root5.js"); +}); diff --git a/test/react/class-components/array-from.js b/test/react/ClassComponents/array-from.js similarity index 100% rename from test/react/class-components/array-from.js rename to test/react/ClassComponents/array-from.js diff --git a/test/react/class-components/array-from2.js b/test/react/ClassComponents/array-from2.js similarity index 100% rename from test/react/class-components/array-from2.js rename to test/react/ClassComponents/array-from2.js diff --git a/test/react/class-components/classes-with-state.js b/test/react/ClassComponents/classes-with-state.js similarity index 100% rename from test/react/class-components/classes-with-state.js rename to test/react/ClassComponents/classes-with-state.js diff --git a/test/react/class-components/complex-class-into-functional-root.js b/test/react/ClassComponents/complex-class-into-functional-root.js similarity index 100% rename from test/react/class-components/complex-class-into-functional-root.js rename to test/react/ClassComponents/complex-class-into-functional-root.js diff --git a/test/react/class-components/complex-class-into-functional-root2.js b/test/react/ClassComponents/complex-class-into-functional-root2.js similarity index 100% rename from test/react/class-components/complex-class-into-functional-root2.js rename to test/react/ClassComponents/complex-class-into-functional-root2.js diff --git a/test/react/class-components/complex-class-into-functional-root3.js b/test/react/ClassComponents/complex-class-into-functional-root3.js similarity index 100% rename from test/react/class-components/complex-class-into-functional-root3.js rename to test/react/ClassComponents/complex-class-into-functional-root3.js diff --git a/test/react/class-components/complex-class-into-functional-root4.js b/test/react/ClassComponents/complex-class-into-functional-root4.js similarity index 100% rename from test/react/class-components/complex-class-into-functional-root4.js rename to test/react/ClassComponents/complex-class-into-functional-root4.js diff --git a/test/react/class-components/complex-class-into-functional-root5.js b/test/react/ClassComponents/complex-class-into-functional-root5.js similarity index 100% rename from test/react/class-components/complex-class-into-functional-root5.js rename to test/react/ClassComponents/complex-class-into-functional-root5.js diff --git a/test/react/class-components/inheritance-chain.js b/test/react/ClassComponents/inheritance-chain.js similarity index 100% rename from test/react/class-components/inheritance-chain.js rename to test/react/ClassComponents/inheritance-chain.js diff --git a/test/react/class-components/simple-classes-2.js b/test/react/ClassComponents/simple-classes-2.js similarity index 100% rename from test/react/class-components/simple-classes-2.js rename to test/react/ClassComponents/simple-classes-2.js diff --git a/test/react/class-components/simple-classes-3.js b/test/react/ClassComponents/simple-classes-3.js similarity index 100% rename from test/react/class-components/simple-classes-3.js rename to test/react/ClassComponents/simple-classes-3.js diff --git a/test/react/class-components/simple-classes.js b/test/react/ClassComponents/simple-classes.js similarity index 100% rename from test/react/class-components/simple-classes.js rename to test/react/ClassComponents/simple-classes.js diff --git a/test/react/class-components/simple.js b/test/react/ClassComponents/simple.js similarity index 100% rename from test/react/class-components/simple.js rename to test/react/ClassComponents/simple.js diff --git a/test/react/FBMocks-test.js b/test/react/FBMocks-test.js new file mode 100644 index 0000000000..f7bd7c717b --- /dev/null +++ b/test/react/FBMocks-test.js @@ -0,0 +1,141 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const fs = require("fs"); +const prepareReactTests = require("./prepareReactTests"); +const { runTest, expectReconcilerFatalError, stubReactRelay } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("fb-www", async () => { + await stubReactRelay(async () => { + await runTest(__dirname + "/FBMocks/fb1.js"); + }); +}); + +it("fb-www 2", async () => { + await runTest(__dirname + "/FBMocks/fb2.js"); +}); + +it("fb-www 3", async () => { + await stubReactRelay(async () => { + await runTest(__dirname + "/FBMocks/fb3.js"); + }); +}); + +it("fb-www 4", async () => { + await stubReactRelay(async () => { + await runTest(__dirname + "/FBMocks/fb4.js"); + }); +}); + +it("fb-www 5", async () => { + await runTest(__dirname + "/FBMocks/fb5.js"); +}); + +it("fb-www 6", async () => { + await runTest(__dirname + "/FBMocks/fb6.js"); +}); + +it("fb-www 7", async () => { + await runTest(__dirname + "/FBMocks/fb7.js"); +}); + +it("fb-www 8", async () => { + await runTest(__dirname + "/FBMocks/fb8.js"); +}); + +it("fb-www 9", async () => { + await runTest(__dirname + "/FBMocks/fb9.js"); +}); + +it("fb-www 10", async () => { + await runTest(__dirname + "/FBMocks/fb10.js"); +}); + +it("fb-www 11", async () => { + await runTest(__dirname + "/FBMocks/fb11.js"); +}); + +it("fb-www 12", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FBMocks/fb12.js"); + }); +}); + +it("fb-www 13", async () => { + await runTest(__dirname + "/FBMocks/fb13.js"); +}); + +it("fb-www 14", async () => { + await runTest(__dirname + "/FBMocks/fb14.js"); +}); + +it("fb-www 15", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FBMocks/fb15.js"); + }); +}); + +it("fb-www 16", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FBMocks/fb16.js"); + }); +}); + +it("fb-www 17", async () => { + await runTest(__dirname + "/FBMocks/fb17.js"); +}); + +// Test fails for two reasons: +// - "uri.foo" on abstract string does not exist +// - unused.bar() does not exist (even if in try/catch) +it("fb-www 18", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FBMocks/fb18.js"); + }); +}); + +it("fb-www 19", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FBMocks/fb19.js"); + }); +}); + +it("fb-www 20", async () => { + await runTest(__dirname + "/FBMocks/fb20.js"); +}); + +it("fb-www 21", async () => { + await runTest(__dirname + "/FBMocks/fb21.js"); +}); + +it("fb-www 22", async () => { + await runTest(__dirname + "/FBMocks/fb22.js"); +}); + +it("fb-www 23", async () => { + await runTest(__dirname + "/FBMocks/fb23.js"); +}); + +it("repl example", async () => { + await runTest(__dirname + "/FBMocks/repl-example.js"); +}); + +it("Hacker News app", async () => { + let data = JSON.parse(fs.readFileSync(__dirname + "/FBMocks/hacker-news.json").toString()); + await runTest(__dirname + "/FBMocks/hacker-news.js", false, data); +}); + +it("Function bind", async () => { + await runTest(__dirname + "/FBMocks/function-bind.js"); +}); diff --git a/test/react/mocks/fb1.js b/test/react/FBMocks/fb1.js similarity index 100% rename from test/react/mocks/fb1.js rename to test/react/FBMocks/fb1.js diff --git a/test/react/mocks/fb10.js b/test/react/FBMocks/fb10.js similarity index 100% rename from test/react/mocks/fb10.js rename to test/react/FBMocks/fb10.js diff --git a/test/react/mocks/fb11.js b/test/react/FBMocks/fb11.js similarity index 100% rename from test/react/mocks/fb11.js rename to test/react/FBMocks/fb11.js diff --git a/test/react/mocks/fb12.js b/test/react/FBMocks/fb12.js similarity index 100% rename from test/react/mocks/fb12.js rename to test/react/FBMocks/fb12.js diff --git a/test/react/mocks/fb13.js b/test/react/FBMocks/fb13.js similarity index 100% rename from test/react/mocks/fb13.js rename to test/react/FBMocks/fb13.js diff --git a/test/react/mocks/fb14.js b/test/react/FBMocks/fb14.js similarity index 100% rename from test/react/mocks/fb14.js rename to test/react/FBMocks/fb14.js diff --git a/test/react/mocks/fb15.js b/test/react/FBMocks/fb15.js similarity index 100% rename from test/react/mocks/fb15.js rename to test/react/FBMocks/fb15.js diff --git a/test/react/mocks/fb16.js b/test/react/FBMocks/fb16.js similarity index 100% rename from test/react/mocks/fb16.js rename to test/react/FBMocks/fb16.js diff --git a/test/react/mocks/fb17.js b/test/react/FBMocks/fb17.js similarity index 100% rename from test/react/mocks/fb17.js rename to test/react/FBMocks/fb17.js diff --git a/test/react/mocks/fb18.js b/test/react/FBMocks/fb18.js similarity index 100% rename from test/react/mocks/fb18.js rename to test/react/FBMocks/fb18.js diff --git a/test/react/mocks/fb19.js b/test/react/FBMocks/fb19.js similarity index 100% rename from test/react/mocks/fb19.js rename to test/react/FBMocks/fb19.js diff --git a/test/react/mocks/fb2.js b/test/react/FBMocks/fb2.js similarity index 100% rename from test/react/mocks/fb2.js rename to test/react/FBMocks/fb2.js diff --git a/test/react/mocks/fb20.js b/test/react/FBMocks/fb20.js similarity index 100% rename from test/react/mocks/fb20.js rename to test/react/FBMocks/fb20.js diff --git a/test/react/mocks/fb21.js b/test/react/FBMocks/fb21.js similarity index 100% rename from test/react/mocks/fb21.js rename to test/react/FBMocks/fb21.js diff --git a/test/react/mocks/fb22.js b/test/react/FBMocks/fb22.js similarity index 100% rename from test/react/mocks/fb22.js rename to test/react/FBMocks/fb22.js diff --git a/test/react/mocks/fb23.js b/test/react/FBMocks/fb23.js similarity index 100% rename from test/react/mocks/fb23.js rename to test/react/FBMocks/fb23.js diff --git a/test/react/mocks/fb3.js b/test/react/FBMocks/fb3.js similarity index 100% rename from test/react/mocks/fb3.js rename to test/react/FBMocks/fb3.js diff --git a/test/react/mocks/fb4.js b/test/react/FBMocks/fb4.js similarity index 100% rename from test/react/mocks/fb4.js rename to test/react/FBMocks/fb4.js diff --git a/test/react/mocks/fb5.js b/test/react/FBMocks/fb5.js similarity index 100% rename from test/react/mocks/fb5.js rename to test/react/FBMocks/fb5.js diff --git a/test/react/mocks/fb6.js b/test/react/FBMocks/fb6.js similarity index 100% rename from test/react/mocks/fb6.js rename to test/react/FBMocks/fb6.js diff --git a/test/react/mocks/fb7.js b/test/react/FBMocks/fb7.js similarity index 100% rename from test/react/mocks/fb7.js rename to test/react/FBMocks/fb7.js diff --git a/test/react/mocks/fb8.js b/test/react/FBMocks/fb8.js similarity index 100% rename from test/react/mocks/fb8.js rename to test/react/FBMocks/fb8.js diff --git a/test/react/mocks/fb9.js b/test/react/FBMocks/fb9.js similarity index 100% rename from test/react/mocks/fb9.js rename to test/react/FBMocks/fb9.js diff --git a/test/react/mocks/function-bind.js b/test/react/FBMocks/function-bind.js similarity index 100% rename from test/react/mocks/function-bind.js rename to test/react/FBMocks/function-bind.js diff --git a/test/react/mocks/hacker-news.js b/test/react/FBMocks/hacker-news.js similarity index 100% rename from test/react/mocks/hacker-news.js rename to test/react/FBMocks/hacker-news.js diff --git a/test/react/mocks/hacker-news.json b/test/react/FBMocks/hacker-news.json similarity index 100% rename from test/react/mocks/hacker-news.json rename to test/react/FBMocks/hacker-news.json diff --git a/test/react/mocks/repl-example.js b/test/react/FBMocks/repl-example.js similarity index 100% rename from test/react/mocks/repl-example.js rename to test/react/FBMocks/repl-example.js diff --git a/test/react/FactoryComponents-test.js b/test/react/FactoryComponents-test.js new file mode 100644 index 0000000000..dc4c032fca --- /dev/null +++ b/test/react/FactoryComponents-test.js @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("Simple factory classes", async () => { + await runTest(__dirname + "/FactoryComponents/simple.js"); +}); + +it("Simple factory classes 2", async () => { + await runTest(__dirname + "/FactoryComponents/simple2.js"); +}); diff --git a/test/react/factory-components/simple.js b/test/react/FactoryComponents/simple.js similarity index 100% rename from test/react/factory-components/simple.js rename to test/react/FactoryComponents/simple.js diff --git a/test/react/factory-components/simple2.js b/test/react/FactoryComponents/simple2.js similarity index 100% rename from test/react/factory-components/simple2.js rename to test/react/FactoryComponents/simple2.js diff --git a/test/react/FirstRenderOnly-test.js b/test/react/FirstRenderOnly-test.js new file mode 100644 index 0000000000..035f236353 --- /dev/null +++ b/test/react/FirstRenderOnly-test.js @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("Simple", async () => { + await runTest(__dirname + "/FirstRenderOnly/simple.js", true); +}); + +it("Simple #2", async () => { + await runTest(__dirname + "/FirstRenderOnly/simple-2.js", true); +}); + +it("Simple #3", async () => { + await runTest(__dirname + "/FirstRenderOnly/simple-3.js", true); +}); + +// Should be refined in a follow up PR to check for +// functions and keys on deep referenced objects linking +// to host components +it("Simple #4", async () => { + await runTest(__dirname + "/FirstRenderOnly/simple-4.js", true); +}); + +it("componentWillMount", async () => { + await runTest(__dirname + "/FirstRenderOnly/will-mount.js", true); +}); + +it("getDerivedStateFromProps", async () => { + await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props.js", true); +}); + +it("getDerivedStateFromProps 2", async () => { + await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props2.js", true); +}); + +it("getDerivedStateFromProps 3", async () => { + await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props3.js", true); +}); + +it("getDerivedStateFromProps 4", async () => { + await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props4.js", true); +}); + +it("getDerivedStateFromProps 5", async () => { + await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props5.js", true); +}); + +it("React Context", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context.js"); +}); + +it("React Context 2", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context2.js"); +}); + +it("React Context 3", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context3.js"); +}); + +it("React Context 4", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context4.js"); +}); + +it("React Context 5", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context5.js"); +}); + +it("React Context 6", async () => { + await runTest(__dirname + "/FirstRenderOnly/react-context6.js"); +}); + +it.skip("Replace this in callbacks", async () => { + await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js"); +}); + +it("Replace this in callbacks 2", async () => { + await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks2.js"); +}); + +it("Replace this in callbacks 3", async () => { + await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks3.js"); +}); diff --git a/test/react/first-render-only/get-derived-state-from-props.js b/test/react/FirstRenderOnly/get-derived-state-from-props.js similarity index 100% rename from test/react/first-render-only/get-derived-state-from-props.js rename to test/react/FirstRenderOnly/get-derived-state-from-props.js diff --git a/test/react/first-render-only/get-derived-state-from-props2.js b/test/react/FirstRenderOnly/get-derived-state-from-props2.js similarity index 100% rename from test/react/first-render-only/get-derived-state-from-props2.js rename to test/react/FirstRenderOnly/get-derived-state-from-props2.js diff --git a/test/react/first-render-only/get-derived-state-from-props3.js b/test/react/FirstRenderOnly/get-derived-state-from-props3.js similarity index 100% rename from test/react/first-render-only/get-derived-state-from-props3.js rename to test/react/FirstRenderOnly/get-derived-state-from-props3.js diff --git a/test/react/first-render-only/get-derived-state-from-props4.js b/test/react/FirstRenderOnly/get-derived-state-from-props4.js similarity index 100% rename from test/react/first-render-only/get-derived-state-from-props4.js rename to test/react/FirstRenderOnly/get-derived-state-from-props4.js diff --git a/test/react/first-render-only/get-derived-state-from-props5.js b/test/react/FirstRenderOnly/get-derived-state-from-props5.js similarity index 100% rename from test/react/first-render-only/get-derived-state-from-props5.js rename to test/react/FirstRenderOnly/get-derived-state-from-props5.js diff --git a/test/react/first-render-only/react-context.js b/test/react/FirstRenderOnly/react-context.js similarity index 100% rename from test/react/first-render-only/react-context.js rename to test/react/FirstRenderOnly/react-context.js diff --git a/test/react/first-render-only/react-context2.js b/test/react/FirstRenderOnly/react-context2.js similarity index 100% rename from test/react/first-render-only/react-context2.js rename to test/react/FirstRenderOnly/react-context2.js diff --git a/test/react/first-render-only/react-context3.js b/test/react/FirstRenderOnly/react-context3.js similarity index 100% rename from test/react/first-render-only/react-context3.js rename to test/react/FirstRenderOnly/react-context3.js diff --git a/test/react/first-render-only/react-context4.js b/test/react/FirstRenderOnly/react-context4.js similarity index 100% rename from test/react/first-render-only/react-context4.js rename to test/react/FirstRenderOnly/react-context4.js diff --git a/test/react/first-render-only/react-context5.js b/test/react/FirstRenderOnly/react-context5.js similarity index 100% rename from test/react/first-render-only/react-context5.js rename to test/react/FirstRenderOnly/react-context5.js diff --git a/test/react/first-render-only/react-context6.js b/test/react/FirstRenderOnly/react-context6.js similarity index 100% rename from test/react/first-render-only/react-context6.js rename to test/react/FirstRenderOnly/react-context6.js diff --git a/test/react/first-render-only/replace-this-in-callbacks.js b/test/react/FirstRenderOnly/replace-this-in-callbacks.js similarity index 100% rename from test/react/first-render-only/replace-this-in-callbacks.js rename to test/react/FirstRenderOnly/replace-this-in-callbacks.js diff --git a/test/react/first-render-only/replace-this-in-callbacks2.js b/test/react/FirstRenderOnly/replace-this-in-callbacks2.js similarity index 100% rename from test/react/first-render-only/replace-this-in-callbacks2.js rename to test/react/FirstRenderOnly/replace-this-in-callbacks2.js diff --git a/test/react/first-render-only/replace-this-in-callbacks3.js b/test/react/FirstRenderOnly/replace-this-in-callbacks3.js similarity index 100% rename from test/react/first-render-only/replace-this-in-callbacks3.js rename to test/react/FirstRenderOnly/replace-this-in-callbacks3.js diff --git a/test/react/first-render-only/simple-2.js b/test/react/FirstRenderOnly/simple-2.js similarity index 100% rename from test/react/first-render-only/simple-2.js rename to test/react/FirstRenderOnly/simple-2.js diff --git a/test/react/first-render-only/simple-3.js b/test/react/FirstRenderOnly/simple-3.js similarity index 100% rename from test/react/first-render-only/simple-3.js rename to test/react/FirstRenderOnly/simple-3.js diff --git a/test/react/first-render-only/simple-4.js b/test/react/FirstRenderOnly/simple-4.js similarity index 100% rename from test/react/first-render-only/simple-4.js rename to test/react/FirstRenderOnly/simple-4.js diff --git a/test/react/first-render-only/simple.js b/test/react/FirstRenderOnly/simple.js similarity index 100% rename from test/react/first-render-only/simple.js rename to test/react/FirstRenderOnly/simple.js diff --git a/test/react/first-render-only/will-mount.js b/test/react/FirstRenderOnly/will-mount.js similarity index 100% rename from test/react/first-render-only/will-mount.js rename to test/react/FirstRenderOnly/will-mount.js diff --git a/test/react/FunctionalComponents-test.js b/test/react/FunctionalComponents-test.js new file mode 100644 index 0000000000..64408347fb --- /dev/null +++ b/test/react/FunctionalComponents-test.js @@ -0,0 +1,530 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const React = require("react"); +const prepareReactTests = require("./prepareReactTests"); +const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { expect, it } = global; + +it("Simple", async () => { + await runTest(__dirname + "/FunctionalComponents/simple.js"); +}); + +it("Simple 2", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-2.js"); +}); + +it("Simple 3", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-3.js"); +}); + +it("Simple 4", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-4.js"); +}); + +it("Simple 5", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-5.js"); +}); + +it("Simple 6", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-6.js"); +}); + +it("Simple 7", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-7.js"); +}); + +it("Simple 8", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/simple-8.js"); + }); +}); + +it("Simple 9", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/simple-9.js"); + }); +}); + +it("Simple 10", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/simple-10.js"); + }); +}); + +it("Simple 11", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/simple-11.js"); + }); +}); + +it("Simple 12", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-12.js"); +}); + +it("Runtime error", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/runtime-error.js"); + }); +}); + +it("Simple 13", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/simple-13.js"); + }); +}); + +it("Simple 14", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-14.js"); +}); + +it("Simple 15", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-15.js"); +}); + +it("Simple 16", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-16.js"); +}); + +it("Simple 17", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-17.js"); +}); + +it("Simple 18", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-18.js"); +}); + +it("Simple 19", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-19.js"); +}); + +it("Simple 20", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-20.js"); +}); + +it("Simple 21", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-21.js"); +}); + +it("Two roots", async () => { + await runTest(__dirname + "/FunctionalComponents/two-roots.js"); +}); + +it("Havocing of ReactElements should not result in property assignments", async () => { + await runTest(__dirname + "/FunctionalComponents/react-element-havoc.js"); +}); + +it("__reactCompilerDoNotOptimize", async () => { + await runTest(__dirname + "/FunctionalComponents/do-not-optimize.js"); +}); + +it("Mutations - not-safe 1", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/not-safe.js"); + }); +}); + +it("Mutations - not-safe 2", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/not-safe2.js"); + }); +}); + +it("Mutations - not-safe 3", async () => { + await expectReconcilerFatalError(async () => { + await runTest(__dirname + "/FunctionalComponents/not-safe3.js"); + }); +}); + +it("Mutations - safe 1", async () => { + await runTest(__dirname + "/FunctionalComponents/safe.js"); +}); + +it("Mutations - safe 2", async () => { + await runTest(__dirname + "/FunctionalComponents/safe2.js"); +}); + +it("Mutations - safe 3", async () => { + await runTest(__dirname + "/FunctionalComponents/safe3.js"); +}); + +it("Handle mapped arrays", async () => { + await runTest(__dirname + "/FunctionalComponents/array-map.js"); +}); + +it("Handle mapped arrays 2", async () => { + await runTest(__dirname + "/FunctionalComponents/array-map2.js"); +}); + +it("Handle mapped arrays from Array.from", async () => { + await runTest(__dirname + "/FunctionalComponents/array-from.js"); +}); + +it("Simple fragments", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-fragments.js"); +}); + +it("Simple children", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-children.js"); +}); + +it("Simple with new expression", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-new-expression.js"); +}); + +it("Simple refs", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-refs.js"); +}); + +it("16.3 refs", async () => { + await runTest(__dirname + "/FunctionalComponents/refs.js"); +}); + +it("16.3 refs 2", async () => { + await runTest(__dirname + "/FunctionalComponents/refs2.js"); +}); + +it("16.3 refs 3", async () => { + await runTest(__dirname + "/FunctionalComponents/refs3.js"); +}); + +it("defaultProps", async () => { + await runTest(__dirname + "/FunctionalComponents/default-props.js"); +}); + +it("Unsafe spread", async () => { + await expectPartialKeyOrRefError(async () => { + await runTest(__dirname + "/FunctionalComponents/unsafe-spread.js"); + }); +}); + +it("Simple with abstract props", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-abstract-props.js"); +}); + +it("Simple with unary expressions", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-unary.js"); +}); + +it("Simple with multiple JSX spreads", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread.js"); +}); + +it("Simple with multiple JSX spreads #2", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread2.js"); +}); + +it("Simple with multiple JSX spreads #3", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread3.js"); +}); + +it("Simple with multiple JSX spreads #4", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread4.js"); +}); + +it("Simple with multiple JSX spreads #5", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread5.js"); +}); + +it("Simple with multiple JSX spreads #6", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread6.js"); +}); + +it("Simple with multiple JSX spreads #7", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread7.js"); +}); + +it("Simple with multiple JSX spreads #8", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread8.js"); +}); + +it("Simple with multiple JSX spreads #9", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread9.js"); +}); + +it("Simple with multiple JSX spreads #10", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread10.js"); +}); + +it("Simple with multiple JSX spreads #11", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread11.js"); +}); + +it("Simple with multiple JSX spreads #12", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread12.js"); +}); + +it("Simple with multiple JSX spreads #13", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread13.js"); +}); + +it("Simple with Object.assign", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-assign.js"); +}); + +it("Simple with Object.assign #2", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-assign2.js"); +}); + +it("Simple with Object.assign #3", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-assign3.js"); +}); + +it("Simple with Object.assign #4", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-assign4.js"); +}); + +it("Simple with Object.assign #5", async () => { + await runTest(__dirname + "/FunctionalComponents/simple-assign5.js"); +}); + +it("Circular reference", async () => { + await runTest(__dirname + "/FunctionalComponents/circular-reference.js"); +}); + +it("Conditional", async () => { + await runTest(__dirname + "/FunctionalComponents/conditional.js"); +}); + +it("Key nesting", async () => { + await runTest(__dirname + "/FunctionalComponents/key-nesting.js"); +}); + +it("Key nesting 2", async () => { + await runTest(__dirname + "/FunctionalComponents/key-nesting-2.js"); +}); + +it("Key nesting 3", async () => { + await runTest(__dirname + "/FunctionalComponents/key-nesting-3.js"); +}); + +it("Key change", async () => { + await runTest(__dirname + "/FunctionalComponents/key-change.js"); +}); + +it("Equivalence", async () => { + let createElement = React.createElement; + let count = 0; + // For this test we want to also check how React.createElement + // calls occur so we can validate that we are correctly using + // lazy branched elements. To do this, we override the createElement + // call and increment a counter for ever call. + + // $FlowFixMe: intentional for this test + React.createElement = (type, config) => { + count++; + return createElement(type, config); + }; + try { + await runTest(__dirname + "/FunctionalComponents/equivalence.js"); + } finally { + // $FlowFixMe: intentional for this test + React.createElement = createElement; + } + // The non-Prepacked version has 20 calls, the Prepacked one should have 8 calls. + // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). + expect(count).toEqual(28 * 4); +}); + +it("Delete element prop key", async () => { + await runTest(__dirname + "/FunctionalComponents/delete-element-prop-key.js"); +}); + +it("Key change with fragments", async () => { + await runTest(__dirname + "/FunctionalComponents/key-change-fragments.js"); +}); + +it("Key not changing with fragments", async () => { + await runTest(__dirname + "/FunctionalComponents/key-not-change-fragments.js"); +}); + +it("Component type change", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change.js"); +}); + +it("Component type change 2", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change2.js"); +}); + +it("Component type change 3", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change3.js"); +}); + +it("Component type change 4", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change4.js"); +}); + +it("Component type change 5", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change5.js"); +}); + +it("Component type change 6", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change6.js"); +}); + +it("Component type change 7", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change7.js"); +}); + +it("Component type change 8", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change8.js"); +}); + +it("Component type change 9", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change9.js"); +}); + +it("Component type change 10", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change10.js"); +}); + +it("Component type change 11", async () => { + await runTest(__dirname + "/FunctionalComponents/type-change11.js"); +}); + +it("Component type same", async () => { + await runTest(__dirname + "/FunctionalComponents/type-same.js"); +}); + +it("Dynamic props", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-props.js"); +}); + +it("Dynamic context", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-context.js"); +}); + +it("React.cloneElement", async () => { + await runTest(__dirname + "/FunctionalComponents/clone-element.js"); +}); + +it("Return text", async () => { + await runTest(__dirname + "/FunctionalComponents/return-text.js"); +}); + +it("Render array twice", async () => { + await runTest(__dirname + "/FunctionalComponents/array-twice.js"); +}); + +it("Render nested array children", async () => { + await runTest(__dirname + "/FunctionalComponents/nested-array-children.js"); +}); + +it("Return undefined", async () => { + await runTest(__dirname + "/FunctionalComponents/return-undefined.js"); +}); + +it("Null or undefined props", async () => { + await runTest(__dirname + "/FunctionalComponents/null-or-undefined-props.js"); +}); + +it("Event handlers", async () => { + await runTest(__dirname + "/FunctionalComponents/event-handlers.js"); +}); + +it("Class component as root", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root.js"); +}); + +it("Class component as root with multiple render methods", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-render-methods.js"); +}); + +it("Class component as root with props", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-props.js"); +}); + +it("Class component as root with state", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-state.js"); +}); + +it("Class component as root with refs", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-refs.js"); +}); + +it("Class component as root with instance variables", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars.js"); +}); + +it("Class component as root with instance variables #2", async () => { + await runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars-2.js"); +}); + +it("Additional functions closure scope capturing", async () => { + await runTest(__dirname + "/FunctionalComponents/additional-function-regression.js"); +}); + +it("Dynamic ReactElement type", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-type.js"); +}); + +it("Dynamic ReactElement type #2", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-type2.js"); +}); + +it("Dynamic ReactElement type #3", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-type3.js"); +}); + +it("Dynamic ReactElement type #4", async () => { + await runTest(__dirname + "/FunctionalComponents/dynamic-type4.js"); +}); + +it("Lazy branched elements", async () => { + let createElement = React.createElement; + let count = 0; + // For this test we want to also check how React.createElement + // calls occur so we can validate that we are correctly using + // lazy branched elements. To do this, we override the createElement + // call and increment a counter for ever call. + + // $FlowFixMe: intentional for this test + React.createElement = (type, config) => { + count++; + return createElement(type, config); + }; + try { + await runTest(__dirname + "/FunctionalComponents/lazy-branched-elements.js"); + } finally { + // $FlowFixMe: intentional for this test + React.createElement = createElement; + } + // The non-Prepacked version has 4 calls, the Prepacked one should have 4 calls. + // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). + expect(count).toEqual(8 * 4); +}); + +it("Lazy branched elements 2", async () => { + let createElement = React.createElement; + let count = 0; + // For this test we want to also check how React.createElement + // calls occur so we can validate that we are correctly using + // lazy branched elements. To do this, we override the createElement + // call and increment a counter for ever call. + + // $FlowFixMe: intentional for this test + React.createElement = (type, config) => { + count++; + return createElement(type, config); + }; + try { + await runTest(__dirname + "/FunctionalComponents/lazy-branched-elements2.js"); + } finally { + // $FlowFixMe: intentional for this test + React.createElement = createElement; + } + // The non-Prepacked version has 4 calls, the Prepacked one should have 3 calls + // (3 because one of the calls has been removing by inlining). + // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). + expect(count).toEqual(7 * 4); +}); diff --git a/test/react/functional-components/additional-function-regression.js b/test/react/FunctionalComponents/additional-function-regression.js similarity index 100% rename from test/react/functional-components/additional-function-regression.js rename to test/react/FunctionalComponents/additional-function-regression.js diff --git a/test/react/functional-components/array-from.js b/test/react/FunctionalComponents/array-from.js similarity index 100% rename from test/react/functional-components/array-from.js rename to test/react/FunctionalComponents/array-from.js diff --git a/test/react/functional-components/array-map.js b/test/react/FunctionalComponents/array-map.js similarity index 100% rename from test/react/functional-components/array-map.js rename to test/react/FunctionalComponents/array-map.js diff --git a/test/react/functional-components/array-map2.js b/test/react/FunctionalComponents/array-map2.js similarity index 100% rename from test/react/functional-components/array-map2.js rename to test/react/FunctionalComponents/array-map2.js diff --git a/test/react/functional-components/array-twice.js b/test/react/FunctionalComponents/array-twice.js similarity index 100% rename from test/react/functional-components/array-twice.js rename to test/react/FunctionalComponents/array-twice.js diff --git a/test/react/functional-components/circular-reference.js b/test/react/FunctionalComponents/circular-reference.js similarity index 100% rename from test/react/functional-components/circular-reference.js rename to test/react/FunctionalComponents/circular-reference.js diff --git a/test/react/functional-components/class-root-with-instance-vars-2.js b/test/react/FunctionalComponents/class-root-with-instance-vars-2.js similarity index 100% rename from test/react/functional-components/class-root-with-instance-vars-2.js rename to test/react/FunctionalComponents/class-root-with-instance-vars-2.js diff --git a/test/react/functional-components/class-root-with-instance-vars.js b/test/react/FunctionalComponents/class-root-with-instance-vars.js similarity index 100% rename from test/react/functional-components/class-root-with-instance-vars.js rename to test/react/FunctionalComponents/class-root-with-instance-vars.js diff --git a/test/react/functional-components/class-root-with-props.js b/test/react/FunctionalComponents/class-root-with-props.js similarity index 100% rename from test/react/functional-components/class-root-with-props.js rename to test/react/FunctionalComponents/class-root-with-props.js diff --git a/test/react/functional-components/class-root-with-refs.js b/test/react/FunctionalComponents/class-root-with-refs.js similarity index 98% rename from test/react/functional-components/class-root-with-refs.js rename to test/react/FunctionalComponents/class-root-with-refs.js index e988fbba30..0ec0ff32f0 100644 --- a/test/react/functional-components/class-root-with-refs.js +++ b/test/react/FunctionalComponents/class-root-with-refs.js @@ -47,4 +47,4 @@ if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; +module.exports = App; \ No newline at end of file diff --git a/test/react/functional-components/class-root-with-render-methods.js b/test/react/FunctionalComponents/class-root-with-render-methods.js similarity index 100% rename from test/react/functional-components/class-root-with-render-methods.js rename to test/react/FunctionalComponents/class-root-with-render-methods.js diff --git a/test/react/functional-components/class-root-with-state.js b/test/react/FunctionalComponents/class-root-with-state.js similarity index 100% rename from test/react/functional-components/class-root-with-state.js rename to test/react/FunctionalComponents/class-root-with-state.js diff --git a/test/react/functional-components/class-root.js b/test/react/FunctionalComponents/class-root.js similarity index 100% rename from test/react/functional-components/class-root.js rename to test/react/FunctionalComponents/class-root.js diff --git a/test/react/functional-components/clone-element.js b/test/react/FunctionalComponents/clone-element.js similarity index 100% rename from test/react/functional-components/clone-element.js rename to test/react/FunctionalComponents/clone-element.js diff --git a/test/react/functional-components/conditional.js b/test/react/FunctionalComponents/conditional.js similarity index 100% rename from test/react/functional-components/conditional.js rename to test/react/FunctionalComponents/conditional.js diff --git a/test/react/functional-components/default-props.js b/test/react/FunctionalComponents/default-props.js similarity index 100% rename from test/react/functional-components/default-props.js rename to test/react/FunctionalComponents/default-props.js diff --git a/test/react/functional-components/delete-element-prop-key.js b/test/react/FunctionalComponents/delete-element-prop-key.js similarity index 100% rename from test/react/functional-components/delete-element-prop-key.js rename to test/react/FunctionalComponents/delete-element-prop-key.js diff --git a/test/react/functional-components/do-not-optimize.js b/test/react/FunctionalComponents/do-not-optimize.js similarity index 100% rename from test/react/functional-components/do-not-optimize.js rename to test/react/FunctionalComponents/do-not-optimize.js diff --git a/test/react/functional-components/dynamic-context.js b/test/react/FunctionalComponents/dynamic-context.js similarity index 100% rename from test/react/functional-components/dynamic-context.js rename to test/react/FunctionalComponents/dynamic-context.js diff --git a/test/react/functional-components/dynamic-props.js b/test/react/FunctionalComponents/dynamic-props.js similarity index 100% rename from test/react/functional-components/dynamic-props.js rename to test/react/FunctionalComponents/dynamic-props.js diff --git a/test/react/functional-components/dynamic-type.js b/test/react/FunctionalComponents/dynamic-type.js similarity index 100% rename from test/react/functional-components/dynamic-type.js rename to test/react/FunctionalComponents/dynamic-type.js diff --git a/test/react/functional-components/dynamic-type2.js b/test/react/FunctionalComponents/dynamic-type2.js similarity index 100% rename from test/react/functional-components/dynamic-type2.js rename to test/react/FunctionalComponents/dynamic-type2.js diff --git a/test/react/functional-components/dynamic-type3.js b/test/react/FunctionalComponents/dynamic-type3.js similarity index 100% rename from test/react/functional-components/dynamic-type3.js rename to test/react/FunctionalComponents/dynamic-type3.js diff --git a/test/react/functional-components/dynamic-type4.js b/test/react/FunctionalComponents/dynamic-type4.js similarity index 100% rename from test/react/functional-components/dynamic-type4.js rename to test/react/FunctionalComponents/dynamic-type4.js diff --git a/test/react/functional-components/equivalence.js b/test/react/FunctionalComponents/equivalence.js similarity index 100% rename from test/react/functional-components/equivalence.js rename to test/react/FunctionalComponents/equivalence.js diff --git a/test/react/functional-components/event-handlers.js b/test/react/FunctionalComponents/event-handlers.js similarity index 100% rename from test/react/functional-components/event-handlers.js rename to test/react/FunctionalComponents/event-handlers.js diff --git a/test/react/functional-components/key-change-fragments.js b/test/react/FunctionalComponents/key-change-fragments.js similarity index 100% rename from test/react/functional-components/key-change-fragments.js rename to test/react/FunctionalComponents/key-change-fragments.js diff --git a/test/react/functional-components/key-change.js b/test/react/FunctionalComponents/key-change.js similarity index 100% rename from test/react/functional-components/key-change.js rename to test/react/FunctionalComponents/key-change.js diff --git a/test/react/functional-components/key-nesting-2.js b/test/react/FunctionalComponents/key-nesting-2.js similarity index 100% rename from test/react/functional-components/key-nesting-2.js rename to test/react/FunctionalComponents/key-nesting-2.js diff --git a/test/react/functional-components/key-nesting-3.js b/test/react/FunctionalComponents/key-nesting-3.js similarity index 100% rename from test/react/functional-components/key-nesting-3.js rename to test/react/FunctionalComponents/key-nesting-3.js diff --git a/test/react/functional-components/key-nesting.js b/test/react/FunctionalComponents/key-nesting.js similarity index 100% rename from test/react/functional-components/key-nesting.js rename to test/react/FunctionalComponents/key-nesting.js diff --git a/test/react/functional-components/key-not-change-fragments.js b/test/react/FunctionalComponents/key-not-change-fragments.js similarity index 100% rename from test/react/functional-components/key-not-change-fragments.js rename to test/react/FunctionalComponents/key-not-change-fragments.js diff --git a/test/react/functional-components/lazy-branched-elements.js b/test/react/FunctionalComponents/lazy-branched-elements.js similarity index 100% rename from test/react/functional-components/lazy-branched-elements.js rename to test/react/FunctionalComponents/lazy-branched-elements.js diff --git a/test/react/functional-components/lazy-branched-elements2.js b/test/react/FunctionalComponents/lazy-branched-elements2.js similarity index 100% rename from test/react/functional-components/lazy-branched-elements2.js rename to test/react/FunctionalComponents/lazy-branched-elements2.js diff --git a/test/react/functional-components/nested-array-children.js b/test/react/FunctionalComponents/nested-array-children.js similarity index 100% rename from test/react/functional-components/nested-array-children.js rename to test/react/FunctionalComponents/nested-array-children.js diff --git a/test/react/functional-components/not-safe.js b/test/react/FunctionalComponents/not-safe.js similarity index 100% rename from test/react/functional-components/not-safe.js rename to test/react/FunctionalComponents/not-safe.js diff --git a/test/react/functional-components/not-safe2.js b/test/react/FunctionalComponents/not-safe2.js similarity index 100% rename from test/react/functional-components/not-safe2.js rename to test/react/FunctionalComponents/not-safe2.js diff --git a/test/react/functional-components/not-safe3.js b/test/react/FunctionalComponents/not-safe3.js similarity index 100% rename from test/react/functional-components/not-safe3.js rename to test/react/FunctionalComponents/not-safe3.js diff --git a/test/react/functional-components/null-or-undefined-props.js b/test/react/FunctionalComponents/null-or-undefined-props.js similarity index 100% rename from test/react/functional-components/null-or-undefined-props.js rename to test/react/FunctionalComponents/null-or-undefined-props.js diff --git a/test/react/functional-components/react-element-havoc.js b/test/react/FunctionalComponents/react-element-havoc.js similarity index 100% rename from test/react/functional-components/react-element-havoc.js rename to test/react/FunctionalComponents/react-element-havoc.js diff --git a/test/react/functional-components/refs.js b/test/react/FunctionalComponents/refs.js similarity index 100% rename from test/react/functional-components/refs.js rename to test/react/FunctionalComponents/refs.js diff --git a/test/react/functional-components/refs2.js b/test/react/FunctionalComponents/refs2.js similarity index 100% rename from test/react/functional-components/refs2.js rename to test/react/FunctionalComponents/refs2.js diff --git a/test/react/functional-components/refs3.js b/test/react/FunctionalComponents/refs3.js similarity index 100% rename from test/react/functional-components/refs3.js rename to test/react/FunctionalComponents/refs3.js diff --git a/test/react/functional-components/return-text.js b/test/react/FunctionalComponents/return-text.js similarity index 100% rename from test/react/functional-components/return-text.js rename to test/react/FunctionalComponents/return-text.js diff --git a/test/react/functional-components/return-undefined.js b/test/react/FunctionalComponents/return-undefined.js similarity index 100% rename from test/react/functional-components/return-undefined.js rename to test/react/FunctionalComponents/return-undefined.js diff --git a/test/react/functional-components/runtime-error.js b/test/react/FunctionalComponents/runtime-error.js similarity index 100% rename from test/react/functional-components/runtime-error.js rename to test/react/FunctionalComponents/runtime-error.js diff --git a/test/react/functional-components/safe.js b/test/react/FunctionalComponents/safe.js similarity index 100% rename from test/react/functional-components/safe.js rename to test/react/FunctionalComponents/safe.js diff --git a/test/react/functional-components/safe2.js b/test/react/FunctionalComponents/safe2.js similarity index 100% rename from test/react/functional-components/safe2.js rename to test/react/FunctionalComponents/safe2.js diff --git a/test/react/functional-components/safe3.js b/test/react/FunctionalComponents/safe3.js similarity index 100% rename from test/react/functional-components/safe3.js rename to test/react/FunctionalComponents/safe3.js diff --git a/test/react/functional-components/safe4.js b/test/react/FunctionalComponents/safe4.js similarity index 100% rename from test/react/functional-components/safe4.js rename to test/react/FunctionalComponents/safe4.js diff --git a/test/react/functional-components/simple-10.js b/test/react/FunctionalComponents/simple-10.js similarity index 100% rename from test/react/functional-components/simple-10.js rename to test/react/FunctionalComponents/simple-10.js diff --git a/test/react/functional-components/simple-11.js b/test/react/FunctionalComponents/simple-11.js similarity index 100% rename from test/react/functional-components/simple-11.js rename to test/react/FunctionalComponents/simple-11.js diff --git a/test/react/functional-components/simple-12.js b/test/react/FunctionalComponents/simple-12.js similarity index 100% rename from test/react/functional-components/simple-12.js rename to test/react/FunctionalComponents/simple-12.js diff --git a/test/react/functional-components/simple-13.js b/test/react/FunctionalComponents/simple-13.js similarity index 100% rename from test/react/functional-components/simple-13.js rename to test/react/FunctionalComponents/simple-13.js diff --git a/test/react/functional-components/simple-14.js b/test/react/FunctionalComponents/simple-14.js similarity index 100% rename from test/react/functional-components/simple-14.js rename to test/react/FunctionalComponents/simple-14.js diff --git a/test/react/functional-components/simple-15.js b/test/react/FunctionalComponents/simple-15.js similarity index 100% rename from test/react/functional-components/simple-15.js rename to test/react/FunctionalComponents/simple-15.js diff --git a/test/react/functional-components/simple-16.js b/test/react/FunctionalComponents/simple-16.js similarity index 100% rename from test/react/functional-components/simple-16.js rename to test/react/FunctionalComponents/simple-16.js diff --git a/test/react/functional-components/simple-17.js b/test/react/FunctionalComponents/simple-17.js similarity index 100% rename from test/react/functional-components/simple-17.js rename to test/react/FunctionalComponents/simple-17.js diff --git a/test/react/functional-components/simple-18.js b/test/react/FunctionalComponents/simple-18.js similarity index 100% rename from test/react/functional-components/simple-18.js rename to test/react/FunctionalComponents/simple-18.js diff --git a/test/react/functional-components/simple-19.js b/test/react/FunctionalComponents/simple-19.js similarity index 100% rename from test/react/functional-components/simple-19.js rename to test/react/FunctionalComponents/simple-19.js diff --git a/test/react/functional-components/simple-2.js b/test/react/FunctionalComponents/simple-2.js similarity index 100% rename from test/react/functional-components/simple-2.js rename to test/react/FunctionalComponents/simple-2.js diff --git a/test/react/functional-components/simple-20.js b/test/react/FunctionalComponents/simple-20.js similarity index 100% rename from test/react/functional-components/simple-20.js rename to test/react/FunctionalComponents/simple-20.js diff --git a/test/react/functional-components/simple-21.js b/test/react/FunctionalComponents/simple-21.js similarity index 100% rename from test/react/functional-components/simple-21.js rename to test/react/FunctionalComponents/simple-21.js diff --git a/test/react/functional-components/simple-3.js b/test/react/FunctionalComponents/simple-3.js similarity index 100% rename from test/react/functional-components/simple-3.js rename to test/react/FunctionalComponents/simple-3.js diff --git a/test/react/functional-components/simple-4.js b/test/react/FunctionalComponents/simple-4.js similarity index 100% rename from test/react/functional-components/simple-4.js rename to test/react/FunctionalComponents/simple-4.js diff --git a/test/react/functional-components/simple-5.js b/test/react/FunctionalComponents/simple-5.js similarity index 100% rename from test/react/functional-components/simple-5.js rename to test/react/FunctionalComponents/simple-5.js diff --git a/test/react/functional-components/simple-6.js b/test/react/FunctionalComponents/simple-6.js similarity index 100% rename from test/react/functional-components/simple-6.js rename to test/react/FunctionalComponents/simple-6.js diff --git a/test/react/functional-components/simple-7.js b/test/react/FunctionalComponents/simple-7.js similarity index 100% rename from test/react/functional-components/simple-7.js rename to test/react/FunctionalComponents/simple-7.js diff --git a/test/react/functional-components/simple-8.js b/test/react/FunctionalComponents/simple-8.js similarity index 100% rename from test/react/functional-components/simple-8.js rename to test/react/FunctionalComponents/simple-8.js diff --git a/test/react/functional-components/simple-9.js b/test/react/FunctionalComponents/simple-9.js similarity index 100% rename from test/react/functional-components/simple-9.js rename to test/react/FunctionalComponents/simple-9.js diff --git a/test/react/functional-components/simple-assign.js b/test/react/FunctionalComponents/simple-assign.js similarity index 100% rename from test/react/functional-components/simple-assign.js rename to test/react/FunctionalComponents/simple-assign.js diff --git a/test/react/functional-components/simple-assign2.js b/test/react/FunctionalComponents/simple-assign2.js similarity index 100% rename from test/react/functional-components/simple-assign2.js rename to test/react/FunctionalComponents/simple-assign2.js diff --git a/test/react/functional-components/simple-assign3.js b/test/react/FunctionalComponents/simple-assign3.js similarity index 100% rename from test/react/functional-components/simple-assign3.js rename to test/react/FunctionalComponents/simple-assign3.js diff --git a/test/react/functional-components/simple-assign4.js b/test/react/FunctionalComponents/simple-assign4.js similarity index 100% rename from test/react/functional-components/simple-assign4.js rename to test/react/FunctionalComponents/simple-assign4.js diff --git a/test/react/functional-components/simple-assign5.js b/test/react/FunctionalComponents/simple-assign5.js similarity index 100% rename from test/react/functional-components/simple-assign5.js rename to test/react/FunctionalComponents/simple-assign5.js diff --git a/test/react/functional-components/simple-children.js b/test/react/FunctionalComponents/simple-children.js similarity index 100% rename from test/react/functional-components/simple-children.js rename to test/react/FunctionalComponents/simple-children.js diff --git a/test/react/functional-components/simple-fragments.js b/test/react/FunctionalComponents/simple-fragments.js similarity index 100% rename from test/react/functional-components/simple-fragments.js rename to test/react/FunctionalComponents/simple-fragments.js diff --git a/test/react/functional-components/simple-refs.js b/test/react/FunctionalComponents/simple-refs.js similarity index 100% rename from test/react/functional-components/simple-refs.js rename to test/react/FunctionalComponents/simple-refs.js diff --git a/test/react/functional-components/simple-with-abstract-props.js b/test/react/FunctionalComponents/simple-with-abstract-props.js similarity index 100% rename from test/react/functional-components/simple-with-abstract-props.js rename to test/react/FunctionalComponents/simple-with-abstract-props.js diff --git a/test/react/functional-components/simple-with-jsx-spread.js b/test/react/FunctionalComponents/simple-with-jsx-spread.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread.js rename to test/react/FunctionalComponents/simple-with-jsx-spread.js diff --git a/test/react/functional-components/simple-with-jsx-spread10.js b/test/react/FunctionalComponents/simple-with-jsx-spread10.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread10.js rename to test/react/FunctionalComponents/simple-with-jsx-spread10.js diff --git a/test/react/functional-components/simple-with-jsx-spread11.js b/test/react/FunctionalComponents/simple-with-jsx-spread11.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread11.js rename to test/react/FunctionalComponents/simple-with-jsx-spread11.js diff --git a/test/react/functional-components/simple-with-jsx-spread12.js b/test/react/FunctionalComponents/simple-with-jsx-spread12.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread12.js rename to test/react/FunctionalComponents/simple-with-jsx-spread12.js diff --git a/test/react/functional-components/simple-with-jsx-spread13.js b/test/react/FunctionalComponents/simple-with-jsx-spread13.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread13.js rename to test/react/FunctionalComponents/simple-with-jsx-spread13.js diff --git a/test/react/functional-components/simple-with-jsx-spread2.js b/test/react/FunctionalComponents/simple-with-jsx-spread2.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread2.js rename to test/react/FunctionalComponents/simple-with-jsx-spread2.js diff --git a/test/react/functional-components/simple-with-jsx-spread3.js b/test/react/FunctionalComponents/simple-with-jsx-spread3.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread3.js rename to test/react/FunctionalComponents/simple-with-jsx-spread3.js diff --git a/test/react/functional-components/simple-with-jsx-spread4.js b/test/react/FunctionalComponents/simple-with-jsx-spread4.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread4.js rename to test/react/FunctionalComponents/simple-with-jsx-spread4.js diff --git a/test/react/functional-components/simple-with-jsx-spread5.js b/test/react/FunctionalComponents/simple-with-jsx-spread5.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread5.js rename to test/react/FunctionalComponents/simple-with-jsx-spread5.js diff --git a/test/react/functional-components/simple-with-jsx-spread6.js b/test/react/FunctionalComponents/simple-with-jsx-spread6.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread6.js rename to test/react/FunctionalComponents/simple-with-jsx-spread6.js diff --git a/test/react/functional-components/simple-with-jsx-spread7.js b/test/react/FunctionalComponents/simple-with-jsx-spread7.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread7.js rename to test/react/FunctionalComponents/simple-with-jsx-spread7.js diff --git a/test/react/functional-components/simple-with-jsx-spread8.js b/test/react/FunctionalComponents/simple-with-jsx-spread8.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread8.js rename to test/react/FunctionalComponents/simple-with-jsx-spread8.js diff --git a/test/react/functional-components/simple-with-jsx-spread9.js b/test/react/FunctionalComponents/simple-with-jsx-spread9.js similarity index 100% rename from test/react/functional-components/simple-with-jsx-spread9.js rename to test/react/FunctionalComponents/simple-with-jsx-spread9.js diff --git a/test/react/functional-components/simple-with-new-expression.js b/test/react/FunctionalComponents/simple-with-new-expression.js similarity index 100% rename from test/react/functional-components/simple-with-new-expression.js rename to test/react/FunctionalComponents/simple-with-new-expression.js diff --git a/test/react/functional-components/simple-with-unary.js b/test/react/FunctionalComponents/simple-with-unary.js similarity index 100% rename from test/react/functional-components/simple-with-unary.js rename to test/react/FunctionalComponents/simple-with-unary.js diff --git a/test/react/functional-components/simple.js b/test/react/FunctionalComponents/simple.js similarity index 100% rename from test/react/functional-components/simple.js rename to test/react/FunctionalComponents/simple.js diff --git a/test/react/functional-components/two-roots.js b/test/react/FunctionalComponents/two-roots.js similarity index 100% rename from test/react/functional-components/two-roots.js rename to test/react/FunctionalComponents/two-roots.js diff --git a/test/react/functional-components/type-change.js b/test/react/FunctionalComponents/type-change.js similarity index 100% rename from test/react/functional-components/type-change.js rename to test/react/FunctionalComponents/type-change.js diff --git a/test/react/functional-components/type-change10.js b/test/react/FunctionalComponents/type-change10.js similarity index 100% rename from test/react/functional-components/type-change10.js rename to test/react/FunctionalComponents/type-change10.js diff --git a/test/react/functional-components/type-change11.js b/test/react/FunctionalComponents/type-change11.js similarity index 100% rename from test/react/functional-components/type-change11.js rename to test/react/FunctionalComponents/type-change11.js diff --git a/test/react/functional-components/type-change2.js b/test/react/FunctionalComponents/type-change2.js similarity index 100% rename from test/react/functional-components/type-change2.js rename to test/react/FunctionalComponents/type-change2.js diff --git a/test/react/functional-components/type-change3.js b/test/react/FunctionalComponents/type-change3.js similarity index 100% rename from test/react/functional-components/type-change3.js rename to test/react/FunctionalComponents/type-change3.js diff --git a/test/react/functional-components/type-change4.js b/test/react/FunctionalComponents/type-change4.js similarity index 100% rename from test/react/functional-components/type-change4.js rename to test/react/FunctionalComponents/type-change4.js diff --git a/test/react/functional-components/type-change5.js b/test/react/FunctionalComponents/type-change5.js similarity index 100% rename from test/react/functional-components/type-change5.js rename to test/react/FunctionalComponents/type-change5.js diff --git a/test/react/functional-components/type-change6.js b/test/react/FunctionalComponents/type-change6.js similarity index 100% rename from test/react/functional-components/type-change6.js rename to test/react/FunctionalComponents/type-change6.js diff --git a/test/react/functional-components/type-change7.js b/test/react/FunctionalComponents/type-change7.js similarity index 100% rename from test/react/functional-components/type-change7.js rename to test/react/FunctionalComponents/type-change7.js diff --git a/test/react/functional-components/type-change8.js b/test/react/FunctionalComponents/type-change8.js similarity index 100% rename from test/react/functional-components/type-change8.js rename to test/react/FunctionalComponents/type-change8.js diff --git a/test/react/functional-components/type-change9.js b/test/react/FunctionalComponents/type-change9.js similarity index 100% rename from test/react/functional-components/type-change9.js rename to test/react/FunctionalComponents/type-change9.js diff --git a/test/react/functional-components/type-same.js b/test/react/FunctionalComponents/type-same.js similarity index 100% rename from test/react/functional-components/type-same.js rename to test/react/FunctionalComponents/type-same.js diff --git a/test/react/functional-components/unsafe-spread.js b/test/react/FunctionalComponents/unsafe-spread.js similarity index 100% rename from test/react/functional-components/unsafe-spread.js rename to test/react/FunctionalComponents/unsafe-spread.js diff --git a/test/react/ReactDOM-test.js b/test/react/ReactDOM-test.js new file mode 100644 index 0000000000..12a43e0aa8 --- /dev/null +++ b/test/react/ReactDOM-test.js @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("createPortal", async () => { + await runTest(__dirname + "/ReactDOM/create-portal.js", false); +}); diff --git a/test/react/react-dom/create-portal.js b/test/react/ReactDOM/create-portal.js similarity index 100% rename from test/react/react-dom/create-portal.js rename to test/react/ReactDOM/create-portal.js diff --git a/test/react/RenderProps-test.js b/test/react/RenderProps-test.js new file mode 100644 index 0000000000..31b2fd4353 --- /dev/null +++ b/test/react/RenderProps-test.js @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("Relay QueryRenderer", async () => { + await runTest(__dirname + "/RenderProps/relay-query-renderer.js"); +}); + +it("Relay QueryRenderer 2", async () => { + await runTest(__dirname + "/RenderProps/relay-query-renderer2.js"); +}); + +it("Relay QueryRenderer 3", async () => { + await runTest(__dirname + "/RenderProps/relay-query-renderer3.js"); +}); + +it("React Context", async () => { + await runTest(__dirname + "/RenderProps/react-context.js"); +}); + +it("React Context 2", async () => { + await runTest(__dirname + "/RenderProps/react-context2.js"); +}); + +it("React Context 3", async () => { + await runTest(__dirname + "/RenderProps/react-context3.js"); +}); + +it("React Context 4", async () => { + await runTest(__dirname + "/RenderProps/react-context4.js"); +}); + +it("React Context 5", async () => { + await runTest(__dirname + "/RenderProps/react-context5.js"); +}); + +it("React Context 6", async () => { + await runTest(__dirname + "/RenderProps/react-context6.js"); +}); + +it("React Context 7", async () => { + await runTest(__dirname + "/RenderProps/react-context7.js"); +}); + +it("React Context from root tree", async () => { + await runTest(__dirname + "/RenderProps/react-root-context.js"); +}); + +it("React Context from root tree 2", async () => { + await runTest(__dirname + "/RenderProps/react-root-context2.js"); +}); + +it("React Context from root tree 3", async () => { + await runTest(__dirname + "/RenderProps/react-root-context3.js"); +}); + +it("React Context from root tree 4", async () => { + await runTest(__dirname + "/RenderProps/react-root-context4.js"); +}); diff --git a/test/react/render-props/react-context.js b/test/react/RenderProps/react-context.js similarity index 100% rename from test/react/render-props/react-context.js rename to test/react/RenderProps/react-context.js diff --git a/test/react/render-props/react-context2.js b/test/react/RenderProps/react-context2.js similarity index 100% rename from test/react/render-props/react-context2.js rename to test/react/RenderProps/react-context2.js diff --git a/test/react/render-props/react-context3.js b/test/react/RenderProps/react-context3.js similarity index 100% rename from test/react/render-props/react-context3.js rename to test/react/RenderProps/react-context3.js diff --git a/test/react/render-props/react-context4.js b/test/react/RenderProps/react-context4.js similarity index 100% rename from test/react/render-props/react-context4.js rename to test/react/RenderProps/react-context4.js diff --git a/test/react/render-props/react-context5.js b/test/react/RenderProps/react-context5.js similarity index 100% rename from test/react/render-props/react-context5.js rename to test/react/RenderProps/react-context5.js diff --git a/test/react/render-props/react-context6.js b/test/react/RenderProps/react-context6.js similarity index 100% rename from test/react/render-props/react-context6.js rename to test/react/RenderProps/react-context6.js diff --git a/test/react/render-props/react-context7.js b/test/react/RenderProps/react-context7.js similarity index 100% rename from test/react/render-props/react-context7.js rename to test/react/RenderProps/react-context7.js diff --git a/test/react/render-props/react-root-context.js b/test/react/RenderProps/react-root-context.js similarity index 100% rename from test/react/render-props/react-root-context.js rename to test/react/RenderProps/react-root-context.js diff --git a/test/react/render-props/react-root-context2.js b/test/react/RenderProps/react-root-context2.js similarity index 100% rename from test/react/render-props/react-root-context2.js rename to test/react/RenderProps/react-root-context2.js diff --git a/test/react/render-props/react-root-context3.js b/test/react/RenderProps/react-root-context3.js similarity index 100% rename from test/react/render-props/react-root-context3.js rename to test/react/RenderProps/react-root-context3.js diff --git a/test/react/render-props/react-root-context4.js b/test/react/RenderProps/react-root-context4.js similarity index 100% rename from test/react/render-props/react-root-context4.js rename to test/react/RenderProps/react-root-context4.js diff --git a/test/react/render-props/relay-query-renderer.js b/test/react/RenderProps/relay-query-renderer.js similarity index 100% rename from test/react/render-props/relay-query-renderer.js rename to test/react/RenderProps/relay-query-renderer.js diff --git a/test/react/render-props/relay-query-renderer2.js b/test/react/RenderProps/relay-query-renderer2.js similarity index 100% rename from test/react/render-props/relay-query-renderer2.js rename to test/react/RenderProps/relay-query-renderer2.js diff --git a/test/react/render-props/relay-query-renderer3.js b/test/react/RenderProps/relay-query-renderer3.js similarity index 100% rename from test/react/render-props/relay-query-renderer3.js rename to test/react/RenderProps/relay-query-renderer3.js diff --git a/test/react/ServerRendering-test.js b/test/react/ServerRendering-test.js new file mode 100644 index 0000000000..90c76fbd49 --- /dev/null +++ b/test/react/ServerRendering-test.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const fs = require("fs"); +const prepareReactTests = require("./prepareReactTests"); +const { runTest } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { it } = global; + +it("Hacker News app", async () => { + let data = JSON.parse(fs.readFileSync(__dirname + "/ServerRendering/hacker-news.json").toString()); + await runTest(__dirname + "/ServerRendering/hacker-news.js", false, data); +}); diff --git a/test/react/server-rendering/hacker-news.js b/test/react/ServerRendering/hacker-news.js similarity index 100% rename from test/react/server-rendering/hacker-news.js rename to test/react/ServerRendering/hacker-news.js diff --git a/test/react/server-rendering/hacker-news.json b/test/react/ServerRendering/hacker-news.json similarity index 100% rename from test/react/server-rendering/hacker-news.json rename to test/react/ServerRendering/hacker-news.json diff --git a/test/react/__snapshots__/ClassComponents-test.js.snap b/test/react/__snapshots__/ClassComponents-test.js.snap new file mode 100644 index 0000000000..87226d04a5 --- /dev/null +++ b/test/react/__snapshots__/ClassComponents-test.js.snap @@ -0,0 +1,1465 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Classes with state 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Classes with state 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Classes with state 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Classes with state 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Complex class components folding into functional root component #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 12, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 12, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 12, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 12, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #5 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #5 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #5 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component #5 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Complex class components folding into functional root component 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Inheritance chaining 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Inheritance chaining 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Inheritance chaining 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Inheritance chaining 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple classes #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple classes #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple classes #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple classes 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple classes with Array.from 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/FBMocks-test.js.snap b/test/react/__snapshots__/FBMocks-test.js.snap new file mode 100644 index 0000000000..d558769193 --- /dev/null +++ b/test/react/__snapshots__/FBMocks-test.js.snap @@ -0,0 +1,2691 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Function bind 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Function bind 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Function bind 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Function bind 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Hacker News app 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "HeaderBar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "Story", + "status": "INLINED", + }, + ], + "message": "", + "name": "StoryList", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "AppBody", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Hacker News app 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "HeaderBar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "Story", + "status": "INLINED", + }, + ], + "message": "", + "name": "StoryList", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "AppBody", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Hacker News app 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "HeaderBar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "Story", + "status": "INLINED", + }, + ], + "message": "", + "name": "StoryList", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "AppBody", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Hacker News app 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "HeaderBar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "Story", + "status": "INLINED", + }, + ], + "message": "", + "name": "StoryList", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "AppBody", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Hello", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Hello", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Hello", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Hello", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 7 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 7 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 7 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 7 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 8 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`fb-www 8 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`fb-www 8 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`fb-www 8 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`fb-www 9 1`] = ` +ReactStatistics { + "componentsEvaluated": 9, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 9 2`] = ` +ReactStatistics { + "componentsEvaluated": 9, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 9 3`] = ` +ReactStatistics { + "componentsEvaluated": 9, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 9 4`] = ` +ReactStatistics { + "componentsEvaluated": 9, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 10 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 10 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 10 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 10 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 11 1`] = ` +ReactStatistics { + "componentsEvaluated": 13, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 9, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 11 2`] = ` +ReactStatistics { + "componentsEvaluated": 13, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 9, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 11 3`] = ` +ReactStatistics { + "componentsEvaluated": 13, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 9, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 11 4`] = ` +ReactStatistics { + "componentsEvaluated": 13, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 9, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 13 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 13 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 13 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 13 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`fb-www 14 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 14 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 14 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 14 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "RelayContainer", + "name": "WrappedApp", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; + +exports[`fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; + +exports[`fb-www 17 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Inner", + "status": "INLINED", + }, + ], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "Outer", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 17 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Inner", + "status": "INLINED", + }, + ], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "Outer", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 17 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Inner", + "status": "INLINED", + }, + ], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "Outer", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 17 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Inner", + "status": "INLINED", + }, + ], + "message": "", + "name": "Middle", + "status": "INLINED", + }, + ], + "message": "", + "name": "Outer", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 20 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 20 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 20 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 20 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 21 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 21 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 21 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 21 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 22 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 22 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 22 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 22 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 23 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 23 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 23 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`fb-www 23 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`repl example 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Foo", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`repl example 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Foo", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`repl example 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Foo", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`repl example 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Yar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "Foo", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/FactoryComponents-test.js.snap b/test/react/__snapshots__/FactoryComponents-test.js.snap new file mode 100644 index 0000000000..7df3d19bd8 --- /dev/null +++ b/test/react/__snapshots__/FactoryComponents-test.js.snap @@ -0,0 +1,165 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Simple factory classes 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "FactoryComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple factory classes 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "FactoryComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple factory classes 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple factory classes 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple factory classes 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple factory classes 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple factory classes 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "FactoryComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple factory classes 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "FactoryComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/FirstRenderOnly-test.js.snap b/test/react/__snapshots__/FirstRenderOnly-test.js.snap new file mode 100644 index 0000000000..257ba8a4e1 --- /dev/null +++ b/test/react/__snapshots__/FirstRenderOnly-test.js.snap @@ -0,0 +1,2693 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`React Context 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Replace this in callbacks 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Simple 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`componentWillMount 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`componentWillMount 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`componentWillMount 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`componentWillMount 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child3", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child1", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/FunctionalComponents-test.js.snap b/test/react/__snapshots__/FunctionalComponents-test.js.snap new file mode 100644 index 0000000000..0168b2603e --- /dev/null +++ b/test/react/__snapshots__/FunctionalComponents-test.js.snap @@ -0,0 +1,10464 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`__reactCompilerDoNotOptimize 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`__reactCompilerDoNotOptimize 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`__reactCompilerDoNotOptimize 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`__reactCompilerDoNotOptimize 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`16.3 refs 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`16.3 refs 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`16.3 refs 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`16.3 refs 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`16.3 refs 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "", + "status": "FORWARD_REF", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Additional functions closure scope capturing 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Additional functions closure scope capturing 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Additional functions closure scope capturing 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Additional functions closure scope capturing 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Circular reference 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Circular reference 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Circular reference 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Circular reference 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with instance variables 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with multiple render methods 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with multiple render methods 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with multiple render methods 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with multiple render methods 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with props 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with props 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with props 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with props 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with refs 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with refs 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with refs 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with refs 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with state 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with state 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with state 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Class component as root with state 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 1`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 2`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Conditional 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Conditional 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Conditional 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Conditional 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Delete element prop key 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Delete element prop key 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Delete element prop key 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Delete element prop key 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic ReactElement type 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic context 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic context 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic context 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic context 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SubChild", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic props 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Fn", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic props 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Fn", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic props 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Fn", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Dynamic props 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Fn", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Equivalence 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Equivalence 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Equivalence 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Equivalence 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Event handlers 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Event handlers 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Event handlers 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Event handlers 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays from Array.from 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays from Array.from 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays from Array.from 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Handle mapped arrays from Array.from 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Havocing of ReactElements should not result in property assignments 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Havocing of ReactElements should not result in property assignments 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Havocing of ReactElements should not result in property assignments 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Havocing of ReactElements should not result in property assignments 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key change 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 1`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 2`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 4`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Lazy branched elements 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; + +exports[`Mutations - not-safe 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - not-safe 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - not-safe 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - not-safe 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; + +exports[`Mutations - safe 1 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 1 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 1 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 1 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Mutations - safe 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Null or undefined props 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Null or undefined props 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Null or undefined props 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Null or undefined props 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React.cloneElement 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "Override", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React.cloneElement 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "Override", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React.cloneElement 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "Override", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React.cloneElement 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "MaybeShow", + "status": "INLINED", + }, + ], + "message": "", + "name": "Override", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render array twice 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render array twice 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render array twice 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render array twice 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render nested array children 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render nested array children 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render nested array children 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Render nested array children 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return text 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return text 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return text 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return text 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return undefined 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "undefined was returned from render", + "name": "A", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return undefined 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "undefined was returned from render", + "name": "A", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return undefined 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "undefined was returned from render", + "name": "A", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Return undefined 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "undefined was returned from render", + "name": "A", + "status": "BAIL-OUT", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 3, +} +`; + +exports[`Simple 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 3, +} +`; + +exports[`Simple 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 3, +} +`; + +exports[`Simple 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 3, +} +`; + +exports[`Simple 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 7 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 7 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 7 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 7 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 12 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Author", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 12 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Author", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 12 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Author", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 12 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Author", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 14 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 14 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 14 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 14 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 15 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 15 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 15 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 15 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 16 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 16 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 16 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 16 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 17 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 17 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 17 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 17 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 18 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 18 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 18 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 18 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 19 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 19 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 19 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 19 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 20 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 20 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 20 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 20 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 21 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 21 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 21 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple 21 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple children 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple children 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple children 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple children 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple fragments 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple fragments 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple fragments 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple fragments 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple refs 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple refs 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple refs 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple refs 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with abstract props 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with abstract props 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with abstract props 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with abstract props 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #13 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with new expression 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with new expression 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with new expression 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with new expression 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with unary expressions 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with unary expressions 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with unary expressions 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with unary expressions 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Two roots 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Two roots 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Two roots 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Two roots 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "ROOT", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Unsafe spread 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Unsafe spread 2`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; + +exports[`defaultProps 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`defaultProps 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`defaultProps 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`defaultProps 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/ReactDOM-test.js.snap b/test/react/__snapshots__/ReactDOM-test.js.snap new file mode 100644 index 0000000000..dc7bf9930f --- /dev/null +++ b/test/react/__snapshots__/ReactDOM-test.js.snap @@ -0,0 +1,153 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`createPortal 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "ReactDOM.createPortal", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`createPortal 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "ReactDOM.createPortal", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`createPortal 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "ReactDOM.createPortal", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`createPortal 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "ReactDOM.createPortal", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/RenderProps-test.js.snap b/test/react/__snapshots__/RenderProps-test.js.snap new file mode 100644 index 0000000000..ae76c525a7 --- /dev/null +++ b/test/react/__snapshots__/RenderProps-test.js.snap @@ -0,0 +1,2305 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`React Context 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context 7 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 7 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 7 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context 7 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 1`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 5, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 2`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 5, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 3`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 5, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 7, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 6, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 5, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SomeClassThatShouldNotMakeRootAClass", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 2, +} +`; + +exports[`Relay QueryRenderer 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SomeClassThatShouldNotMakeRootAClass", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 2, +} +`; + +exports[`Relay QueryRenderer 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SomeClassThatShouldNotMakeRootAClass", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 2, +} +`; + +exports[`Relay QueryRenderer 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "SomeClassThatShouldNotMakeRootAClass", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 2, +} +`; + +exports[`Relay QueryRenderer 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; diff --git a/test/react/__snapshots__/ServerRendering-test.js.snap b/test/react/__snapshots__/ServerRendering-test.js.snap new file mode 100644 index 0000000000..bdd6f76c77 --- /dev/null +++ b/test/react/__snapshots__/ServerRendering-test.js.snap @@ -0,0 +1,41 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Hacker News app 1`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`Hacker News app 2`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`Hacker News app 3`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; + +exports[`Hacker News app 4`] = ` +ReactStatistics { + "componentsEvaluated": 0, + "evaluatedRootNodes": Array [], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 0, +} +`; diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js new file mode 100644 index 0000000000..e992329782 --- /dev/null +++ b/test/react/prepareReactTests.js @@ -0,0 +1,286 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +let fs = require("fs"); +let path = require("path"); +let { prepackSources } = require("../../lib/prepack-node.js"); +let babel = require("babel-core"); +let React = require("react"); +let ReactDOM = require("react-dom"); +let ReactDOMServer = require("react-dom/server"); +let PropTypes = require("prop-types"); +let ReactRelay = require("react-relay"); +let ReactTestRenderer = require("react-test-renderer"); +let { mergeAdjacentJSONTextNodes } = require("../../lib/utils/json.js"); + +/* eslint-disable no-undef */ +const { expect } = global; + +// Patch console.error to reduce the noise +let originalConsoleError = global.console.error; +let excludeErrorsContaining = [ + "Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null", + "Consider adding an error boundary to your tree to customize error handling behavior.", + "Warning:", +]; +global.console.error = function(...args) { + let text = args[0]; + + if (typeof text === "string") { + for (let excludeError of excludeErrorsContaining) { + if (text.indexOf(excludeError) !== -1) { + return; + } + } + } + originalConsoleError.apply(this, args); +}; + +function cxShim(...args) { + let classNames = []; + for (let arg of args) { + if (typeof arg === "string") { + classNames.push(arg); + } else if (typeof arg === "object" && arg !== null) { + let keys = Object.keys(arg); + for (let key of keys) { + if (arg[key]) { + classNames.push(key); + } + } + } + } + return classNames.join(" "); +} +global.cx = cxShim; +function MockURI(url) { + this.url = url; +} +MockURI.prototype.addQueryData = function() { + this.url += "&queryData"; + return this; +}; +MockURI.prototype.makeString = function() { + return this.url; +}; + +function prepareReactTests() { + let checkForReconcilerFatalError = false; + let checkForPartialKeyOrRefError = false; + let errorsCaptured = []; + let reactTestRoot = path.join(__dirname, "../test/react/"); + + async function expectReconcilerFatalError(func: Function) { + checkForReconcilerFatalError = true; + try { + await func(); + } catch (e) { + expect(e.__isReconcilerFatalError).toBe(true); + expect(e.message).toMatchSnapshot(); + } finally { + checkForReconcilerFatalError = false; + } + } + + async function expectPartialKeyOrRefError(func: Function) { + checkForPartialKeyOrRefError = true; + try { + await func(); + } catch (e) { + expect(e.__isReconcilerFatalError).toBe(true); + expect(e.message).toMatchSnapshot(); + } finally { + checkForPartialKeyOrRefError = false; + } + } + + function compileSourceWithPrepack(source, useJSXOutput) { + let code = `(function(){${source}})()`; + let prepackOptions = { + errorHandler: diag => { + errorsCaptured.push(diag); + if (diag.severity !== "Warning" && diag.severity !== "Information") { + if (diag.errorCode === "PP0025" && !checkForPartialKeyOrRefError) { + // recover from `unable to evaluate "key" and "ref" on a ReactElement + return "Recover"; + } + return "Fail"; + } + return "Recover"; + }, + compatibility: "fb-www", + internalDebug: true, + serialize: true, + uniqueSuffix: "", + maxStackDepth: 100, + reactEnabled: true, + reactOutput: useJSXOutput ? "jsx" : "create-element", + reactOptimizeNestedFunctions: true, + inlineExpressions: true, + invariantLevel: 0, + stripFlow: true, + }; + let serialized; + errorsCaptured = []; + try { + serialized = prepackSources([{ filePath: "", fileContents: code, sourceMapContents: "" }], prepackOptions); + } catch (e) { + if (e.__isReconcilerFatalError && (checkForReconcilerFatalError || checkForPartialKeyOrRefError)) { + throw e; + } + errorsCaptured.forEach(error => { + console.error(error); + }); + throw e; + } + if (serialized == null || serialized.reactStatistics == null) { + throw new Error("React test runner failed during serialization"); + } + return { + compiledSource: serialized.code, + statistics: serialized.reactStatistics, + }; + } + + function transpileSource(source) { + return babel.transform(source, { + presets: ["babel-preset-react"], + plugins: ["transform-object-rest-spread"], + }).code; + } + + function runSource(source) { + let transformedSource = transpileSource(source); + /* eslint-disable no-new-func */ + let fn = new Function("require", "module", transformedSource); + let moduleShim = { exports: null }; + let requireShim = name => { + switch (name) { + case "React": + case "react": + return React; + case "react-dom": + case "ReactDOM": + return ReactDOM; + case "react-dom/server": + case "ReactDOMServer": + return ReactDOMServer; + case "PropTypes": + case "prop-types": + return PropTypes; + case "RelayModern": + return ReactRelay; + case "cx": + return cxShim; + case "FBEnvironment": + return {}; + case "URI": + return MockURI; + default: + throw new Error(`Unrecognized import: "${name}".`); + } + }; + + try { + // $FlowFixMe flow doesn't new Function + fn(requireShim, moduleShim); + } catch (e) { + console.error(transformedSource); + throw e; + } + return moduleShim.exports; + } + + async function stubReactRelay(f: Function) { + let oldReactRelay = ReactRelay; + ReactRelay = { + QueryRenderer(props) { + return props.render({ props: {}, error: null }); + }, + createFragmentContainer() { + return null; + }, + graphql() { + return null; + }, + }; + try { + await f(); + } finally { + ReactRelay = oldReactRelay; + } + } + + async function runTestWithOptions(fixturePath, firstRenderOnly, data, useJSXInput, useJSXOutput) { + let source = fs.readFileSync(fixturePath).toString(); + if (useJSXInput) { + source = transpileSource(source); + } + let { compiledSource, statistics } = compileSourceWithPrepack(source); + + expect(statistics).toMatchSnapshot(); + let A = runSource(source); + let B = runSource(compiledSource); + + expect(typeof A).toBe(typeof B); + if (typeof A !== "function") { + // Test without exports just verifies that the file compiles. + return; + } + + let config = { + createNodeMock(x) { + return x; + }, + }; + let rendererA = ReactTestRenderer.create(null, config); + let rendererB = ReactTestRenderer.create(null, config); + if (A == null || B == null) { + throw new Error("React test runner issue"); + } + // Use the original version of the test in case transforming messes it up. + let { getTrials: getTrialsA, independent } = A; + let { getTrials: getTrialsB } = B; + // Run tests that assert the rendered output matches. + let resultA = getTrialsA(rendererA, A, data); + let resultB = independent ? getTrialsB(rendererB, B, data) : getTrialsA(rendererB, B, data); + + // The test has returned many values for us to check + for (let i = 0; i < resultA.length; i++) { + let [nameA, valueA] = resultA[i]; + let [nameB, valueB] = resultB[i]; + if (typeof valueA === "string" && typeof valueB === "string") { + expect(valueA).toBe(valueB); + } else { + expect(mergeAdjacentJSONTextNodes(valueB, firstRenderOnly)).toEqual( + mergeAdjacentJSONTextNodes(valueA, firstRenderOnly) + ); + } + expect(nameB).toEqual(nameA); + } + } + + async function runTest(fixturePath: string, firstRenderOnly?: boolean = false, data?: mixed) { + await runTestWithOptions(fixturePath, firstRenderOnly, data, true, false); + await runTestWithOptions(fixturePath, firstRenderOnly, data, false, false); + await runTestWithOptions(fixturePath, firstRenderOnly, data, true, true); + await runTestWithOptions(fixturePath, firstRenderOnly, data, false, true); + } + + return { + expectReconcilerFatalError, + expectPartialKeyOrRefError, + runTest, + stubReactRelay, + }; +} + +module.exports = prepareReactTests; From 7e7aa350c0d5206deb7f12a88f2ff82ce9aef6e4 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 29 Jun 2018 22:16:35 +0100 Subject: [PATCH 02/22] Put reconciliation tests in a separate folder --- test/react/FunctionalComponents-test.js | 121 - test/react/Reconciliation-test.js | 138 + .../key-change-fragments.js | 0 .../key-change.js | 0 .../key-nesting-2.js | 0 .../key-nesting-3.js | 0 .../key-nesting.js | 0 .../key-not-change-fragments.js | 0 .../lazy-branched-elements.js | 0 .../lazy-branched-elements2.js | 0 .../type-change.js | 0 .../type-change10.js | 0 .../type-change11.js | 0 .../type-change2.js | 0 .../type-change3.js | 0 .../type-change4.js | 0 .../type-change5.js | 0 .../type-change6.js | 0 .../type-change7.js | 0 .../type-change8.js | 0 .../type-change9.js | 0 .../type-same.js | 0 .../FunctionalComponents-test.js.snap | 3166 ++--------------- .../__snapshots__/Reconciliation-test.js.snap | 2589 ++++++++++++++ 24 files changed, 3016 insertions(+), 2998 deletions(-) create mode 100644 test/react/Reconciliation-test.js rename test/react/{FunctionalComponents => Reconciliation}/key-change-fragments.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/key-change.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/key-nesting-2.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/key-nesting-3.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/key-nesting.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/key-not-change-fragments.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/lazy-branched-elements.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/lazy-branched-elements2.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change10.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change11.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change2.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change3.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change4.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change5.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change6.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change7.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change8.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-change9.js (100%) rename test/react/{FunctionalComponents => Reconciliation}/type-same.js (100%) create mode 100644 test/react/__snapshots__/Reconciliation-test.js.snap diff --git a/test/react/FunctionalComponents-test.js b/test/react/FunctionalComponents-test.js index 64408347fb..925b47f37c 100644 --- a/test/react/FunctionalComponents-test.js +++ b/test/react/FunctionalComponents-test.js @@ -296,22 +296,6 @@ it("Conditional", async () => { await runTest(__dirname + "/FunctionalComponents/conditional.js"); }); -it("Key nesting", async () => { - await runTest(__dirname + "/FunctionalComponents/key-nesting.js"); -}); - -it("Key nesting 2", async () => { - await runTest(__dirname + "/FunctionalComponents/key-nesting-2.js"); -}); - -it("Key nesting 3", async () => { - await runTest(__dirname + "/FunctionalComponents/key-nesting-3.js"); -}); - -it("Key change", async () => { - await runTest(__dirname + "/FunctionalComponents/key-change.js"); -}); - it("Equivalence", async () => { let createElement = React.createElement; let count = 0; @@ -340,62 +324,6 @@ it("Delete element prop key", async () => { await runTest(__dirname + "/FunctionalComponents/delete-element-prop-key.js"); }); -it("Key change with fragments", async () => { - await runTest(__dirname + "/FunctionalComponents/key-change-fragments.js"); -}); - -it("Key not changing with fragments", async () => { - await runTest(__dirname + "/FunctionalComponents/key-not-change-fragments.js"); -}); - -it("Component type change", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change.js"); -}); - -it("Component type change 2", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change2.js"); -}); - -it("Component type change 3", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change3.js"); -}); - -it("Component type change 4", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change4.js"); -}); - -it("Component type change 5", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change5.js"); -}); - -it("Component type change 6", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change6.js"); -}); - -it("Component type change 7", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change7.js"); -}); - -it("Component type change 8", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change8.js"); -}); - -it("Component type change 9", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change9.js"); -}); - -it("Component type change 10", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change10.js"); -}); - -it("Component type change 11", async () => { - await runTest(__dirname + "/FunctionalComponents/type-change11.js"); -}); - -it("Component type same", async () => { - await runTest(__dirname + "/FunctionalComponents/type-same.js"); -}); - it("Dynamic props", async () => { await runTest(__dirname + "/FunctionalComponents/dynamic-props.js"); }); @@ -479,52 +407,3 @@ it("Dynamic ReactElement type #3", async () => { it("Dynamic ReactElement type #4", async () => { await runTest(__dirname + "/FunctionalComponents/dynamic-type4.js"); }); - -it("Lazy branched elements", async () => { - let createElement = React.createElement; - let count = 0; - // For this test we want to also check how React.createElement - // calls occur so we can validate that we are correctly using - // lazy branched elements. To do this, we override the createElement - // call and increment a counter for ever call. - - // $FlowFixMe: intentional for this test - React.createElement = (type, config) => { - count++; - return createElement(type, config); - }; - try { - await runTest(__dirname + "/FunctionalComponents/lazy-branched-elements.js"); - } finally { - // $FlowFixMe: intentional for this test - React.createElement = createElement; - } - // The non-Prepacked version has 4 calls, the Prepacked one should have 4 calls. - // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). - expect(count).toEqual(8 * 4); -}); - -it("Lazy branched elements 2", async () => { - let createElement = React.createElement; - let count = 0; - // For this test we want to also check how React.createElement - // calls occur so we can validate that we are correctly using - // lazy branched elements. To do this, we override the createElement - // call and increment a counter for ever call. - - // $FlowFixMe: intentional for this test - React.createElement = (type, config) => { - count++; - return createElement(type, config); - }; - try { - await runTest(__dirname + "/FunctionalComponents/lazy-branched-elements2.js"); - } finally { - // $FlowFixMe: intentional for this test - React.createElement = createElement; - } - // The non-Prepacked version has 4 calls, the Prepacked one should have 3 calls - // (3 because one of the calls has been removing by inlining). - // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). - expect(count).toEqual(7 * 4); -}); diff --git a/test/react/Reconciliation-test.js b/test/react/Reconciliation-test.js new file mode 100644 index 0000000000..09faa0555a --- /dev/null +++ b/test/react/Reconciliation-test.js @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const React = require("react"); +const prepareReactTests = require("./prepareReactTests"); +const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { expect, it } = global; + +it("Key nesting", async () => { + await runTest(__dirname + "/Reconciliation/key-nesting.js"); +}); + +it("Key nesting 2", async () => { + await runTest(__dirname + "/Reconciliation/key-nesting-2.js"); +}); + +it("Key nesting 3", async () => { + await runTest(__dirname + "/Reconciliation/key-nesting-3.js"); +}); + +it("Key change", async () => { + await runTest(__dirname + "/Reconciliation/key-change.js"); +}); + +it("Key change with fragments", async () => { + await runTest(__dirname + "/Reconciliation/key-change-fragments.js"); +}); + +it("Key not changing with fragments", async () => { + await runTest(__dirname + "/Reconciliation/key-not-change-fragments.js"); +}); + +it("Component type change", async () => { + await runTest(__dirname + "/Reconciliation/type-change.js"); +}); + +it("Component type change 2", async () => { + await runTest(__dirname + "/Reconciliation/type-change2.js"); +}); + +it("Component type change 3", async () => { + await runTest(__dirname + "/Reconciliation/type-change3.js"); +}); + +it("Component type change 4", async () => { + await runTest(__dirname + "/Reconciliation/type-change4.js"); +}); + +it("Component type change 5", async () => { + await runTest(__dirname + "/Reconciliation/type-change5.js"); +}); + +it("Component type change 6", async () => { + await runTest(__dirname + "/Reconciliation/type-change6.js"); +}); + +it("Component type change 7", async () => { + await runTest(__dirname + "/Reconciliation/type-change7.js"); +}); + +it("Component type change 8", async () => { + await runTest(__dirname + "/Reconciliation/type-change8.js"); +}); + +it("Component type change 9", async () => { + await runTest(__dirname + "/Reconciliation/type-change9.js"); +}); + +it("Component type change 10", async () => { + await runTest(__dirname + "/Reconciliation/type-change10.js"); +}); + +it("Component type change 11", async () => { + await runTest(__dirname + "/Reconciliation/type-change11.js"); +}); + +it("Component type same", async () => { + await runTest(__dirname + "/Reconciliation/type-same.js"); +}); + +it("Lazy branched elements", async () => { + let createElement = React.createElement; + let count = 0; + // For this test we want to also check how React.createElement + // calls occur so we can validate that we are correctly using + // lazy branched elements. To do this, we override the createElement + // call and increment a counter for ever call. + + // $FlowFixMe: intentional for this test + React.createElement = (type, config) => { + count++; + return createElement(type, config); + }; + try { + await runTest(__dirname + "/Reconciliation/lazy-branched-elements.js"); + } finally { + // $FlowFixMe: intentional for this test + React.createElement = createElement; + } + // The non-Prepacked version has 4 calls, the Prepacked one should have 4 calls. + // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). + expect(count).toEqual(8 * 4); +}); + +it("Lazy branched elements 2", async () => { + let createElement = React.createElement; + let count = 0; + // For this test we want to also check how React.createElement + // calls occur so we can validate that we are correctly using + // lazy branched elements. To do this, we override the createElement + // call and increment a counter for ever call. + + // $FlowFixMe: intentional for this test + React.createElement = (type, config) => { + count++; + return createElement(type, config); + }; + try { + await runTest(__dirname + "/Reconciliation/lazy-branched-elements2.js"); + } finally { + // $FlowFixMe: intentional for this test + React.createElement = createElement; + } + // The non-Prepacked version has 4 calls, the Prepacked one should have 3 calls + // (3 because one of the calls has been removing by inlining). + // Multiplied by 4 because every test runs in four modes (JSX/createElement input and output). + expect(count).toEqual(7 * 4); +}); diff --git a/test/react/FunctionalComponents/key-change-fragments.js b/test/react/Reconciliation/key-change-fragments.js similarity index 100% rename from test/react/FunctionalComponents/key-change-fragments.js rename to test/react/Reconciliation/key-change-fragments.js diff --git a/test/react/FunctionalComponents/key-change.js b/test/react/Reconciliation/key-change.js similarity index 100% rename from test/react/FunctionalComponents/key-change.js rename to test/react/Reconciliation/key-change.js diff --git a/test/react/FunctionalComponents/key-nesting-2.js b/test/react/Reconciliation/key-nesting-2.js similarity index 100% rename from test/react/FunctionalComponents/key-nesting-2.js rename to test/react/Reconciliation/key-nesting-2.js diff --git a/test/react/FunctionalComponents/key-nesting-3.js b/test/react/Reconciliation/key-nesting-3.js similarity index 100% rename from test/react/FunctionalComponents/key-nesting-3.js rename to test/react/Reconciliation/key-nesting-3.js diff --git a/test/react/FunctionalComponents/key-nesting.js b/test/react/Reconciliation/key-nesting.js similarity index 100% rename from test/react/FunctionalComponents/key-nesting.js rename to test/react/Reconciliation/key-nesting.js diff --git a/test/react/FunctionalComponents/key-not-change-fragments.js b/test/react/Reconciliation/key-not-change-fragments.js similarity index 100% rename from test/react/FunctionalComponents/key-not-change-fragments.js rename to test/react/Reconciliation/key-not-change-fragments.js diff --git a/test/react/FunctionalComponents/lazy-branched-elements.js b/test/react/Reconciliation/lazy-branched-elements.js similarity index 100% rename from test/react/FunctionalComponents/lazy-branched-elements.js rename to test/react/Reconciliation/lazy-branched-elements.js diff --git a/test/react/FunctionalComponents/lazy-branched-elements2.js b/test/react/Reconciliation/lazy-branched-elements2.js similarity index 100% rename from test/react/FunctionalComponents/lazy-branched-elements2.js rename to test/react/Reconciliation/lazy-branched-elements2.js diff --git a/test/react/FunctionalComponents/type-change.js b/test/react/Reconciliation/type-change.js similarity index 100% rename from test/react/FunctionalComponents/type-change.js rename to test/react/Reconciliation/type-change.js diff --git a/test/react/FunctionalComponents/type-change10.js b/test/react/Reconciliation/type-change10.js similarity index 100% rename from test/react/FunctionalComponents/type-change10.js rename to test/react/Reconciliation/type-change10.js diff --git a/test/react/FunctionalComponents/type-change11.js b/test/react/Reconciliation/type-change11.js similarity index 100% rename from test/react/FunctionalComponents/type-change11.js rename to test/react/Reconciliation/type-change11.js diff --git a/test/react/FunctionalComponents/type-change2.js b/test/react/Reconciliation/type-change2.js similarity index 100% rename from test/react/FunctionalComponents/type-change2.js rename to test/react/Reconciliation/type-change2.js diff --git a/test/react/FunctionalComponents/type-change3.js b/test/react/Reconciliation/type-change3.js similarity index 100% rename from test/react/FunctionalComponents/type-change3.js rename to test/react/Reconciliation/type-change3.js diff --git a/test/react/FunctionalComponents/type-change4.js b/test/react/Reconciliation/type-change4.js similarity index 100% rename from test/react/FunctionalComponents/type-change4.js rename to test/react/Reconciliation/type-change4.js diff --git a/test/react/FunctionalComponents/type-change5.js b/test/react/Reconciliation/type-change5.js similarity index 100% rename from test/react/FunctionalComponents/type-change5.js rename to test/react/Reconciliation/type-change5.js diff --git a/test/react/FunctionalComponents/type-change6.js b/test/react/Reconciliation/type-change6.js similarity index 100% rename from test/react/FunctionalComponents/type-change6.js rename to test/react/Reconciliation/type-change6.js diff --git a/test/react/FunctionalComponents/type-change7.js b/test/react/Reconciliation/type-change7.js similarity index 100% rename from test/react/FunctionalComponents/type-change7.js rename to test/react/Reconciliation/type-change7.js diff --git a/test/react/FunctionalComponents/type-change8.js b/test/react/Reconciliation/type-change8.js similarity index 100% rename from test/react/FunctionalComponents/type-change8.js rename to test/react/Reconciliation/type-change8.js diff --git a/test/react/FunctionalComponents/type-change9.js b/test/react/Reconciliation/type-change9.js similarity index 100% rename from test/react/FunctionalComponents/type-change9.js rename to test/react/Reconciliation/type-change9.js diff --git a/test/react/FunctionalComponents/type-same.js b/test/react/Reconciliation/type-same.js similarity index 100% rename from test/react/FunctionalComponents/type-same.js rename to test/react/Reconciliation/type-same.js diff --git a/test/react/__snapshots__/FunctionalComponents-test.js.snap b/test/react/__snapshots__/FunctionalComponents-test.js.snap index 0168b2603e..fa8d9c803c 100644 --- a/test/react/__snapshots__/FunctionalComponents-test.js.snap +++ b/test/react/__snapshots__/FunctionalComponents-test.js.snap @@ -1472,36 +1472,16 @@ ReactStatistics { } `; -exports[`Component type change 1`] = ` +exports[`Conditional 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "MaybeShow", "status": "INLINED", }, ], @@ -1510,42 +1490,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Component type change 2`] = ` +exports[`Conditional 2`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "MaybeShow", "status": "INLINED", }, ], @@ -1554,28 +1514,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Component type change 2 1`] = ` +exports[`Conditional 3`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", + "name": "MaybeShow", "status": "INLINED", }, ], @@ -1584,28 +1538,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 2 2`] = ` +exports[`Conditional 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", + "name": "MaybeShow", "status": "INLINED", }, ], @@ -1614,28 +1562,34 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 2 3`] = ` +exports[`Delete element prop key 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", + "name": "A", "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Bar", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", "status": "INLINED", }, ], @@ -1644,28 +1598,34 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 2 4`] = ` +exports[`Delete element prop key 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", + "name": "A", "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Bar", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", "status": "INLINED", }, ], @@ -1674,42 +1634,34 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 3`] = ` +exports[`Delete element prop key 3`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "MessagePane", + "name": "A", "status": "INLINED", }, Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "C", "status": "INLINED", }, ], @@ -1718,28 +1670,34 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Component type change 3 1`] = ` +exports[`Delete element prop key 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", + "name": "A", "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Foo", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", "status": "INLINED", }, ], @@ -1748,15 +1706,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 3 2`] = ` +exports[`Dynamic ReactElement type #2 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1769,7 +1727,13 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", "status": "INLINED", }, ], @@ -1778,15 +1742,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 3 3`] = ` +exports[`Dynamic ReactElement type #2 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1799,7 +1763,13 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", "status": "INLINED", }, ], @@ -1808,15 +1778,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 3 4`] = ` +exports[`Dynamic ReactElement type #2 3`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1829,7 +1799,13 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", "status": "INLINED", }, ], @@ -1838,42 +1814,34 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 4`] = ` +exports[`Dynamic ReactElement type #2 4`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "MessagePane", + "name": "Foo", "status": "INLINED", }, Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "Bar", "status": "INLINED", }, ], @@ -1882,15 +1850,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 3, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Component type change 4 1`] = ` +exports[`Dynamic ReactElement type #3 1`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1903,19 +1871,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -1924,15 +1880,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 4 2`] = ` +exports[`Dynamic ReactElement type #3 2`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1945,19 +1901,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -1966,15 +1910,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 4 3`] = ` +exports[`Dynamic ReactElement type #3 3`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1987,19 +1931,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2008,15 +1940,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 4 4`] = ` +exports[`Dynamic ReactElement type #3 4`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2029,19 +1961,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2050,15 +1970,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 5 1`] = ` +exports[`Dynamic ReactElement type #4 1`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2068,39 +1988,21 @@ ReactStatistics { "name": "Foo", "status": "INLINED", }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 5 2`] = ` +exports[`Dynamic ReactElement type #4 2`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2110,39 +2012,21 @@ ReactStatistics { "name": "Foo", "status": "INLINED", }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 5 3`] = ` +exports[`Dynamic ReactElement type #4 3`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2152,39 +2036,21 @@ ReactStatistics { "name": "Foo", "status": "INLINED", }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 5 4`] = ` +exports[`Dynamic ReactElement type #4 4`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2194,37 +2060,19 @@ ReactStatistics { "name": "Foo", "status": "INLINED", }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 6 1`] = ` +exports[`Dynamic ReactElement type 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2239,7 +2087,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2254,7 +2102,7 @@ ReactStatistics { } `; -exports[`Component type change 6 2`] = ` +exports[`Dynamic ReactElement type 2`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2269,7 +2117,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2284,7 +2132,7 @@ ReactStatistics { } `; -exports[`Component type change 6 3`] = ` +exports[`Dynamic ReactElement type 3`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2299,7 +2147,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2314,7 +2162,7 @@ ReactStatistics { } `; -exports[`Component type change 6 4`] = ` +exports[`Dynamic ReactElement type 4`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2329,7 +2177,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Foo", + "name": "Bar", "status": "INLINED", }, ], @@ -2344,142 +2192,112 @@ ReactStatistics { } `; -exports[`Component type change 7 1`] = ` +exports[`Dynamic context 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "SubChild", "status": "INLINED", }, ], "message": "", - "name": "App", + "name": "Child", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 7 2`] = ` +exports[`Dynamic context 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "SubChild", "status": "INLINED", }, ], "message": "", - "name": "App", + "name": "Child", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 7 3`] = ` +exports[`Dynamic context 3`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "SubChild", "status": "INLINED", }, ], "message": "", - "name": "App", + "name": "Child", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 7 4`] = ` +exports[`Dynamic context 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "SubChild", "status": "INLINED", }, ], "message": "", - "name": "App", + "name": "Child", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 8 1`] = ` +exports[`Dynamic props 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Fn", "status": "INLINED", }, ], @@ -2488,28 +2306,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 8 2`] = ` +exports[`Dynamic props 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Fn", "status": "INLINED", }, ], @@ -2518,28 +2330,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 8 3`] = ` +exports[`Dynamic props 3`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Fn", "status": "INLINED", }, ], @@ -2548,28 +2354,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 8 4`] = ` +exports[`Dynamic props 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", + "name": "Fn", "status": "INLINED", }, ], @@ -2578,2051 +2378,18 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 1, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Component type change 9 1`] = ` +exports[`Equivalence 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 9 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 9 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 9 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 10 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 10 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 10 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 10 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 11 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 11 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 11 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type change 11 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type same 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type same 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type same 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Component type same 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Conditional 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Conditional 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Conditional 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Conditional 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "MaybeShow", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Delete element prop key 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Delete element prop key 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Delete element prop key 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Delete element prop key 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #2 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #2 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #2 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #3 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #3 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #3 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #4 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #4 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type #4 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic ReactElement type 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Bar", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic context 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic context 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic context 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic context 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "SubChild", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic props 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic props 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic props 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Dynamic props 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Fn", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Equivalence 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Equivalence 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Equivalence 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Equivalence 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Event handlers 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Event handlers 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Event handlers 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Event handlers 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 2 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 2 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 2 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays from Array.from 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays from Array.from 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays from Array.from 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Handle mapped arrays from Array.from 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`Havocing of ReactElements should not result in property assignments 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Havocing of ReactElements should not result in property assignments 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Havocing of ReactElements should not result in property assignments 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Havocing of ReactElements should not result in property assignments 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Key change 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key change 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key change 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key change 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key change with fragments 1`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key change with fragments 2`] = ` -ReactStatistics { - "componentsEvaluated": 5, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", @@ -4630,36 +2397,16 @@ ReactStatistics { ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change with fragments 3`] = ` +exports[`Equivalence 2`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", @@ -4667,36 +2414,16 @@ ReactStatistics { ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change with fragments 4`] = ` +exports[`Equivalence 3`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", @@ -4704,308 +2431,105 @@ ReactStatistics { ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key nesting 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key nesting 2`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Key nesting 2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Key nesting 2 2`] = ` +exports[`Equivalence 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Key nesting 2 3`] = ` +exports[`Event handlers 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Key nesting 2 4`] = ` +exports[`Event handlers 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Key nesting 3`] = ` +exports[`Event handlers 3`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key nesting 3 1`] = ` +exports[`Event handlers 4`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Key nesting 3 2`] = ` +exports[`Handle mapped arrays 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -5014,28 +2538,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Key nesting 3 3`] = ` +exports[`Handle mapped arrays 2`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -5044,28 +2562,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Key nesting 3 4`] = ` +exports[`Handle mapped arrays 2 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Child", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -5074,42 +2586,22 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Key nesting 4`] = ` +exports[`Handle mapped arrays 2 2`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "A", "status": "INLINED", }, ], @@ -5118,36 +2610,23 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, } `; -exports[`Key not changing with fragments 1`] = ` +exports[`Handle mapped arrays 2 3`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "A", + "status": "INLINED", }, ], "message": "", @@ -5155,36 +2634,23 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, } `; -exports[`Key not changing with fragments 2`] = ` +exports[`Handle mapped arrays 2 4`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "A", + "status": "INLINED", }, ], "message": "", @@ -5192,36 +2658,23 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, } `; -exports[`Key not changing with fragments 3`] = ` +exports[`Handle mapped arrays 3`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "A", + "status": "INLINED", }, ], "message": "", @@ -5229,36 +2682,23 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, } `; -exports[`Key not changing with fragments 4`] = ` +exports[`Handle mapped arrays 4`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "React.Fragment", - "status": "NORMAL", - }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "A", + "status": "INLINED", }, ], "message": "", @@ -5266,13 +2706,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, } `; -exports[`Lazy branched elements 1`] = ` +exports[`Handle mapped arrays from Array.from 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5284,12 +2724,12 @@ ReactStatistics { }, ], "inlinedComponents": 0, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 2`] = ` +exports[`Handle mapped arrays from Array.from 2`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5301,108 +2741,80 @@ ReactStatistics { }, ], "inlinedComponents": 0, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 2 1`] = ` +exports[`Handle mapped arrays from Array.from 3`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "inlinedComponents": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 2 2`] = ` +exports[`Handle mapped arrays from Array.from 4`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "inlinedComponents": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 2 3`] = ` +exports[`Havocing of ReactElements should not result in property assignments 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 2 4`] = ` +exports[`Havocing of ReactElements should not result in property assignments 2`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Lazy branched elements 3`] = ` +exports[`Havocing of ReactElements should not result in property assignments 3`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5419,7 +2831,7 @@ ReactStatistics { } `; -exports[`Lazy branched elements 4`] = ` +exports[`Havocing of ReactElements should not result in property assignments 4`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/Reconciliation-test.js.snap b/test/react/__snapshots__/Reconciliation-test.js.snap new file mode 100644 index 0000000000..4848134124 --- /dev/null +++ b/test/react/__snapshots__/Reconciliation-test.js.snap @@ -0,0 +1,2589 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Component type change 1`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 2`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Component type change 4 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 4 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 5 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 4, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 6 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 7 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 8 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 9 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 10 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type change 11 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Bar", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Component type same 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Foo", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key change 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change with fragments 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 1`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 2`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key nesting 3 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 3 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Key nesting 4`] = ` +ReactStatistics { + "componentsEvaluated": 6, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "SettingsPane", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 1`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 2`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 3`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key not changing with fragments 4`] = ` +ReactStatistics { + "componentsEvaluated": 5, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Lazy branched elements 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; From 864770309b0843bb642336fb494ba181b8dc5efb Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 29 Jun 2018 23:54:41 +0100 Subject: [PATCH 03/22] Extract assign/spread tests to a separate file --- test/react/AssignSpread-test.js | 96 + .../simple-assign.js | 0 .../simple-assign2.js | 0 .../simple-assign3.js | 0 .../simple-assign4.js | 0 .../simple-assign5.js | 0 .../simple-with-jsx-spread.js | 0 .../simple-with-jsx-spread10.js | 0 .../simple-with-jsx-spread11.js | 0 .../simple-with-jsx-spread12.js | 0 .../simple-with-jsx-spread13.js | 0 .../simple-with-jsx-spread2.js | 0 .../simple-with-jsx-spread3.js | 0 .../simple-with-jsx-spread4.js | 0 .../simple-with-jsx-spread5.js | 0 .../simple-with-jsx-spread6.js | 0 .../simple-with-jsx-spread7.js | 0 .../simple-with-jsx-spread8.js | 0 .../simple-with-jsx-spread9.js | 0 .../unsafe-spread.js | 0 test/react/FunctionalComponents-test.js | 78 - .../__snapshots__/AssignSpread-test.js.snap | 1788 ++++++++++++++++ .../FunctionalComponents-test.js.snap | 1795 +---------------- 23 files changed, 1888 insertions(+), 1869 deletions(-) create mode 100644 test/react/AssignSpread-test.js rename test/react/{FunctionalComponents => AssignSpread}/simple-assign.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-assign2.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-assign3.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-assign4.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-assign5.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread10.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread11.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread12.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread13.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread2.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread3.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread4.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread5.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread6.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread7.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread8.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/simple-with-jsx-spread9.js (100%) rename test/react/{FunctionalComponents => AssignSpread}/unsafe-spread.js (100%) create mode 100644 test/react/__snapshots__/AssignSpread-test.js.snap diff --git a/test/react/AssignSpread-test.js b/test/react/AssignSpread-test.js new file mode 100644 index 0000000000..e5557418ed --- /dev/null +++ b/test/react/AssignSpread-test.js @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +/* @flow */ + +const React = require("react"); +const prepareReactTests = require("./prepareReactTests"); +const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); + +/* eslint-disable no-undef */ +const { expect, it } = global; + +it("Unsafe spread", async () => { + await expectPartialKeyOrRefError(async () => { + await runTest(__dirname + "/AssignSpread/unsafe-spread.js"); + }); +}); + +it("Simple with multiple JSX spreads", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread.js"); +}); + +it("Simple with multiple JSX spreads #2", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread2.js"); +}); + +it("Simple with multiple JSX spreads #3", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread3.js"); +}); + +it("Simple with multiple JSX spreads #4", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread4.js"); +}); + +it("Simple with multiple JSX spreads #5", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread5.js"); +}); + +it("Simple with multiple JSX spreads #6", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread6.js"); +}); + +it("Simple with multiple JSX spreads #7", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread7.js"); +}); + +it("Simple with multiple JSX spreads #8", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread8.js"); +}); + +it("Simple with multiple JSX spreads #9", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread9.js"); +}); + +it("Simple with multiple JSX spreads #10", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread10.js"); +}); + +it("Simple with multiple JSX spreads #11", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread11.js"); +}); + +it("Simple with multiple JSX spreads #12", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread12.js"); +}); + +it("Simple with multiple JSX spreads #13", async () => { + await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread13.js"); +}); + +it("Simple with Object.assign", async () => { + await runTest(__dirname + "/AssignSpread/simple-assign.js"); +}); + +it("Simple with Object.assign #2", async () => { + await runTest(__dirname + "/AssignSpread/simple-assign2.js"); +}); + +it("Simple with Object.assign #3", async () => { + await runTest(__dirname + "/AssignSpread/simple-assign3.js"); +}); + +it("Simple with Object.assign #4", async () => { + await runTest(__dirname + "/AssignSpread/simple-assign4.js"); +}); + +it("Simple with Object.assign #5", async () => { + await runTest(__dirname + "/AssignSpread/simple-assign5.js"); +}); + diff --git a/test/react/FunctionalComponents/simple-assign.js b/test/react/AssignSpread/simple-assign.js similarity index 100% rename from test/react/FunctionalComponents/simple-assign.js rename to test/react/AssignSpread/simple-assign.js diff --git a/test/react/FunctionalComponents/simple-assign2.js b/test/react/AssignSpread/simple-assign2.js similarity index 100% rename from test/react/FunctionalComponents/simple-assign2.js rename to test/react/AssignSpread/simple-assign2.js diff --git a/test/react/FunctionalComponents/simple-assign3.js b/test/react/AssignSpread/simple-assign3.js similarity index 100% rename from test/react/FunctionalComponents/simple-assign3.js rename to test/react/AssignSpread/simple-assign3.js diff --git a/test/react/FunctionalComponents/simple-assign4.js b/test/react/AssignSpread/simple-assign4.js similarity index 100% rename from test/react/FunctionalComponents/simple-assign4.js rename to test/react/AssignSpread/simple-assign4.js diff --git a/test/react/FunctionalComponents/simple-assign5.js b/test/react/AssignSpread/simple-assign5.js similarity index 100% rename from test/react/FunctionalComponents/simple-assign5.js rename to test/react/AssignSpread/simple-assign5.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread.js b/test/react/AssignSpread/simple-with-jsx-spread.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread.js rename to test/react/AssignSpread/simple-with-jsx-spread.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread10.js b/test/react/AssignSpread/simple-with-jsx-spread10.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread10.js rename to test/react/AssignSpread/simple-with-jsx-spread10.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread11.js b/test/react/AssignSpread/simple-with-jsx-spread11.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread11.js rename to test/react/AssignSpread/simple-with-jsx-spread11.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread12.js b/test/react/AssignSpread/simple-with-jsx-spread12.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread12.js rename to test/react/AssignSpread/simple-with-jsx-spread12.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread13.js b/test/react/AssignSpread/simple-with-jsx-spread13.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread13.js rename to test/react/AssignSpread/simple-with-jsx-spread13.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread2.js b/test/react/AssignSpread/simple-with-jsx-spread2.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread2.js rename to test/react/AssignSpread/simple-with-jsx-spread2.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread3.js b/test/react/AssignSpread/simple-with-jsx-spread3.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread3.js rename to test/react/AssignSpread/simple-with-jsx-spread3.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread4.js b/test/react/AssignSpread/simple-with-jsx-spread4.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread4.js rename to test/react/AssignSpread/simple-with-jsx-spread4.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread5.js b/test/react/AssignSpread/simple-with-jsx-spread5.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread5.js rename to test/react/AssignSpread/simple-with-jsx-spread5.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread6.js b/test/react/AssignSpread/simple-with-jsx-spread6.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread6.js rename to test/react/AssignSpread/simple-with-jsx-spread6.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread7.js b/test/react/AssignSpread/simple-with-jsx-spread7.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread7.js rename to test/react/AssignSpread/simple-with-jsx-spread7.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread8.js b/test/react/AssignSpread/simple-with-jsx-spread8.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread8.js rename to test/react/AssignSpread/simple-with-jsx-spread8.js diff --git a/test/react/FunctionalComponents/simple-with-jsx-spread9.js b/test/react/AssignSpread/simple-with-jsx-spread9.js similarity index 100% rename from test/react/FunctionalComponents/simple-with-jsx-spread9.js rename to test/react/AssignSpread/simple-with-jsx-spread9.js diff --git a/test/react/FunctionalComponents/unsafe-spread.js b/test/react/AssignSpread/unsafe-spread.js similarity index 100% rename from test/react/FunctionalComponents/unsafe-spread.js rename to test/react/AssignSpread/unsafe-spread.js diff --git a/test/react/FunctionalComponents-test.js b/test/react/FunctionalComponents-test.js index 925b47f37c..667d3a3206 100644 --- a/test/react/FunctionalComponents-test.js +++ b/test/react/FunctionalComponents-test.js @@ -202,12 +202,6 @@ it("defaultProps", async () => { await runTest(__dirname + "/FunctionalComponents/default-props.js"); }); -it("Unsafe spread", async () => { - await expectPartialKeyOrRefError(async () => { - await runTest(__dirname + "/FunctionalComponents/unsafe-spread.js"); - }); -}); - it("Simple with abstract props", async () => { await runTest(__dirname + "/FunctionalComponents/simple-with-abstract-props.js"); }); @@ -216,78 +210,6 @@ it("Simple with unary expressions", async () => { await runTest(__dirname + "/FunctionalComponents/simple-with-unary.js"); }); -it("Simple with multiple JSX spreads", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread.js"); -}); - -it("Simple with multiple JSX spreads #2", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread2.js"); -}); - -it("Simple with multiple JSX spreads #3", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread3.js"); -}); - -it("Simple with multiple JSX spreads #4", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread4.js"); -}); - -it("Simple with multiple JSX spreads #5", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread5.js"); -}); - -it("Simple with multiple JSX spreads #6", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread6.js"); -}); - -it("Simple with multiple JSX spreads #7", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread7.js"); -}); - -it("Simple with multiple JSX spreads #8", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread8.js"); -}); - -it("Simple with multiple JSX spreads #9", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread9.js"); -}); - -it("Simple with multiple JSX spreads #10", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread10.js"); -}); - -it("Simple with multiple JSX spreads #11", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread11.js"); -}); - -it("Simple with multiple JSX spreads #12", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread12.js"); -}); - -it("Simple with multiple JSX spreads #13", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-jsx-spread13.js"); -}); - -it("Simple with Object.assign", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-assign.js"); -}); - -it("Simple with Object.assign #2", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-assign2.js"); -}); - -it("Simple with Object.assign #3", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-assign3.js"); -}); - -it("Simple with Object.assign #4", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-assign4.js"); -}); - -it("Simple with Object.assign #5", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-assign5.js"); -}); - it("Circular reference", async () => { await runTest(__dirname + "/FunctionalComponents/circular-reference.js"); }); diff --git a/test/react/__snapshots__/AssignSpread-test.js.snap b/test/react/__snapshots__/AssignSpread-test.js.snap new file mode 100644 index 0000000000..3167013fe2 --- /dev/null +++ b/test/react/__snapshots__/AssignSpread-test.js.snap @@ -0,0 +1,1788 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Simple with Object.assign #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign #5 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with Object.assign 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #2 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #3 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #4 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #5 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #6 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #7 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 2`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #8 4`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #9 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #10 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #11 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 1`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 2`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 3`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #12 4`] = ` +ReactStatistics { + "componentsEvaluated": 2, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads #13 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 2`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 3`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads #13 4`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App2", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Simple with multiple JSX spreads 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 2`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 3`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple with multiple JSX spreads 4`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "IWantThisToBeInlined", + "status": "INLINED", + }, + ], + "message": "", + "name": "Button", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 2, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Unsafe spread 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Unsafe spread 2`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; diff --git a/test/react/__snapshots__/FunctionalComponents-test.js.snap b/test/react/__snapshots__/FunctionalComponents-test.js.snap index fa8d9c803c..8da8c23fe2 100644 --- a/test/react/__snapshots__/FunctionalComponents-test.js.snap +++ b/test/react/__snapshots__/FunctionalComponents-test.js.snap @@ -5612,1775 +5612,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #2 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #2 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #2 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #3 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #3 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #3 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #4 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #4 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #4 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #5 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #5 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign #5 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with Object.assign 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with abstract props 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with abstract props 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with abstract props 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with abstract props 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #2 1`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #2 2`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #2 3`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #2 4`] = ` -ReactStatistics { - "componentsEvaluated": 3, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "IWantThisToBeInlined", - "status": "INLINED", - }, - ], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #3 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #3 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #3 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #3 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #4 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #4 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #4 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #4 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #5 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #5 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #5 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #6 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #6 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #6 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #6 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #7 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #7 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #7 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #7 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #8 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #8 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #8 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #8 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #9 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #9 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #9 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #9 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #10 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #10 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #10 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #10 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #11 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #11 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #11 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #11 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "Child2", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #12 1`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #12 2`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #12 3`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #12 4`] = ` -ReactStatistics { - "componentsEvaluated": 2, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 1, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple with multiple JSX spreads #13 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Simple with multiple JSX spreads #13 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Simple with multiple JSX spreads #13 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Simple with multiple JSX spreads #13 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Button", - "status": "INLINED", - }, - ], - "message": "", - "name": "App2", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Simple with multiple JSX spreads 1`] = ` +exports[`Simple with abstract props 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -7411,7 +5643,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 2`] = ` +exports[`Simple with abstract props 2`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -7442,7 +5674,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 3`] = ` +exports[`Simple with abstract props 3`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -7473,7 +5705,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 4`] = ` +exports[`Simple with abstract props 4`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -7760,25 +5992,6 @@ ReactStatistics { } `; -exports[`Unsafe spread 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Unsafe spread 2`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; - exports[`defaultProps 1`] = ` ReactStatistics { "componentsEvaluated": 2, From c7f7c45427595838bfa1d3e5b9f2d84044d083ea Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 29 Jun 2018 23:59:42 +0100 Subject: [PATCH 04/22] Make it possible to run `yarn test-react PartialTestName` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ddf1b721a..5b1126e2db 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "test-error-handler-with-coverage": "./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -o coverage-sourcemapped.error -t html", "test-node-cli-mode": "bash < scripts/test-node-cli-mode.sh", "test-std-in": "bash < scripts/test-std-in.sh", - "test-react": "jest test/react", + "test-react": "jest", "test": "yarn test-residual && yarn test-serializer && yarn test-sourcemaps && yarn test-error-handler && yarn test-std-in && yarn test-test262 && yarn test-internal && yarn test-internal-react && yarn test-react", "test-coverage-most": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/remap-istanbul -i coverage.most/coverage.json -o coverage-sourcemapped -t html", "test-all-coverage": "./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/test262-runner.js --timeout 50 --singleThreaded && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -i coverage.most/coverage.json -o coverage-sourcemapped -t html", From 4bb8835cd8afad52622314bf0a176b77994b25ff Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 00:10:26 +0100 Subject: [PATCH 05/22] Update Jest to 23.2.0 --- package.json | 2 +- yarn.lock | 532 +++++++++++++++++++++++++++++---------------------- 2 files changed, 305 insertions(+), 229 deletions(-) diff --git a/package.json b/package.json index 5b1126e2db..1aa363ff88 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "graceful-fs": "^4.1.11", "invariant": "^2.2.0", "istanbul": "^0.4.5", - "jest": "^22.2.1", + "jest": "^23.2.0", "js-yaml": "^3.6.1", "jsdom": "^9.2.1", "madge": "^1.6.0", diff --git a/yarn.lock b/yarn.lock index e3b36a1780..fe11a7b438 100644 --- a/yarn.lock +++ b/yarn.lock @@ -230,11 +230,11 @@ app-module-path@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-1.1.0.tgz#a6ac5368450f209b9f5b86e9a3e4a6ab6fe7531c" -append-transform@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" dependencies: - default-require-extensions "^1.0.0" + default-require-extensions "^2.0.0" aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" @@ -604,12 +604,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.2.0.tgz#2d04087f5d149585e14f641d529551963fc9b4f8" +babel-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.2.0.tgz#14a9d6a3f4122dfea6069d37085adf26a53a4dba" dependencies: - babel-plugin-istanbul "^4.1.5" - babel-preset-jest "^22.2.0" + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.2.0" babel-loader@^7.1.3: version "7.1.3" @@ -631,17 +631,18 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" find-up "^2.1.0" - istanbul-lib-instrument "^1.7.5" - test-exclude "^4.1.1" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" -babel-plugin-jest-hoist@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.2.0.tgz#bd34f39d652406669713b8c89e23ef25c890b993" +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -1050,11 +1051,11 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" -babel-preset-jest@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.2.0.tgz#f77b43f06ef4d8547214b2e206cc76a25c3ba0e2" +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" dependencies: - babel-plugin-jest-hoist "^22.2.0" + babel-plugin-jest-hoist "^23.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" babel-preset-react@^6.5.0: @@ -1298,9 +1299,9 @@ browser-process-hrtime@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" -browser-resolve@^1.11.2: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" dependencies: resolve "1.1.7" @@ -1368,6 +1369,10 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-from@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" + buffer-xor@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -1692,6 +1697,10 @@ cloneable-readable@^1.0.0: process-nextick-args "^1.0.6" through2 "^2.0.1" +clorox@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clorox/-/clorox-1.0.3.tgz#6fa63653f280c33d69f548fb14d239ddcfa1590d" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1757,6 +1766,10 @@ commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" +compare-versions@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" + component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -2019,11 +2032,11 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" -default-require-extensions@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" dependencies: - strip-bom "^2.0.0" + strip-bom "^3.0.0" define-properties@^1.1.2: version "1.1.2" @@ -2593,16 +2606,16 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-22.2.0.tgz#dddcaab2e22ccc9f51e7c1732e0aa723f2f1f2b8" +expect@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.2.0.tgz#53a7e135e36fe27e75867b1178ff08aaacc2b0dd" dependencies: ansi-styles "^3.2.0" - jest-diff "^22.1.0" + jest-diff "^23.2.0" jest-get-type "^22.1.0" - jest-matcher-utils "^22.2.0" - jest-message-util "^22.2.0" - jest-regex-util "^22.1.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.2.0" + jest-regex-util "^23.0.0" extend-shallow@^2.0.1: version "2.0.1" @@ -3904,66 +3917,67 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-api@^1.1.14: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.2.1.tgz#0c60a0515eb11c7d65c6b50bba2c6e999acd8620" +istanbul-api@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" dependencies: async "^2.1.4" + compare-versions "^3.1.0" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.1" - istanbul-lib-hook "^1.1.0" - istanbul-lib-instrument "^1.9.1" - istanbul-lib-report "^1.1.2" - istanbul-lib-source-maps "^1.2.2" - istanbul-reports "^1.1.3" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" +istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" -istanbul-lib-hook@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b" +istanbul-lib-hook@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" dependencies: - append-transform "^0.4.0" + append-transform "^1.0.0" -istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0, istanbul-lib-instrument@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" +istanbul-lib-instrument@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.18.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.2.0" semver "^5.3.0" -istanbul-lib-report@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" dependencies: - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.2.0" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.1, istanbul-lib-source-maps@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" +istanbul-lib-source-maps@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" dependencies: debug "^3.1.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.2.0" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" dependencies: handlebars "^4.0.3" @@ -4001,15 +4015,15 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -jest-changed-files@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.2.0.tgz#517610c4a8ca0925bdc88b0ca53bd678aa8d019e" +jest-changed-files@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.2.0.tgz#a145a6e4b66d0129fc7c99cee134dc937a643d9c" dependencies: throat "^4.0.0" -jest-cli@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-22.2.1.tgz#f1df6675cd719e0773be77d6314c5f4b1d8af47f" +jest-cli@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.2.0.tgz#3b543a3da5145dd8937931017282379fc696c45b" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -4018,243 +4032,275 @@ jest-cli@^22.2.1: graceful-fs "^4.1.11" import-local "^1.0.0" is-ci "^1.0.10" - istanbul-api "^1.1.14" - istanbul-lib-coverage "^1.1.1" - istanbul-lib-instrument "^1.8.0" - istanbul-lib-source-maps "^1.2.1" - jest-changed-files "^22.2.0" - jest-config "^22.2.1" - jest-environment-jsdom "^22.2.0" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.2.0" + jest-config "^23.2.0" + jest-environment-jsdom "^23.2.0" jest-get-type "^22.1.0" - jest-haste-map "^22.2.0" - jest-message-util "^22.2.0" - jest-regex-util "^22.1.0" - jest-resolve-dependencies "^22.1.0" - jest-runner "^22.2.1" - jest-runtime "^22.2.1" - jest-snapshot "^22.2.0" - jest-util "^22.2.0" - jest-worker "^22.2.0" - micromatch "^2.3.11" + jest-haste-map "^23.2.0" + jest-message-util "^23.2.0" + jest-regex-util "^23.0.0" + jest-resolve-dependencies "^23.2.0" + jest-runner "^23.2.0" + jest-runtime "^23.2.0" + jest-snapshot "^23.2.0" + jest-util "^23.2.0" + jest-validate "^23.2.0" + jest-watcher "^23.2.0" + jest-worker "^23.2.0" + micromatch "^3.1.10" node-notifier "^5.2.1" + prompts "^0.1.9" realpath-native "^1.0.0" rimraf "^2.5.4" slash "^1.0.0" string-length "^2.0.0" strip-ansi "^4.0.0" which "^1.2.12" - yargs "^10.0.3" + yargs "^11.0.0" -jest-config@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.2.1.tgz#8617e99cff0544f0a5f254a5dde37f43b5383934" +jest-config@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.2.0.tgz#d2fb556fd5a2a19c39eb56d139dcca5dad2a1c88" dependencies: + babel-core "^6.0.0" + babel-jest "^23.2.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^22.2.0" - jest-environment-node "^22.2.0" + jest-environment-jsdom "^23.2.0" + jest-environment-node "^23.2.0" jest-get-type "^22.1.0" - jest-jasmine2 "^22.2.1" - jest-regex-util "^22.1.0" - jest-resolve "^22.2.0" - jest-util "^22.2.0" - jest-validate "^22.2.0" - pretty-format "^22.1.0" - -jest-diff@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-22.1.0.tgz#0fad9d96c87b453896bf939df3dc8aac6919ac38" + jest-jasmine2 "^23.2.0" + jest-regex-util "^23.0.0" + jest-resolve "^23.2.0" + jest-util "^23.2.0" + jest-validate "^23.2.0" + pretty-format "^23.2.0" + +jest-diff@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.2.0.tgz#9f2cf4b51e12c791550200abc16b47130af1062a" dependencies: chalk "^2.0.1" diff "^3.2.0" jest-get-type "^22.1.0" - pretty-format "^22.1.0" + pretty-format "^23.2.0" jest-docblock@^20.0.1: version "20.0.3" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" -jest-docblock@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.2.0.tgz#4d054eac354751e94a43a0ea2e2fe5c04cc61bbb" +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" dependencies: detect-newline "^2.1.0" -jest-environment-jsdom@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.2.0.tgz#e9537400cbdef2d1e61d7196f8afa40e826fe9d8" +jest-each@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.2.0.tgz#a400f81c857083f50c4f53399b109f12023fb19d" dependencies: - jest-mock "^22.2.0" - jest-util "^22.2.0" + chalk "^2.0.1" + pretty-format "^23.2.0" + +jest-environment-jsdom@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.2.0.tgz#3634603a08a975b0ca8a658320f56a54a8e04558" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.2.0" jsdom "^11.5.1" -jest-environment-node@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.2.0.tgz#ba7d0183fac076d34867367a4ac53ced69e3d3a9" +jest-environment-node@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.2.0.tgz#b6fe41372e382093bb6f3d9bdf6c1c4ec0a50f18" dependencies: - jest-mock "^22.2.0" - jest-util "^22.2.0" + jest-mock "^23.2.0" + jest-util "^23.2.0" jest-get-type@^22.1.0: version "22.1.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9" -jest-haste-map@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.2.0.tgz#c9f508b8f63322490339ba02343dd688474d9ad5" +jest-haste-map@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.2.0.tgz#d10cbac007c695948c8ef1821a2b2ed2d4f2d4d8" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^22.2.0" - jest-worker "^22.2.0" - micromatch "^2.3.11" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" + micromatch "^3.1.10" sane "^2.0.0" -jest-jasmine2@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.2.1.tgz#58d115f3f4a0a186b5e90c5db8ac68aecfc41051" +jest-jasmine2@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.2.0.tgz#aa670cdb1e4d5f8ec774c94dda5e105fe33d8bb4" dependencies: - callsites "^2.0.0" chalk "^2.0.1" co "^4.6.0" - expect "^22.2.0" - graceful-fs "^4.1.11" + expect "^23.2.0" is-generator-fn "^1.0.0" - jest-diff "^22.1.0" - jest-matcher-utils "^22.2.0" - jest-message-util "^22.2.0" - jest-snapshot "^22.2.0" - source-map-support "^0.5.0" + jest-diff "^23.2.0" + jest-each "^23.2.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.2.0" + jest-snapshot "^23.2.0" + jest-util "^23.2.0" + pretty-format "^23.2.0" -jest-leak-detector@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-22.1.0.tgz#08376644cee07103da069baac19adb0299b772c2" +jest-leak-detector@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz#c289d961dc638f14357d4ef96e0431ecc1aa377d" dependencies: - pretty-format "^22.1.0" + pretty-format "^23.2.0" -jest-matcher-utils@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.2.0.tgz#5390f823c18c748543d463825aa8e4df0db253ca" +jest-matcher-utils@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz#4d4981f23213e939e3cedf23dc34c747b5ae1913" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" - pretty-format "^22.1.0" + pretty-format "^23.2.0" -jest-message-util@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.2.0.tgz#84a6bb34186d8b9af7e0732fabbef63f7355f7b2" +jest-message-util@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.2.0.tgz#591e8148fff69cf89b0414809c721756ebefe744" dependencies: "@babel/code-frame" "^7.0.0-beta.35" chalk "^2.0.1" - micromatch "^2.3.11" + micromatch "^3.1.10" slash "^1.0.0" stack-utils "^1.0.1" -jest-mock@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7" +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" -jest-regex-util@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-22.1.0.tgz#5daf2fe270074b6da63e5d85f1c9acc866768f53" +jest-regex-util@^23.0.0: + version "23.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.0.0.tgz#dd5c1fde0c46f4371314cf10f7a751a23f4e8f76" -jest-resolve-dependencies@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-22.1.0.tgz#340e4139fb13315cd43abc054e6c06136be51e31" +jest-resolve-dependencies@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.2.0.tgz#6df8d5709c6406639cd07f54bff074e01b5c0458" dependencies: - jest-regex-util "^22.1.0" + jest-regex-util "^23.0.0" + jest-snapshot "^23.2.0" -jest-resolve@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.2.0.tgz#25aa8b887b31ab8c79763503e209d7c136f74ab1" +jest-resolve@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.2.0.tgz#a0790ad5a3b99002ab4dbfcbf8d9e2d6a69b3d99" dependencies: - browser-resolve "^1.11.2" + browser-resolve "^1.11.3" chalk "^2.0.1" + realpath-native "^1.0.0" -jest-runner@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.2.1.tgz#539b2b7eb0ceb34e63a1ca78a1eda46ace70b940" +jest-runner@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.2.0.tgz#0d91967ea82f72b0c705910926086d2055ce75af" dependencies: exit "^0.1.2" - jest-config "^22.2.1" - jest-docblock "^22.2.0" - jest-haste-map "^22.2.0" - jest-jasmine2 "^22.2.1" - jest-leak-detector "^22.1.0" - jest-message-util "^22.2.0" - jest-runtime "^22.2.1" - jest-util "^22.2.0" - jest-worker "^22.2.0" + graceful-fs "^4.1.11" + jest-config "^23.2.0" + jest-docblock "^23.2.0" + jest-haste-map "^23.2.0" + jest-jasmine2 "^23.2.0" + jest-leak-detector "^23.2.0" + jest-message-util "^23.2.0" + jest-runtime "^23.2.0" + jest-util "^23.2.0" + jest-worker "^23.2.0" + source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-22.2.1.tgz#c5b0173a7f5274b28da30019cf7bb7b8cda68040" +jest-runtime@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.2.0.tgz#62dcb01766a1c4c64696dc090209e76ce1aadcbc" dependencies: babel-core "^6.0.0" - babel-jest "^22.2.0" - babel-plugin-istanbul "^4.1.5" + babel-plugin-istanbul "^4.1.6" chalk "^2.0.1" convert-source-map "^1.4.0" exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.11" - jest-config "^22.2.1" - jest-haste-map "^22.2.0" - jest-regex-util "^22.1.0" - jest-resolve "^22.2.0" - jest-util "^22.2.0" - json-stable-stringify "^1.0.1" - micromatch "^2.3.11" + jest-config "^23.2.0" + jest-haste-map "^23.2.0" + jest-message-util "^23.2.0" + jest-regex-util "^23.0.0" + jest-resolve "^23.2.0" + jest-snapshot "^23.2.0" + jest-util "^23.2.0" + jest-validate "^23.2.0" + micromatch "^3.1.10" realpath-native "^1.0.0" slash "^1.0.0" strip-bom "3.0.0" write-file-atomic "^2.1.0" - yargs "^10.0.3" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" -jest-snapshot@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.2.0.tgz#0c0ba152d296ef70fa198cc84977a2cc269ee4cf" +jest-snapshot@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.2.0.tgz#c7a3d017177bbad60c8a595869cf90a8782e6a7e" dependencies: chalk "^2.0.1" - jest-diff "^22.1.0" - jest-matcher-utils "^22.2.0" + jest-diff "^23.2.0" + jest-matcher-utils "^23.2.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^22.1.0" + pretty-format "^23.2.0" -jest-util@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.2.0.tgz#afad693641447858bec7b37f32952516bf887262" +jest-util@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.2.0.tgz#62b770757696d96e094a04b8f1c373ca50a5ab2e" dependencies: callsites "^2.0.0" chalk "^2.0.1" graceful-fs "^4.1.11" is-ci "^1.0.10" - jest-message-util "^22.2.0" - jest-validate "^22.2.0" + jest-message-util "^23.2.0" mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" -jest-validate@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.2.0.tgz#f7ce459105a8210825e5e57279f868ab080063fa" +jest-validate@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.2.0.tgz#67c8b909e11af1701765238894c67ac3291b195e" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" leven "^2.1.0" - pretty-format "^22.1.0" + pretty-format "^23.2.0" + +jest-watcher@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.2.0.tgz#678e852896e919e9d9a0eb4b8baf1ae279620ea9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" -jest-worker@^22.2.0: - version "22.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.2.0.tgz#d88d6ee176d6409f206cbbf7b485250793264262" +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" dependencies: merge-stream "^1.0.1" -jest@^22.2.1: - version "22.2.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-22.2.1.tgz#fb6524d35bd02968afe3b17f330d6f7207846147" +jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.2.0.tgz#828bf31a096d45dcf06824d1ea03013af7bcfc20" dependencies: import-local "^1.0.0" - jest-cli "^22.2.1" + jest-cli "^23.2.0" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -4851,7 +4897,7 @@ merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" -micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: +micromatch@^2.1.5, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -4869,6 +4915,24 @@ micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.9" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" @@ -5699,9 +5763,9 @@ pretty-bytes@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" -pretty-format@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.1.0.tgz#2277605b40ed4529ae4db51ff62f4be817647914" +pretty-format@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" dependencies: ansi-regex "^3.0.0" ansi-styles "^3.2.0" @@ -5748,6 +5812,13 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +prompts@^0.1.9: + version "0.1.10" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.10.tgz#832cbf6116ecb121d6884e84643bb2cf92b3ed2c" + dependencies: + clorox "^1.0.3" + sisteransi "^0.1.1" + prop-types@^15.5.8, prop-types@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" @@ -6478,6 +6549,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -6611,10 +6686,11 @@ source-map-support@^0.4.15, source-map-support@^0.4.6: dependencies: source-map "^0.5.6" -source-map-support@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76" +source-map-support@^0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" dependencies: + buffer-from "^1.0.0" source-map "^0.6.0" source-map-url@^0.4.0: @@ -6931,12 +7007,12 @@ temp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" -test-exclude@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" +test-exclude@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" dependencies: arrify "^1.0.1" - micromatch "^2.3.11" + micromatch "^3.1.8" object-assign "^4.1.0" read-pkg-up "^1.0.1" require-main-filename "^1.0.1" @@ -7070,7 +7146,7 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" -to-regex@^3.0.1: +to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" dependencies: @@ -7686,9 +7762,9 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" dependencies: camelcase "^4.1.0" @@ -7710,9 +7786,9 @@ yargs@9.0.1: y18n "^3.2.1" yargs-parser "^7.0.0" -yargs@^10.0.3: - version "10.1.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -7725,7 +7801,7 @@ yargs@^10.0.3: string-width "^2.0.0" which-module "^2.0.0" y18n "^3.2.1" - yargs-parser "^8.1.0" + yargs-parser "^9.0.2" yargs@^4.2.0, yargs@^4.7.1: version "4.8.1" From 7947fc008236ea860e51faa1c18d2174238ca68e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 00:19:50 +0100 Subject: [PATCH 06/22] Remove unnecessary async/await in tests --- test/react/AssignSpread-test.js | 79 ++++--- test/react/ClassComponents-test.js | 52 ++--- test/react/FBMocks-test.js | 120 +++++----- test/react/FactoryComponents-test.js | 8 +- test/react/FirstRenderOnly-test.js | 76 +++--- test/react/FunctionalComponents-test.js | 294 ++++++++++++------------ test/react/ReactDOM-test.js | 4 +- test/react/Reconciliation-test.js | 80 +++---- test/react/RenderProps-test.js | 56 ++--- test/react/ServerRendering-test.js | 4 +- test/react/prepareReactTests.js | 24 +- 11 files changed, 398 insertions(+), 399 deletions(-) diff --git a/test/react/AssignSpread-test.js b/test/react/AssignSpread-test.js index e5557418ed..0aaa1324a6 100644 --- a/test/react/AssignSpread-test.js +++ b/test/react/AssignSpread-test.js @@ -16,81 +16,80 @@ const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prep /* eslint-disable no-undef */ const { expect, it } = global; -it("Unsafe spread", async () => { - await expectPartialKeyOrRefError(async () => { - await runTest(__dirname + "/AssignSpread/unsafe-spread.js"); +it("Unsafe spread", () => { + expectPartialKeyOrRefError(() => { + runTest(__dirname + "/AssignSpread/unsafe-spread.js"); }); }); -it("Simple with multiple JSX spreads", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread.js"); +it("Simple with multiple JSX spreads", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread.js"); }); -it("Simple with multiple JSX spreads #2", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread2.js"); +it("Simple with multiple JSX spreads #2", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread2.js"); }); -it("Simple with multiple JSX spreads #3", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread3.js"); +it("Simple with multiple JSX spreads #3", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread3.js"); }); -it("Simple with multiple JSX spreads #4", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread4.js"); +it("Simple with multiple JSX spreads #4", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread4.js"); }); -it("Simple with multiple JSX spreads #5", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread5.js"); +it("Simple with multiple JSX spreads #5", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread5.js"); }); -it("Simple with multiple JSX spreads #6", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread6.js"); +it("Simple with multiple JSX spreads #6", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread6.js"); }); -it("Simple with multiple JSX spreads #7", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread7.js"); +it("Simple with multiple JSX spreads #7", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread7.js"); }); -it("Simple with multiple JSX spreads #8", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread8.js"); +it("Simple with multiple JSX spreads #8", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread8.js"); }); -it("Simple with multiple JSX spreads #9", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread9.js"); +it("Simple with multiple JSX spreads #9", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread9.js"); }); -it("Simple with multiple JSX spreads #10", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread10.js"); +it("Simple with multiple JSX spreads #10", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread10.js"); }); -it("Simple with multiple JSX spreads #11", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread11.js"); +it("Simple with multiple JSX spreads #11", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread11.js"); }); -it("Simple with multiple JSX spreads #12", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread12.js"); +it("Simple with multiple JSX spreads #12", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread12.js"); }); -it("Simple with multiple JSX spreads #13", async () => { - await runTest(__dirname + "/AssignSpread/simple-with-jsx-spread13.js"); +it("Simple with multiple JSX spreads #13", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread13.js"); }); -it("Simple with Object.assign", async () => { - await runTest(__dirname + "/AssignSpread/simple-assign.js"); +it("Simple with Object.assign", () => { + runTest(__dirname + "/AssignSpread/simple-assign.js"); }); -it("Simple with Object.assign #2", async () => { - await runTest(__dirname + "/AssignSpread/simple-assign2.js"); +it("Simple with Object.assign #2", () => { + runTest(__dirname + "/AssignSpread/simple-assign2.js"); }); -it("Simple with Object.assign #3", async () => { - await runTest(__dirname + "/AssignSpread/simple-assign3.js"); +it("Simple with Object.assign #3", () => { + runTest(__dirname + "/AssignSpread/simple-assign3.js"); }); -it("Simple with Object.assign #4", async () => { - await runTest(__dirname + "/AssignSpread/simple-assign4.js"); +it("Simple with Object.assign #4", () => { + runTest(__dirname + "/AssignSpread/simple-assign4.js"); }); -it("Simple with Object.assign #5", async () => { - await runTest(__dirname + "/AssignSpread/simple-assign5.js"); +it("Simple with Object.assign #5", () => { + runTest(__dirname + "/AssignSpread/simple-assign5.js"); }); - diff --git a/test/react/ClassComponents-test.js b/test/react/ClassComponents-test.js index f92b6ca7ac..eacdb2c034 100644 --- a/test/react/ClassComponents-test.js +++ b/test/react/ClassComponents-test.js @@ -15,54 +15,54 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("Simple", async () => { - await runTest(__dirname + "/ClassComponents/simple.js"); +it("Simple", () => { + runTest(__dirname + "/ClassComponents/simple.js"); }); -it("Simple classes", async () => { - await runTest(__dirname + "/ClassComponents/simple-classes.js"); +it("Simple classes", () => { + runTest(__dirname + "/ClassComponents/simple-classes.js"); }); -it("Simple classes #2", async () => { - await runTest(__dirname + "/ClassComponents/simple-classes-2.js"); +it("Simple classes #2", () => { + runTest(__dirname + "/ClassComponents/simple-classes-2.js"); }); -it("Simple classes #3", async () => { - await runTest(__dirname + "/ClassComponents/simple-classes-3.js"); +it("Simple classes #3", () => { + runTest(__dirname + "/ClassComponents/simple-classes-3.js"); }); -it("Simple classes with Array.from", async () => { - await runTest(__dirname + "/ClassComponents/array-from.js"); +it("Simple classes with Array.from", () => { + runTest(__dirname + "/ClassComponents/array-from.js"); }); -it("Simple classes with Array.from 2", async () => { - await runTest(__dirname + "/ClassComponents/array-from2.js"); +it("Simple classes with Array.from 2", () => { + runTest(__dirname + "/ClassComponents/array-from2.js"); }); -it("Inheritance chaining", async () => { - await runTest(__dirname + "/ClassComponents/inheritance-chain.js"); +it("Inheritance chaining", () => { + runTest(__dirname + "/ClassComponents/inheritance-chain.js"); }); -it("Classes with state", async () => { - await runTest(__dirname + "/ClassComponents/classes-with-state.js"); +it("Classes with state", () => { + runTest(__dirname + "/ClassComponents/classes-with-state.js"); }); -it("Complex class components folding into functional root component", async () => { - await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root.js"); +it("Complex class components folding into functional root component", () => { + runTest(__dirname + "/ClassComponents/complex-class-into-functional-root.js"); }); -it("Complex class components folding into functional root component #2", async () => { - await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root2.js"); +it("Complex class components folding into functional root component #2", () => { + runTest(__dirname + "/ClassComponents/complex-class-into-functional-root2.js"); }); -it("Complex class components folding into functional root component #3", async () => { - await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root3.js"); +it("Complex class components folding into functional root component #3", () => { + runTest(__dirname + "/ClassComponents/complex-class-into-functional-root3.js"); }); -it("Complex class components folding into functional root component #4", async () => { - await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root4.js"); +it("Complex class components folding into functional root component #4", () => { + runTest(__dirname + "/ClassComponents/complex-class-into-functional-root4.js"); }); -it("Complex class components folding into functional root component #5", async () => { - await runTest(__dirname + "/ClassComponents/complex-class-into-functional-root5.js"); +it("Complex class components folding into functional root component #5", () => { + runTest(__dirname + "/ClassComponents/complex-class-into-functional-root5.js"); }); diff --git a/test/react/FBMocks-test.js b/test/react/FBMocks-test.js index f7bd7c717b..326afbb92f 100644 --- a/test/react/FBMocks-test.js +++ b/test/react/FBMocks-test.js @@ -16,126 +16,126 @@ const { runTest, expectReconcilerFatalError, stubReactRelay } = prepareReactTest /* eslint-disable no-undef */ const { it } = global; -it("fb-www", async () => { - await stubReactRelay(async () => { - await runTest(__dirname + "/FBMocks/fb1.js"); +it("fb-www", () => { + stubReactRelay(() => { + runTest(__dirname + "/FBMocks/fb1.js"); }); }); -it("fb-www 2", async () => { - await runTest(__dirname + "/FBMocks/fb2.js"); +it("fb-www 2", () => { + runTest(__dirname + "/FBMocks/fb2.js"); }); -it("fb-www 3", async () => { - await stubReactRelay(async () => { - await runTest(__dirname + "/FBMocks/fb3.js"); +it("fb-www 3", () => { + stubReactRelay(() => { + runTest(__dirname + "/FBMocks/fb3.js"); }); }); -it("fb-www 4", async () => { - await stubReactRelay(async () => { - await runTest(__dirname + "/FBMocks/fb4.js"); +it("fb-www 4", () => { + stubReactRelay(() => { + runTest(__dirname + "/FBMocks/fb4.js"); }); }); -it("fb-www 5", async () => { - await runTest(__dirname + "/FBMocks/fb5.js"); +it("fb-www 5", () => { + runTest(__dirname + "/FBMocks/fb5.js"); }); -it("fb-www 6", async () => { - await runTest(__dirname + "/FBMocks/fb6.js"); +it("fb-www 6", () => { + runTest(__dirname + "/FBMocks/fb6.js"); }); -it("fb-www 7", async () => { - await runTest(__dirname + "/FBMocks/fb7.js"); +it("fb-www 7", () => { + runTest(__dirname + "/FBMocks/fb7.js"); }); -it("fb-www 8", async () => { - await runTest(__dirname + "/FBMocks/fb8.js"); +it("fb-www 8", () => { + runTest(__dirname + "/FBMocks/fb8.js"); }); -it("fb-www 9", async () => { - await runTest(__dirname + "/FBMocks/fb9.js"); +it("fb-www 9", () => { + runTest(__dirname + "/FBMocks/fb9.js"); }); -it("fb-www 10", async () => { - await runTest(__dirname + "/FBMocks/fb10.js"); +it("fb-www 10", () => { + runTest(__dirname + "/FBMocks/fb10.js"); }); -it("fb-www 11", async () => { - await runTest(__dirname + "/FBMocks/fb11.js"); +it("fb-www 11", () => { + runTest(__dirname + "/FBMocks/fb11.js"); }); -it("fb-www 12", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FBMocks/fb12.js"); +it("fb-www 12", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FBMocks/fb12.js"); }); }); -it("fb-www 13", async () => { - await runTest(__dirname + "/FBMocks/fb13.js"); +it("fb-www 13", () => { + runTest(__dirname + "/FBMocks/fb13.js"); }); -it("fb-www 14", async () => { - await runTest(__dirname + "/FBMocks/fb14.js"); +it("fb-www 14", () => { + runTest(__dirname + "/FBMocks/fb14.js"); }); -it("fb-www 15", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FBMocks/fb15.js"); +it("fb-www 15", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FBMocks/fb15.js"); }); }); -it("fb-www 16", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FBMocks/fb16.js"); +it("fb-www 16", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FBMocks/fb16.js"); }); }); -it("fb-www 17", async () => { - await runTest(__dirname + "/FBMocks/fb17.js"); +it("fb-www 17", () => { + runTest(__dirname + "/FBMocks/fb17.js"); }); // Test fails for two reasons: // - "uri.foo" on abstract string does not exist // - unused.bar() does not exist (even if in try/catch) -it("fb-www 18", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FBMocks/fb18.js"); +it("fb-www 18", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FBMocks/fb18.js"); }); }); -it("fb-www 19", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FBMocks/fb19.js"); +it("fb-www 19", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FBMocks/fb19.js"); }); }); -it("fb-www 20", async () => { - await runTest(__dirname + "/FBMocks/fb20.js"); +it("fb-www 20", () => { + runTest(__dirname + "/FBMocks/fb20.js"); }); -it("fb-www 21", async () => { - await runTest(__dirname + "/FBMocks/fb21.js"); +it("fb-www 21", () => { + runTest(__dirname + "/FBMocks/fb21.js"); }); -it("fb-www 22", async () => { - await runTest(__dirname + "/FBMocks/fb22.js"); +it("fb-www 22", () => { + runTest(__dirname + "/FBMocks/fb22.js"); }); -it("fb-www 23", async () => { - await runTest(__dirname + "/FBMocks/fb23.js"); +it("fb-www 23", () => { + runTest(__dirname + "/FBMocks/fb23.js"); }); -it("repl example", async () => { - await runTest(__dirname + "/FBMocks/repl-example.js"); +it("repl example", () => { + runTest(__dirname + "/FBMocks/repl-example.js"); }); -it("Hacker News app", async () => { +it("Hacker News app", () => { let data = JSON.parse(fs.readFileSync(__dirname + "/FBMocks/hacker-news.json").toString()); - await runTest(__dirname + "/FBMocks/hacker-news.js", false, data); + runTest(__dirname + "/FBMocks/hacker-news.js", false, data); }); -it("Function bind", async () => { - await runTest(__dirname + "/FBMocks/function-bind.js"); +it("Function bind", () => { + runTest(__dirname + "/FBMocks/function-bind.js"); }); diff --git a/test/react/FactoryComponents-test.js b/test/react/FactoryComponents-test.js index dc4c032fca..838f025005 100644 --- a/test/react/FactoryComponents-test.js +++ b/test/react/FactoryComponents-test.js @@ -15,10 +15,10 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("Simple factory classes", async () => { - await runTest(__dirname + "/FactoryComponents/simple.js"); +it("Simple factory classes", () => { + runTest(__dirname + "/FactoryComponents/simple.js"); }); -it("Simple factory classes 2", async () => { - await runTest(__dirname + "/FactoryComponents/simple2.js"); +it("Simple factory classes 2", () => { + runTest(__dirname + "/FactoryComponents/simple2.js"); }); diff --git a/test/react/FirstRenderOnly-test.js b/test/react/FirstRenderOnly-test.js index 035f236353..c10edfb1da 100644 --- a/test/react/FirstRenderOnly-test.js +++ b/test/react/FirstRenderOnly-test.js @@ -15,81 +15,81 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("Simple", async () => { - await runTest(__dirname + "/FirstRenderOnly/simple.js", true); +it("Simple", () => { + runTest(__dirname + "/FirstRenderOnly/simple.js", true); }); -it("Simple #2", async () => { - await runTest(__dirname + "/FirstRenderOnly/simple-2.js", true); +it("Simple #2", () => { + runTest(__dirname + "/FirstRenderOnly/simple-2.js", true); }); -it("Simple #3", async () => { - await runTest(__dirname + "/FirstRenderOnly/simple-3.js", true); +it("Simple #3", () => { + runTest(__dirname + "/FirstRenderOnly/simple-3.js", true); }); // Should be refined in a follow up PR to check for // functions and keys on deep referenced objects linking // to host components -it("Simple #4", async () => { - await runTest(__dirname + "/FirstRenderOnly/simple-4.js", true); +it("Simple #4", () => { + runTest(__dirname + "/FirstRenderOnly/simple-4.js", true); }); -it("componentWillMount", async () => { - await runTest(__dirname + "/FirstRenderOnly/will-mount.js", true); +it("componentWillMount", () => { + runTest(__dirname + "/FirstRenderOnly/will-mount.js", true); }); -it("getDerivedStateFromProps", async () => { - await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props.js", true); +it("getDerivedStateFromProps", () => { + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props.js", true); }); -it("getDerivedStateFromProps 2", async () => { - await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props2.js", true); +it("getDerivedStateFromProps 2", () => { + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props2.js", true); }); -it("getDerivedStateFromProps 3", async () => { - await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props3.js", true); +it("getDerivedStateFromProps 3", () => { + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props3.js", true); }); -it("getDerivedStateFromProps 4", async () => { - await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props4.js", true); +it("getDerivedStateFromProps 4", () => { + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props4.js", true); }); -it("getDerivedStateFromProps 5", async () => { - await runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props5.js", true); +it("getDerivedStateFromProps 5", () => { + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props5.js", true); }); -it("React Context", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context.js"); +it("React Context", () => { + runTest(__dirname + "/FirstRenderOnly/react-context.js"); }); -it("React Context 2", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context2.js"); +it("React Context 2", () => { + runTest(__dirname + "/FirstRenderOnly/react-context2.js"); }); -it("React Context 3", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context3.js"); +it("React Context 3", () => { + runTest(__dirname + "/FirstRenderOnly/react-context3.js"); }); -it("React Context 4", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context4.js"); +it("React Context 4", () => { + runTest(__dirname + "/FirstRenderOnly/react-context4.js"); }); -it("React Context 5", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context5.js"); +it("React Context 5", () => { + runTest(__dirname + "/FirstRenderOnly/react-context5.js"); }); -it("React Context 6", async () => { - await runTest(__dirname + "/FirstRenderOnly/react-context6.js"); +it("React Context 6", () => { + runTest(__dirname + "/FirstRenderOnly/react-context6.js"); }); -it.skip("Replace this in callbacks", async () => { - await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js"); +it.skip("Replace this in callbacks", () => { + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js"); }); -it("Replace this in callbacks 2", async () => { - await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks2.js"); +it("Replace this in callbacks 2", () => { + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks2.js"); }); -it("Replace this in callbacks 3", async () => { - await runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks3.js"); +it("Replace this in callbacks 3", () => { + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks3.js"); }); diff --git a/test/react/FunctionalComponents-test.js b/test/react/FunctionalComponents-test.js index 667d3a3206..60249fa2d7 100644 --- a/test/react/FunctionalComponents-test.js +++ b/test/react/FunctionalComponents-test.js @@ -16,209 +16,209 @@ const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prep /* eslint-disable no-undef */ const { expect, it } = global; -it("Simple", async () => { - await runTest(__dirname + "/FunctionalComponents/simple.js"); +it("Simple", () => { + runTest(__dirname + "/FunctionalComponents/simple.js"); }); -it("Simple 2", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-2.js"); +it("Simple 2", () => { + runTest(__dirname + "/FunctionalComponents/simple-2.js"); }); -it("Simple 3", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-3.js"); +it("Simple 3", () => { + runTest(__dirname + "/FunctionalComponents/simple-3.js"); }); -it("Simple 4", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-4.js"); +it("Simple 4", () => { + runTest(__dirname + "/FunctionalComponents/simple-4.js"); }); -it("Simple 5", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-5.js"); +it("Simple 5", () => { + runTest(__dirname + "/FunctionalComponents/simple-5.js"); }); -it("Simple 6", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-6.js"); +it("Simple 6", () => { + runTest(__dirname + "/FunctionalComponents/simple-6.js"); }); -it("Simple 7", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-7.js"); +it("Simple 7", () => { + runTest(__dirname + "/FunctionalComponents/simple-7.js"); }); -it("Simple 8", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/simple-8.js"); +it("Simple 8", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/simple-8.js"); }); }); -it("Simple 9", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/simple-9.js"); +it("Simple 9", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/simple-9.js"); }); }); -it("Simple 10", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/simple-10.js"); +it("Simple 10", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/simple-10.js"); }); }); -it("Simple 11", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/simple-11.js"); +it("Simple 11", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/simple-11.js"); }); }); -it("Simple 12", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-12.js"); +it("Simple 12", () => { + runTest(__dirname + "/FunctionalComponents/simple-12.js"); }); -it("Runtime error", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/runtime-error.js"); +it("Runtime error", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/runtime-error.js"); }); }); -it("Simple 13", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/simple-13.js"); +it("Simple 13", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/simple-13.js"); }); }); -it("Simple 14", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-14.js"); +it("Simple 14", () => { + runTest(__dirname + "/FunctionalComponents/simple-14.js"); }); -it("Simple 15", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-15.js"); +it("Simple 15", () => { + runTest(__dirname + "/FunctionalComponents/simple-15.js"); }); -it("Simple 16", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-16.js"); +it("Simple 16", () => { + runTest(__dirname + "/FunctionalComponents/simple-16.js"); }); -it("Simple 17", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-17.js"); +it("Simple 17", () => { + runTest(__dirname + "/FunctionalComponents/simple-17.js"); }); -it("Simple 18", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-18.js"); +it("Simple 18", () => { + runTest(__dirname + "/FunctionalComponents/simple-18.js"); }); -it("Simple 19", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-19.js"); +it("Simple 19", () => { + runTest(__dirname + "/FunctionalComponents/simple-19.js"); }); -it("Simple 20", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-20.js"); +it("Simple 20", () => { + runTest(__dirname + "/FunctionalComponents/simple-20.js"); }); -it("Simple 21", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-21.js"); +it("Simple 21", () => { + runTest(__dirname + "/FunctionalComponents/simple-21.js"); }); -it("Two roots", async () => { - await runTest(__dirname + "/FunctionalComponents/two-roots.js"); +it("Two roots", () => { + runTest(__dirname + "/FunctionalComponents/two-roots.js"); }); -it("Havocing of ReactElements should not result in property assignments", async () => { - await runTest(__dirname + "/FunctionalComponents/react-element-havoc.js"); +it("Havocing of ReactElements should not result in property assignments", () => { + runTest(__dirname + "/FunctionalComponents/react-element-havoc.js"); }); -it("__reactCompilerDoNotOptimize", async () => { - await runTest(__dirname + "/FunctionalComponents/do-not-optimize.js"); +it("__reactCompilerDoNotOptimize", () => { + runTest(__dirname + "/FunctionalComponents/do-not-optimize.js"); }); -it("Mutations - not-safe 1", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/not-safe.js"); +it("Mutations - not-safe 1", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/not-safe.js"); }); }); -it("Mutations - not-safe 2", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/not-safe2.js"); +it("Mutations - not-safe 2", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/not-safe2.js"); }); }); -it("Mutations - not-safe 3", async () => { - await expectReconcilerFatalError(async () => { - await runTest(__dirname + "/FunctionalComponents/not-safe3.js"); +it("Mutations - not-safe 3", () => { + expectReconcilerFatalError(() => { + runTest(__dirname + "/FunctionalComponents/not-safe3.js"); }); }); -it("Mutations - safe 1", async () => { - await runTest(__dirname + "/FunctionalComponents/safe.js"); +it("Mutations - safe 1", () => { + runTest(__dirname + "/FunctionalComponents/safe.js"); }); -it("Mutations - safe 2", async () => { - await runTest(__dirname + "/FunctionalComponents/safe2.js"); +it("Mutations - safe 2", () => { + runTest(__dirname + "/FunctionalComponents/safe2.js"); }); -it("Mutations - safe 3", async () => { - await runTest(__dirname + "/FunctionalComponents/safe3.js"); +it("Mutations - safe 3", () => { + runTest(__dirname + "/FunctionalComponents/safe3.js"); }); -it("Handle mapped arrays", async () => { - await runTest(__dirname + "/FunctionalComponents/array-map.js"); +it("Handle mapped arrays", () => { + runTest(__dirname + "/FunctionalComponents/array-map.js"); }); -it("Handle mapped arrays 2", async () => { - await runTest(__dirname + "/FunctionalComponents/array-map2.js"); +it("Handle mapped arrays 2", () => { + runTest(__dirname + "/FunctionalComponents/array-map2.js"); }); -it("Handle mapped arrays from Array.from", async () => { - await runTest(__dirname + "/FunctionalComponents/array-from.js"); +it("Handle mapped arrays from Array.from", () => { + runTest(__dirname + "/FunctionalComponents/array-from.js"); }); -it("Simple fragments", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-fragments.js"); +it("Simple fragments", () => { + runTest(__dirname + "/FunctionalComponents/simple-fragments.js"); }); -it("Simple children", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-children.js"); +it("Simple children", () => { + runTest(__dirname + "/FunctionalComponents/simple-children.js"); }); -it("Simple with new expression", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-new-expression.js"); +it("Simple with new expression", () => { + runTest(__dirname + "/FunctionalComponents/simple-with-new-expression.js"); }); -it("Simple refs", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-refs.js"); +it("Simple refs", () => { + runTest(__dirname + "/FunctionalComponents/simple-refs.js"); }); -it("16.3 refs", async () => { - await runTest(__dirname + "/FunctionalComponents/refs.js"); +it("16.3 refs", () => { + runTest(__dirname + "/FunctionalComponents/refs.js"); }); -it("16.3 refs 2", async () => { - await runTest(__dirname + "/FunctionalComponents/refs2.js"); +it("16.3 refs 2", () => { + runTest(__dirname + "/FunctionalComponents/refs2.js"); }); -it("16.3 refs 3", async () => { - await runTest(__dirname + "/FunctionalComponents/refs3.js"); +it("16.3 refs 3", () => { + runTest(__dirname + "/FunctionalComponents/refs3.js"); }); -it("defaultProps", async () => { - await runTest(__dirname + "/FunctionalComponents/default-props.js"); +it("defaultProps", () => { + runTest(__dirname + "/FunctionalComponents/default-props.js"); }); -it("Simple with abstract props", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-abstract-props.js"); +it("Simple with abstract props", () => { + runTest(__dirname + "/FunctionalComponents/simple-with-abstract-props.js"); }); -it("Simple with unary expressions", async () => { - await runTest(__dirname + "/FunctionalComponents/simple-with-unary.js"); +it("Simple with unary expressions", () => { + runTest(__dirname + "/FunctionalComponents/simple-with-unary.js"); }); -it("Circular reference", async () => { - await runTest(__dirname + "/FunctionalComponents/circular-reference.js"); +it("Circular reference", () => { + runTest(__dirname + "/FunctionalComponents/circular-reference.js"); }); -it("Conditional", async () => { - await runTest(__dirname + "/FunctionalComponents/conditional.js"); +it("Conditional", () => { + runTest(__dirname + "/FunctionalComponents/conditional.js"); }); -it("Equivalence", async () => { +it("Equivalence", () => { let createElement = React.createElement; let count = 0; // For this test we want to also check how React.createElement @@ -232,7 +232,7 @@ it("Equivalence", async () => { return createElement(type, config); }; try { - await runTest(__dirname + "/FunctionalComponents/equivalence.js"); + runTest(__dirname + "/FunctionalComponents/equivalence.js"); } finally { // $FlowFixMe: intentional for this test React.createElement = createElement; @@ -242,90 +242,90 @@ it("Equivalence", async () => { expect(count).toEqual(28 * 4); }); -it("Delete element prop key", async () => { - await runTest(__dirname + "/FunctionalComponents/delete-element-prop-key.js"); +it("Delete element prop key", () => { + runTest(__dirname + "/FunctionalComponents/delete-element-prop-key.js"); }); -it("Dynamic props", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-props.js"); +it("Dynamic props", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-props.js"); }); -it("Dynamic context", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-context.js"); +it("Dynamic context", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-context.js"); }); -it("React.cloneElement", async () => { - await runTest(__dirname + "/FunctionalComponents/clone-element.js"); +it("React.cloneElement", () => { + runTest(__dirname + "/FunctionalComponents/clone-element.js"); }); -it("Return text", async () => { - await runTest(__dirname + "/FunctionalComponents/return-text.js"); +it("Return text", () => { + runTest(__dirname + "/FunctionalComponents/return-text.js"); }); -it("Render array twice", async () => { - await runTest(__dirname + "/FunctionalComponents/array-twice.js"); +it("Render array twice", () => { + runTest(__dirname + "/FunctionalComponents/array-twice.js"); }); -it("Render nested array children", async () => { - await runTest(__dirname + "/FunctionalComponents/nested-array-children.js"); +it("Render nested array children", () => { + runTest(__dirname + "/FunctionalComponents/nested-array-children.js"); }); -it("Return undefined", async () => { - await runTest(__dirname + "/FunctionalComponents/return-undefined.js"); +it("Return undefined", () => { + runTest(__dirname + "/FunctionalComponents/return-undefined.js"); }); -it("Null or undefined props", async () => { - await runTest(__dirname + "/FunctionalComponents/null-or-undefined-props.js"); +it("Null or undefined props", () => { + runTest(__dirname + "/FunctionalComponents/null-or-undefined-props.js"); }); -it("Event handlers", async () => { - await runTest(__dirname + "/FunctionalComponents/event-handlers.js"); +it("Event handlers", () => { + runTest(__dirname + "/FunctionalComponents/event-handlers.js"); }); -it("Class component as root", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root.js"); +it("Class component as root", () => { + runTest(__dirname + "/FunctionalComponents/class-root.js"); }); -it("Class component as root with multiple render methods", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-render-methods.js"); +it("Class component as root with multiple render methods", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-render-methods.js"); }); -it("Class component as root with props", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-props.js"); +it("Class component as root with props", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-props.js"); }); -it("Class component as root with state", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-state.js"); +it("Class component as root with state", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-state.js"); }); -it("Class component as root with refs", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-refs.js"); +it("Class component as root with refs", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-refs.js"); }); -it("Class component as root with instance variables", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars.js"); +it("Class component as root with instance variables", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars.js"); }); -it("Class component as root with instance variables #2", async () => { - await runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars-2.js"); +it("Class component as root with instance variables #2", () => { + runTest(__dirname + "/FunctionalComponents/class-root-with-instance-vars-2.js"); }); -it("Additional functions closure scope capturing", async () => { - await runTest(__dirname + "/FunctionalComponents/additional-function-regression.js"); +it("Additional functions closure scope capturing", () => { + runTest(__dirname + "/FunctionalComponents/additional-function-regression.js"); }); -it("Dynamic ReactElement type", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-type.js"); +it("Dynamic ReactElement type", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-type.js"); }); -it("Dynamic ReactElement type #2", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-type2.js"); +it("Dynamic ReactElement type #2", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-type2.js"); }); -it("Dynamic ReactElement type #3", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-type3.js"); +it("Dynamic ReactElement type #3", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-type3.js"); }); -it("Dynamic ReactElement type #4", async () => { - await runTest(__dirname + "/FunctionalComponents/dynamic-type4.js"); +it("Dynamic ReactElement type #4", () => { + runTest(__dirname + "/FunctionalComponents/dynamic-type4.js"); }); diff --git a/test/react/ReactDOM-test.js b/test/react/ReactDOM-test.js index 12a43e0aa8..e9fa14c26d 100644 --- a/test/react/ReactDOM-test.js +++ b/test/react/ReactDOM-test.js @@ -15,6 +15,6 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("createPortal", async () => { - await runTest(__dirname + "/ReactDOM/create-portal.js", false); +it("createPortal", () => { + runTest(__dirname + "/ReactDOM/create-portal.js", false); }); diff --git a/test/react/Reconciliation-test.js b/test/react/Reconciliation-test.js index 09faa0555a..2956737039 100644 --- a/test/react/Reconciliation-test.js +++ b/test/react/Reconciliation-test.js @@ -16,79 +16,79 @@ const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prep /* eslint-disable no-undef */ const { expect, it } = global; -it("Key nesting", async () => { - await runTest(__dirname + "/Reconciliation/key-nesting.js"); +it("Key nesting", () => { + runTest(__dirname + "/Reconciliation/key-nesting.js"); }); -it("Key nesting 2", async () => { - await runTest(__dirname + "/Reconciliation/key-nesting-2.js"); +it("Key nesting 2", () => { + runTest(__dirname + "/Reconciliation/key-nesting-2.js"); }); -it("Key nesting 3", async () => { - await runTest(__dirname + "/Reconciliation/key-nesting-3.js"); +it("Key nesting 3", () => { + runTest(__dirname + "/Reconciliation/key-nesting-3.js"); }); -it("Key change", async () => { - await runTest(__dirname + "/Reconciliation/key-change.js"); +it("Key change", () => { + runTest(__dirname + "/Reconciliation/key-change.js"); }); -it("Key change with fragments", async () => { - await runTest(__dirname + "/Reconciliation/key-change-fragments.js"); +it("Key change with fragments", () => { + runTest(__dirname + "/Reconciliation/key-change-fragments.js"); }); -it("Key not changing with fragments", async () => { - await runTest(__dirname + "/Reconciliation/key-not-change-fragments.js"); +it("Key not changing with fragments", () => { + runTest(__dirname + "/Reconciliation/key-not-change-fragments.js"); }); -it("Component type change", async () => { - await runTest(__dirname + "/Reconciliation/type-change.js"); +it("Component type change", () => { + runTest(__dirname + "/Reconciliation/type-change.js"); }); -it("Component type change 2", async () => { - await runTest(__dirname + "/Reconciliation/type-change2.js"); +it("Component type change 2", () => { + runTest(__dirname + "/Reconciliation/type-change2.js"); }); -it("Component type change 3", async () => { - await runTest(__dirname + "/Reconciliation/type-change3.js"); +it("Component type change 3", () => { + runTest(__dirname + "/Reconciliation/type-change3.js"); }); -it("Component type change 4", async () => { - await runTest(__dirname + "/Reconciliation/type-change4.js"); +it("Component type change 4", () => { + runTest(__dirname + "/Reconciliation/type-change4.js"); }); -it("Component type change 5", async () => { - await runTest(__dirname + "/Reconciliation/type-change5.js"); +it("Component type change 5", () => { + runTest(__dirname + "/Reconciliation/type-change5.js"); }); -it("Component type change 6", async () => { - await runTest(__dirname + "/Reconciliation/type-change6.js"); +it("Component type change 6", () => { + runTest(__dirname + "/Reconciliation/type-change6.js"); }); -it("Component type change 7", async () => { - await runTest(__dirname + "/Reconciliation/type-change7.js"); +it("Component type change 7", () => { + runTest(__dirname + "/Reconciliation/type-change7.js"); }); -it("Component type change 8", async () => { - await runTest(__dirname + "/Reconciliation/type-change8.js"); +it("Component type change 8", () => { + runTest(__dirname + "/Reconciliation/type-change8.js"); }); -it("Component type change 9", async () => { - await runTest(__dirname + "/Reconciliation/type-change9.js"); +it("Component type change 9", () => { + runTest(__dirname + "/Reconciliation/type-change9.js"); }); -it("Component type change 10", async () => { - await runTest(__dirname + "/Reconciliation/type-change10.js"); +it("Component type change 10", () => { + runTest(__dirname + "/Reconciliation/type-change10.js"); }); -it("Component type change 11", async () => { - await runTest(__dirname + "/Reconciliation/type-change11.js"); +it("Component type change 11", () => { + runTest(__dirname + "/Reconciliation/type-change11.js"); }); -it("Component type same", async () => { - await runTest(__dirname + "/Reconciliation/type-same.js"); +it("Component type same", () => { + runTest(__dirname + "/Reconciliation/type-same.js"); }); -it("Lazy branched elements", async () => { +it("Lazy branched elements", () => { let createElement = React.createElement; let count = 0; // For this test we want to also check how React.createElement @@ -102,7 +102,7 @@ it("Lazy branched elements", async () => { return createElement(type, config); }; try { - await runTest(__dirname + "/Reconciliation/lazy-branched-elements.js"); + runTest(__dirname + "/Reconciliation/lazy-branched-elements.js"); } finally { // $FlowFixMe: intentional for this test React.createElement = createElement; @@ -112,7 +112,7 @@ it("Lazy branched elements", async () => { expect(count).toEqual(8 * 4); }); -it("Lazy branched elements 2", async () => { +it("Lazy branched elements 2", () => { let createElement = React.createElement; let count = 0; // For this test we want to also check how React.createElement @@ -126,7 +126,7 @@ it("Lazy branched elements 2", async () => { return createElement(type, config); }; try { - await runTest(__dirname + "/Reconciliation/lazy-branched-elements2.js"); + runTest(__dirname + "/Reconciliation/lazy-branched-elements2.js"); } finally { // $FlowFixMe: intentional for this test React.createElement = createElement; diff --git a/test/react/RenderProps-test.js b/test/react/RenderProps-test.js index 31b2fd4353..ce0412d51b 100644 --- a/test/react/RenderProps-test.js +++ b/test/react/RenderProps-test.js @@ -15,58 +15,58 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("Relay QueryRenderer", async () => { - await runTest(__dirname + "/RenderProps/relay-query-renderer.js"); +it("Relay QueryRenderer", () => { + runTest(__dirname + "/RenderProps/relay-query-renderer.js"); }); -it("Relay QueryRenderer 2", async () => { - await runTest(__dirname + "/RenderProps/relay-query-renderer2.js"); +it("Relay QueryRenderer 2", () => { + runTest(__dirname + "/RenderProps/relay-query-renderer2.js"); }); -it("Relay QueryRenderer 3", async () => { - await runTest(__dirname + "/RenderProps/relay-query-renderer3.js"); +it("Relay QueryRenderer 3", () => { + runTest(__dirname + "/RenderProps/relay-query-renderer3.js"); }); -it("React Context", async () => { - await runTest(__dirname + "/RenderProps/react-context.js"); +it("React Context", () => { + runTest(__dirname + "/RenderProps/react-context.js"); }); -it("React Context 2", async () => { - await runTest(__dirname + "/RenderProps/react-context2.js"); +it("React Context 2", () => { + runTest(__dirname + "/RenderProps/react-context2.js"); }); -it("React Context 3", async () => { - await runTest(__dirname + "/RenderProps/react-context3.js"); +it("React Context 3", () => { + runTest(__dirname + "/RenderProps/react-context3.js"); }); -it("React Context 4", async () => { - await runTest(__dirname + "/RenderProps/react-context4.js"); +it("React Context 4", () => { + runTest(__dirname + "/RenderProps/react-context4.js"); }); -it("React Context 5", async () => { - await runTest(__dirname + "/RenderProps/react-context5.js"); +it("React Context 5", () => { + runTest(__dirname + "/RenderProps/react-context5.js"); }); -it("React Context 6", async () => { - await runTest(__dirname + "/RenderProps/react-context6.js"); +it("React Context 6", () => { + runTest(__dirname + "/RenderProps/react-context6.js"); }); -it("React Context 7", async () => { - await runTest(__dirname + "/RenderProps/react-context7.js"); +it("React Context 7", () => { + runTest(__dirname + "/RenderProps/react-context7.js"); }); -it("React Context from root tree", async () => { - await runTest(__dirname + "/RenderProps/react-root-context.js"); +it("React Context from root tree", () => { + runTest(__dirname + "/RenderProps/react-root-context.js"); }); -it("React Context from root tree 2", async () => { - await runTest(__dirname + "/RenderProps/react-root-context2.js"); +it("React Context from root tree 2", () => { + runTest(__dirname + "/RenderProps/react-root-context2.js"); }); -it("React Context from root tree 3", async () => { - await runTest(__dirname + "/RenderProps/react-root-context3.js"); +it("React Context from root tree 3", () => { + runTest(__dirname + "/RenderProps/react-root-context3.js"); }); -it("React Context from root tree 4", async () => { - await runTest(__dirname + "/RenderProps/react-root-context4.js"); +it("React Context from root tree 4", () => { + runTest(__dirname + "/RenderProps/react-root-context4.js"); }); diff --git a/test/react/ServerRendering-test.js b/test/react/ServerRendering-test.js index 90c76fbd49..9be20b8724 100644 --- a/test/react/ServerRendering-test.js +++ b/test/react/ServerRendering-test.js @@ -16,7 +16,7 @@ const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; -it("Hacker News app", async () => { +it("Hacker News app", () => { let data = JSON.parse(fs.readFileSync(__dirname + "/ServerRendering/hacker-news.json").toString()); - await runTest(__dirname + "/ServerRendering/hacker-news.js", false, data); + runTest(__dirname + "/ServerRendering/hacker-news.js", false, data); }); diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index e992329782..89ae444c28 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -78,10 +78,10 @@ function prepareReactTests() { let errorsCaptured = []; let reactTestRoot = path.join(__dirname, "../test/react/"); - async function expectReconcilerFatalError(func: Function) { + function expectReconcilerFatalError(func: Function) { checkForReconcilerFatalError = true; try { - await func(); + return func(); } catch (e) { expect(e.__isReconcilerFatalError).toBe(true); expect(e.message).toMatchSnapshot(); @@ -90,10 +90,10 @@ function prepareReactTests() { } } - async function expectPartialKeyOrRefError(func: Function) { + function expectPartialKeyOrRefError(func: Function) { checkForPartialKeyOrRefError = true; try { - await func(); + return func(); } catch (e) { expect(e.__isReconcilerFatalError).toBe(true); expect(e.message).toMatchSnapshot(); @@ -199,7 +199,7 @@ function prepareReactTests() { return moduleShim.exports; } - async function stubReactRelay(f: Function) { + function stubReactRelay(f: Function) { let oldReactRelay = ReactRelay; ReactRelay = { QueryRenderer(props) { @@ -213,13 +213,13 @@ function prepareReactTests() { }, }; try { - await f(); + return f(); } finally { ReactRelay = oldReactRelay; } } - async function runTestWithOptions(fixturePath, firstRenderOnly, data, useJSXInput, useJSXOutput) { + function runTestWithOptions(fixturePath, firstRenderOnly, data, useJSXInput, useJSXOutput) { let source = fs.readFileSync(fixturePath).toString(); if (useJSXInput) { source = transpileSource(source); @@ -268,11 +268,11 @@ function prepareReactTests() { } } - async function runTest(fixturePath: string, firstRenderOnly?: boolean = false, data?: mixed) { - await runTestWithOptions(fixturePath, firstRenderOnly, data, true, false); - await runTestWithOptions(fixturePath, firstRenderOnly, data, false, false); - await runTestWithOptions(fixturePath, firstRenderOnly, data, true, true); - await runTestWithOptions(fixturePath, firstRenderOnly, data, false, true); + function runTest(fixturePath: string, firstRenderOnly?: boolean = false, data?: mixed) { + runTestWithOptions(fixturePath, firstRenderOnly, data, true, false); + runTestWithOptions(fixturePath, firstRenderOnly, data, false, false); + runTestWithOptions(fixturePath, firstRenderOnly, data, true, true); + runTestWithOptions(fixturePath, firstRenderOnly, data, false, true); } return { From 062eac447e32bbf20473f7a765a85d44bb91c690 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 00:40:54 +0100 Subject: [PATCH 07/22] Don't run Babel twice on the same code --- test/react/prepareReactTests.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index 89ae444c28..be1a547278 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -219,11 +219,7 @@ function prepareReactTests() { } } - function runTestWithOptions(fixturePath, firstRenderOnly, data, useJSXInput, useJSXOutput) { - let source = fs.readFileSync(fixturePath).toString(); - if (useJSXInput) { - source = transpileSource(source); - } + function runTestWithOptions(source, firstRenderOnly, data, useJSXOutput) { let { compiledSource, statistics } = compileSourceWithPrepack(source); expect(statistics).toMatchSnapshot(); @@ -269,10 +265,12 @@ function prepareReactTests() { } function runTest(fixturePath: string, firstRenderOnly?: boolean = false, data?: mixed) { - runTestWithOptions(fixturePath, firstRenderOnly, data, true, false); - runTestWithOptions(fixturePath, firstRenderOnly, data, false, false); - runTestWithOptions(fixturePath, firstRenderOnly, data, true, true); - runTestWithOptions(fixturePath, firstRenderOnly, data, false, true); + let source = fs.readFileSync(fixturePath).toString(); + let jsxSource = transpileSource(source); + runTestWithOptions(jsxSource, firstRenderOnly, data, false); + runTestWithOptions(source, firstRenderOnly, data, false); + runTestWithOptions(jsxSource, firstRenderOnly, data, true); + runTestWithOptions(source, firstRenderOnly, data, true); } return { From c27fd0568a49f349422c0615e5c7b81c7a260e73 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 00:51:18 +0100 Subject: [PATCH 08/22] Add a comment to broken test --- test/react/FirstRenderOnly-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/react/FirstRenderOnly-test.js b/test/react/FirstRenderOnly-test.js index c10edfb1da..e4c72165ee 100644 --- a/test/react/FirstRenderOnly-test.js +++ b/test/react/FirstRenderOnly-test.js @@ -82,6 +82,7 @@ it("React Context 6", () => { runTest(__dirname + "/FirstRenderOnly/react-context6.js"); }); +// Known to be broken due to incomplete arrow function support. it.skip("Replace this in callbacks", () => { runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js"); }); From 5c75f482cf384249922e787608cbe72d481d6d5b Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 01:14:50 +0100 Subject: [PATCH 09/22] Make runTest argument an object --- test/react/FBMocks-test.js | 2 +- test/react/FirstRenderOnly-test.js | 38 +++++++++++++++--------------- test/react/ReactDOM-test.js | 2 +- test/react/ServerRendering-test.js | 2 +- test/react/prepareReactTests.js | 9 ++++++- 5 files changed, 30 insertions(+), 23 deletions(-) diff --git a/test/react/FBMocks-test.js b/test/react/FBMocks-test.js index 326afbb92f..ba8d9c6285 100644 --- a/test/react/FBMocks-test.js +++ b/test/react/FBMocks-test.js @@ -133,7 +133,7 @@ it("repl example", () => { it("Hacker News app", () => { let data = JSON.parse(fs.readFileSync(__dirname + "/FBMocks/hacker-news.json").toString()); - runTest(__dirname + "/FBMocks/hacker-news.js", false, data); + runTest(__dirname + "/FBMocks/hacker-news.js", { data }); }); it("Function bind", () => { diff --git a/test/react/FirstRenderOnly-test.js b/test/react/FirstRenderOnly-test.js index e4c72165ee..1ce9b7434b 100644 --- a/test/react/FirstRenderOnly-test.js +++ b/test/react/FirstRenderOnly-test.js @@ -16,81 +16,81 @@ const { runTest } = prepareReactTests(); const { it } = global; it("Simple", () => { - runTest(__dirname + "/FirstRenderOnly/simple.js", true); + runTest(__dirname + "/FirstRenderOnly/simple.js", { firstRenderOnly: true }); }); it("Simple #2", () => { - runTest(__dirname + "/FirstRenderOnly/simple-2.js", true); + runTest(__dirname + "/FirstRenderOnly/simple-2.js", { firstRenderOnly: true }); }); it("Simple #3", () => { - runTest(__dirname + "/FirstRenderOnly/simple-3.js", true); + runTest(__dirname + "/FirstRenderOnly/simple-3.js", { firstRenderOnly: true }); }); // Should be refined in a follow up PR to check for // functions and keys on deep referenced objects linking // to host components it("Simple #4", () => { - runTest(__dirname + "/FirstRenderOnly/simple-4.js", true); + runTest(__dirname + "/FirstRenderOnly/simple-4.js", { firstRenderOnly: true }); }); it("componentWillMount", () => { - runTest(__dirname + "/FirstRenderOnly/will-mount.js", true); + runTest(__dirname + "/FirstRenderOnly/will-mount.js", { firstRenderOnly: true }); }); it("getDerivedStateFromProps", () => { - runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props.js", true); + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props.js", { firstRenderOnly: true }); }); it("getDerivedStateFromProps 2", () => { - runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props2.js", true); + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props2.js", { firstRenderOnly: true }); }); it("getDerivedStateFromProps 3", () => { - runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props3.js", true); + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props3.js", { firstRenderOnly: true }); }); it("getDerivedStateFromProps 4", () => { - runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props4.js", true); + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props4.js", { firstRenderOnly: true }); }); it("getDerivedStateFromProps 5", () => { - runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props5.js", true); + runTest(__dirname + "/FirstRenderOnly/get-derived-state-from-props5.js", { firstRenderOnly: true }); }); it("React Context", () => { - runTest(__dirname + "/FirstRenderOnly/react-context.js"); + runTest(__dirname + "/FirstRenderOnly/react-context.js", { firstRenderOnly: true }); }); it("React Context 2", () => { - runTest(__dirname + "/FirstRenderOnly/react-context2.js"); + runTest(__dirname + "/FirstRenderOnly/react-context2.js", { firstRenderOnly: true }); }); it("React Context 3", () => { - runTest(__dirname + "/FirstRenderOnly/react-context3.js"); + runTest(__dirname + "/FirstRenderOnly/react-context3.js", { firstRenderOnly: true }); }); it("React Context 4", () => { - runTest(__dirname + "/FirstRenderOnly/react-context4.js"); + runTest(__dirname + "/FirstRenderOnly/react-context4.js", { firstRenderOnly: true }); }); it("React Context 5", () => { - runTest(__dirname + "/FirstRenderOnly/react-context5.js"); + runTest(__dirname + "/FirstRenderOnly/react-context5.js", { firstRenderOnly: true }); }); it("React Context 6", () => { - runTest(__dirname + "/FirstRenderOnly/react-context6.js"); + runTest(__dirname + "/FirstRenderOnly/react-context6.js", { firstRenderOnly: true }); }); // Known to be broken due to incomplete arrow function support. it.skip("Replace this in callbacks", () => { - runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js"); + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks.js", { firstRenderOnly: true }); }); it("Replace this in callbacks 2", () => { - runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks2.js"); + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks2.js", { firstRenderOnly: true }); }); it("Replace this in callbacks 3", () => { - runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks3.js"); + runTest(__dirname + "/FirstRenderOnly/replace-this-in-callbacks3.js", { firstRenderOnly: true }); }); diff --git a/test/react/ReactDOM-test.js b/test/react/ReactDOM-test.js index e9fa14c26d..2455eabe6e 100644 --- a/test/react/ReactDOM-test.js +++ b/test/react/ReactDOM-test.js @@ -16,5 +16,5 @@ const { runTest } = prepareReactTests(); const { it } = global; it("createPortal", () => { - runTest(__dirname + "/ReactDOM/create-portal.js", false); + runTest(__dirname + "/ReactDOM/create-portal.js"); }); diff --git a/test/react/ServerRendering-test.js b/test/react/ServerRendering-test.js index 9be20b8724..112b5fdec2 100644 --- a/test/react/ServerRendering-test.js +++ b/test/react/ServerRendering-test.js @@ -18,5 +18,5 @@ const { it } = global; it("Hacker News app", () => { let data = JSON.parse(fs.readFileSync(__dirname + "/ServerRendering/hacker-news.json").toString()); - runTest(__dirname + "/ServerRendering/hacker-news.js", false, data); + runTest(__dirname + "/ServerRendering/hacker-news.js", { data }); }); diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index be1a547278..2f45410eff 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -264,7 +264,14 @@ function prepareReactTests() { } } - function runTest(fixturePath: string, firstRenderOnly?: boolean = false, data?: mixed) { + + type TestOptions = { + firstRenderOnly?: boolean, + data?: mixed, + }; + + function runTest(fixturePath: string, options: TestOptions = {}) { + let {firstRenderOnly = false, data} = options; let source = fs.readFileSync(fixturePath).toString(); let jsxSource = transpileSource(source); runTestWithOptions(jsxSource, firstRenderOnly, data, false); From 154d3315eabee46358107d17596d47b8db91b63e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 01:19:32 +0100 Subject: [PATCH 10/22] Fix a bug with unused argument --- test/react/prepareReactTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index 2f45410eff..229bdf2642 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -102,7 +102,7 @@ function prepareReactTests() { } } - function compileSourceWithPrepack(source, useJSXOutput) { + function compileSourceWithPrepack(source: string, useJSXOutput: boolean): string { let code = `(function(){${source}})()`; let prepackOptions = { errorHandler: diag => { @@ -220,7 +220,7 @@ function prepareReactTests() { } function runTestWithOptions(source, firstRenderOnly, data, useJSXOutput) { - let { compiledSource, statistics } = compileSourceWithPrepack(source); + let { compiledSource, statistics } = compileSourceWithPrepack(source, useJSXOutput); expect(statistics).toMatchSnapshot(); let A = runSource(source); From 2fdda23da3427448dbe574dbfc1dfe350b25c763 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 02:13:00 +0100 Subject: [PATCH 11/22] Fix and simplify error handling I introduced a bug where we wouldn't snapshot cases after the first failure, even if failures are expected. This wasn't a problem in the original code because it separated JSX/no-JSX modes into separate tests. I fixed my bug by rewriting how error logic works. Hopefully it's more clear now too because it doesn't have to bubble errors all the way up just to run an assertion. --- test/react/AssignSpread-test.js | 8 +- test/react/FBMocks-test.js | 22 ++--- test/react/FunctionalComponents-test.js | 38 ++++---- test/react/Reconciliation-test.js | 2 +- .../__snapshots__/AssignSpread-test.js.snap | 19 ++++ test/react/__snapshots__/FBMocks-test.js.snap | 30 ++++++ .../FunctionalComponents-test.js.snap | 48 ++++++++++ test/react/prepareReactTests.js | 96 ++++++++----------- 8 files changed, 174 insertions(+), 89 deletions(-) diff --git a/test/react/AssignSpread-test.js b/test/react/AssignSpread-test.js index 0aaa1324a6..f8f9e9c47b 100644 --- a/test/react/AssignSpread-test.js +++ b/test/react/AssignSpread-test.js @@ -11,14 +11,16 @@ const React = require("react"); const prepareReactTests = require("./prepareReactTests"); -const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); +const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { expect, it } = global; it("Unsafe spread", () => { - expectPartialKeyOrRefError(() => { - runTest(__dirname + "/AssignSpread/unsafe-spread.js"); + runTest(__dirname + "/AssignSpread/unsafe-spread.js", { + expectReconcilerError: true, + // Don't attempt to recover even from PP0025. + shouldRecover: () => false, }); }); diff --git a/test/react/FBMocks-test.js b/test/react/FBMocks-test.js index ba8d9c6285..f5382544f5 100644 --- a/test/react/FBMocks-test.js +++ b/test/react/FBMocks-test.js @@ -11,7 +11,7 @@ const fs = require("fs"); const prepareReactTests = require("./prepareReactTests"); -const { runTest, expectReconcilerFatalError, stubReactRelay } = prepareReactTests(); +const { runTest, stubReactRelay } = prepareReactTests(); /* eslint-disable no-undef */ const { it } = global; @@ -67,8 +67,8 @@ it("fb-www 11", () => { }); it("fb-www 12", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FBMocks/fb12.js"); + runTest(__dirname + "/FBMocks/fb12.js", { + expectReconcilerError: true, }); }); @@ -81,14 +81,14 @@ it("fb-www 14", () => { }); it("fb-www 15", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FBMocks/fb15.js"); + runTest(__dirname + "/FBMocks/fb15.js", { + expectReconcilerError: true, }); }); it("fb-www 16", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FBMocks/fb16.js"); + runTest(__dirname + "/FBMocks/fb16.js", { + expectReconcilerError: true, }); }); @@ -100,14 +100,14 @@ it("fb-www 17", () => { // - "uri.foo" on abstract string does not exist // - unused.bar() does not exist (even if in try/catch) it("fb-www 18", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FBMocks/fb18.js"); + runTest(__dirname + "/FBMocks/fb18.js", { + expectReconcilerError: true, }); }); it("fb-www 19", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FBMocks/fb19.js"); + runTest(__dirname + "/FBMocks/fb19.js", { + expectReconcilerError: true, }); }); diff --git a/test/react/FunctionalComponents-test.js b/test/react/FunctionalComponents-test.js index 60249fa2d7..8e79af0dd7 100644 --- a/test/react/FunctionalComponents-test.js +++ b/test/react/FunctionalComponents-test.js @@ -11,7 +11,7 @@ const React = require("react"); const prepareReactTests = require("./prepareReactTests"); -const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); +const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { expect, it } = global; @@ -45,26 +45,26 @@ it("Simple 7", () => { }); it("Simple 8", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/simple-8.js"); + runTest(__dirname + "/FunctionalComponents/simple-8.js", { + expectReconcilerError: true, }); }); it("Simple 9", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/simple-9.js"); + runTest(__dirname + "/FunctionalComponents/simple-9.js", { + expectReconcilerError: true, }); }); it("Simple 10", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/simple-10.js"); + runTest(__dirname + "/FunctionalComponents/simple-10.js", { + expectReconcilerError: true, }); }); it("Simple 11", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/simple-11.js"); + runTest(__dirname + "/FunctionalComponents/simple-11.js", { + expectReconcilerError: true, }); }); @@ -73,14 +73,14 @@ it("Simple 12", () => { }); it("Runtime error", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/runtime-error.js"); + runTest(__dirname + "/FunctionalComponents/runtime-error.js", { + expectReconcilerError: true, }); }); it("Simple 13", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/simple-13.js"); + runTest(__dirname + "/FunctionalComponents/simple-13.js", { + expectReconcilerError: true, }); }); @@ -129,20 +129,20 @@ it("__reactCompilerDoNotOptimize", () => { }); it("Mutations - not-safe 1", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/not-safe.js"); + runTest(__dirname + "/FunctionalComponents/not-safe.js", { + expectReconcilerError: true, }); }); it("Mutations - not-safe 2", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/not-safe2.js"); + runTest(__dirname + "/FunctionalComponents/not-safe2.js", { + expectReconcilerError: true, }); }); it("Mutations - not-safe 3", () => { - expectReconcilerFatalError(() => { - runTest(__dirname + "/FunctionalComponents/not-safe3.js"); + runTest(__dirname + "/FunctionalComponents/not-safe3.js", { + expectReconcilerError: true, }); }); diff --git a/test/react/Reconciliation-test.js b/test/react/Reconciliation-test.js index 2956737039..abc910137a 100644 --- a/test/react/Reconciliation-test.js +++ b/test/react/Reconciliation-test.js @@ -11,7 +11,7 @@ const React = require("react"); const prepareReactTests = require("./prepareReactTests"); -const { runTest, expectReconcilerFatalError, expectPartialKeyOrRefError } = prepareReactTests(); +const { runTest } = prepareReactTests(); /* eslint-disable no-undef */ const { expect, it } = global; diff --git a/test/react/__snapshots__/AssignSpread-test.js.snap b/test/react/__snapshots__/AssignSpread-test.js.snap index 3167013fe2..55f4688112 100644 --- a/test/react/__snapshots__/AssignSpread-test.js.snap +++ b/test/react/__snapshots__/AssignSpread-test.js.snap @@ -1786,3 +1786,22 @@ ReactStatistics { `; exports[`Unsafe spread 2`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; + +exports[`Unsafe spread 3`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Unsafe spread 4`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; diff --git a/test/react/__snapshots__/FBMocks-test.js.snap b/test/react/__snapshots__/FBMocks-test.js.snap index d558769193..4c08cebbc5 100644 --- a/test/react/__snapshots__/FBMocks-test.js.snap +++ b/test/react/__snapshots__/FBMocks-test.js.snap @@ -1658,6 +1658,12 @@ ReactStatistics { exports[`fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 12 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 12 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 12 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`fb-www 13 1`] = ` ReactStatistics { "componentsEvaluated": 0, @@ -1824,8 +1830,20 @@ ReactStatistics { exports[`fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; +exports[`fb-www 15 2`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; + +exports[`fb-www 15 3`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; + +exports[`fb-www 15 4`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; + exports[`fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; +exports[`fb-www 16 2`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; + +exports[`fb-www 16 3`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; + +exports[`fb-www 16 4`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; + exports[`fb-www 17 1`] = ` ReactStatistics { "componentsEvaluated": 4, @@ -1980,8 +1998,20 @@ ReactStatistics { exports[`fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 18 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 18 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 18 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 19 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 19 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`fb-www 19 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`fb-www 20 1`] = ` ReactStatistics { "componentsEvaluated": 2, diff --git a/test/react/__snapshots__/FunctionalComponents-test.js.snap b/test/react/__snapshots__/FunctionalComponents-test.js.snap index 8da8c23fe2..2faf90fbb8 100644 --- a/test/react/__snapshots__/FunctionalComponents-test.js.snap +++ b/test/react/__snapshots__/FunctionalComponents-test.js.snap @@ -2850,6 +2850,12 @@ ReactStatistics { exports[`Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; +exports[`Mutations - not-safe 1 2`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; + +exports[`Mutations - not-safe 1 3`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; + +exports[`Mutations - not-safe 1 4`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; + exports[`Mutations - not-safe 2 1`] = ` ReactStatistics { "componentsEvaluated": 1, @@ -2920,6 +2926,12 @@ ReactStatistics { exports[`Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; +exports[`Mutations - not-safe 3 2`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; + +exports[`Mutations - not-safe 3 3`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; + +exports[`Mutations - not-safe 3 4`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; + exports[`Mutations - safe 1 1`] = ` ReactStatistics { "componentsEvaluated": 1, @@ -3750,6 +3762,12 @@ ReactStatistics { exports[`Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Runtime error 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Runtime error 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Runtime error 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`Simple 1`] = ` ReactStatistics { "componentsEvaluated": 4, @@ -4440,12 +4458,36 @@ ReactStatistics { exports[`Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 8 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 8 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 8 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + exports[`Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 9 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 9 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 9 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + exports[`Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 10 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 10 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + +exports[`Simple 10 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; + exports[`Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 11 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 11 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 11 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`Simple 12 1`] = ` ReactStatistics { "componentsEvaluated": 2, @@ -4544,6 +4586,12 @@ ReactStatistics { exports[`Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 13 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 13 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + +exports[`Simple 13 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; + exports[`Simple 14 1`] = ` ReactStatistics { "componentsEvaluated": 1, diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index 229bdf2642..f7ac374901 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -73,43 +73,21 @@ MockURI.prototype.makeString = function() { }; function prepareReactTests() { - let checkForReconcilerFatalError = false; - let checkForPartialKeyOrRefError = false; - let errorsCaptured = []; - let reactTestRoot = path.join(__dirname, "../test/react/"); - - function expectReconcilerFatalError(func: Function) { - checkForReconcilerFatalError = true; - try { - return func(); - } catch (e) { - expect(e.__isReconcilerFatalError).toBe(true); - expect(e.message).toMatchSnapshot(); - } finally { - checkForReconcilerFatalError = false; - } - } - - function expectPartialKeyOrRefError(func: Function) { - checkForPartialKeyOrRefError = true; - try { - return func(); - } catch (e) { - expect(e.__isReconcilerFatalError).toBe(true); - expect(e.message).toMatchSnapshot(); - } finally { - checkForPartialKeyOrRefError = false; - } - } - - function compileSourceWithPrepack(source: string, useJSXOutput: boolean): string { + function compileSourceWithPrepack( + source: string, + useJSXOutput: boolean, + diagnosticLog: mixed[], + shouldRecover: (errorCode: string) => boolean, + ): {| + compiledSource: string, + statistics: Object, + |} { let code = `(function(){${source}})()`; let prepackOptions = { errorHandler: diag => { - errorsCaptured.push(diag); + diagnosticLog.push(diag); if (diag.severity !== "Warning" && diag.severity !== "Information") { - if (diag.errorCode === "PP0025" && !checkForPartialKeyOrRefError) { - // recover from `unable to evaluate "key" and "ref" on a ReactElement + if (shouldRecover(diag.errorCode)) { return "Recover"; } return "Fail"; @@ -128,19 +106,7 @@ function prepareReactTests() { invariantLevel: 0, stripFlow: true, }; - let serialized; - errorsCaptured = []; - try { - serialized = prepackSources([{ filePath: "", fileContents: code, sourceMapContents: "" }], prepackOptions); - } catch (e) { - if (e.__isReconcilerFatalError && (checkForReconcilerFatalError || checkForPartialKeyOrRefError)) { - throw e; - } - errorsCaptured.forEach(error => { - console.error(error); - }); - throw e; - } + const serialized = prepackSources([{ filePath: "", fileContents: code, sourceMapContents: "" }], prepackOptions); if (serialized == null || serialized.reactStatistics == null) { throw new Error("React test runner failed during serialization"); } @@ -219,8 +185,29 @@ function prepareReactTests() { } } - function runTestWithOptions(source, firstRenderOnly, data, useJSXOutput) { - let { compiledSource, statistics } = compileSourceWithPrepack(source, useJSXOutput); + function runTestWithOptions(source, useJSXOutput, options) { + let { + firstRenderOnly = false, + // By default, we recover from PP0025 even though it's technically unsafe. + // We do the same in debug-fb-www script. + shouldRecover = (errorCode) => errorCode === 'PP0025', + expectReconcilerError = false, + data + } = options; + let diagnosticLog = []; + let compiledSource, statistics; + try { + ({ compiledSource, statistics } = compileSourceWithPrepack(source, useJSXOutput, diagnosticLog, shouldRecover)); + } catch (err) { + if (err.__isReconcilerFatalError && expectReconcilerError) { + expect(err.message).toMatchSnapshot(); + return; + } + diagnosticLog.forEach(diag => { + console.error(diag); + }); + throw err; + } expect(statistics).toMatchSnapshot(); let A = runSource(source); @@ -268,21 +255,20 @@ function prepareReactTests() { type TestOptions = { firstRenderOnly?: boolean, data?: mixed, + expectReconcilerError?: boolean, + shouldRecover?: (errorCode: string) => boolean, }; function runTest(fixturePath: string, options: TestOptions = {}) { - let {firstRenderOnly = false, data} = options; let source = fs.readFileSync(fixturePath).toString(); let jsxSource = transpileSource(source); - runTestWithOptions(jsxSource, firstRenderOnly, data, false); - runTestWithOptions(source, firstRenderOnly, data, false); - runTestWithOptions(jsxSource, firstRenderOnly, data, true); - runTestWithOptions(source, firstRenderOnly, data, true); + runTestWithOptions(jsxSource, false, options); + runTestWithOptions(source, false, options); + runTestWithOptions(jsxSource, true, options); + runTestWithOptions(source, true, options); } return { - expectReconcilerFatalError, - expectPartialKeyOrRefError, runTest, stubReactRelay, }; From 4ec705bfc75ef7252e8dceeea1fb38d84ebda4ac Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 02:51:43 +0100 Subject: [PATCH 12/22] Give names to snapshots again --- .../__snapshots__/AssignSpread-test.js.snap | 154 +-- .../ClassComponents-test.js.snap | 264 ++--- test/react/__snapshots__/FBMocks-test.js.snap | 392 +++---- .../FactoryComponents-test.js.snap | 76 +- .../FirstRenderOnly-test.js.snap | 566 ++++----- .../FunctionalComponents-test.js.snap | 1014 ++++++++--------- .../react/__snapshots__/ReactDOM-test.js.snap | 8 +- .../__snapshots__/Reconciliation-test.js.snap | 792 ++++++------- .../__snapshots__/RenderProps-test.js.snap | 688 +++++------ .../ServerRendering-test.js.snap | 8 +- test/react/prepareReactTests.js | 14 +- 11 files changed, 1988 insertions(+), 1988 deletions(-) diff --git a/test/react/__snapshots__/AssignSpread-test.js.snap b/test/react/__snapshots__/AssignSpread-test.js.snap index 55f4688112..40a0473e5c 100644 --- a/test/react/__snapshots__/AssignSpread-test.js.snap +++ b/test/react/__snapshots__/AssignSpread-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Simple with Object.assign #2 1`] = ` +exports[`Simple with Object.assign #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -24,7 +24,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #2 2`] = ` +exports[`Simple with Object.assign #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -48,7 +48,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #2 3`] = ` +exports[`Simple with Object.assign #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -72,7 +72,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #2 4`] = ` +exports[`Simple with Object.assign #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -96,7 +96,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #3 1`] = ` +exports[`Simple with Object.assign #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -113,7 +113,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #3 2`] = ` +exports[`Simple with Object.assign #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -130,7 +130,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #3 3`] = ` +exports[`Simple with Object.assign #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -147,7 +147,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #3 4`] = ` +exports[`Simple with Object.assign #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -164,7 +164,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #4 1`] = ` +exports[`Simple with Object.assign #4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -181,7 +181,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #4 2`] = ` +exports[`Simple with Object.assign #4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -198,7 +198,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #4 3`] = ` +exports[`Simple with Object.assign #4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -215,7 +215,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #4 4`] = ` +exports[`Simple with Object.assign #4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -232,7 +232,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #5 1`] = ` +exports[`Simple with Object.assign #5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -249,7 +249,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #5 2`] = ` +exports[`Simple with Object.assign #5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -266,7 +266,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #5 3`] = ` +exports[`Simple with Object.assign #5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -283,7 +283,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign #5 4`] = ` +exports[`Simple with Object.assign #5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -300,7 +300,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign 1`] = ` +exports[`Simple with Object.assign: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -324,7 +324,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign 2`] = ` +exports[`Simple with Object.assign: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -348,7 +348,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign 3`] = ` +exports[`Simple with Object.assign: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -372,7 +372,7 @@ ReactStatistics { } `; -exports[`Simple with Object.assign 4`] = ` +exports[`Simple with Object.assign: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -396,7 +396,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #2 1`] = ` +exports[`Simple with multiple JSX spreads #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -427,7 +427,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #2 2`] = ` +exports[`Simple with multiple JSX spreads #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -458,7 +458,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #2 3`] = ` +exports[`Simple with multiple JSX spreads #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -489,7 +489,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #2 4`] = ` +exports[`Simple with multiple JSX spreads #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -520,7 +520,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #3 1`] = ` +exports[`Simple with multiple JSX spreads #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -544,7 +544,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #3 2`] = ` +exports[`Simple with multiple JSX spreads #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -568,7 +568,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #3 3`] = ` +exports[`Simple with multiple JSX spreads #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -592,7 +592,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #3 4`] = ` +exports[`Simple with multiple JSX spreads #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -616,7 +616,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #4 1`] = ` +exports[`Simple with multiple JSX spreads #4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -633,7 +633,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #4 2`] = ` +exports[`Simple with multiple JSX spreads #4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -650,7 +650,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #4 3`] = ` +exports[`Simple with multiple JSX spreads #4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -667,7 +667,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #4 4`] = ` +exports[`Simple with multiple JSX spreads #4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -684,7 +684,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #5 1`] = ` +exports[`Simple with multiple JSX spreads #5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -701,7 +701,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #5 2`] = ` +exports[`Simple with multiple JSX spreads #5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -718,7 +718,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #5 3`] = ` +exports[`Simple with multiple JSX spreads #5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -735,7 +735,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #5 4`] = ` +exports[`Simple with multiple JSX spreads #5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -752,7 +752,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #6 1`] = ` +exports[`Simple with multiple JSX spreads #6: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -769,7 +769,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #6 2`] = ` +exports[`Simple with multiple JSX spreads #6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -786,7 +786,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #6 3`] = ` +exports[`Simple with multiple JSX spreads #6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -803,7 +803,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #6 4`] = ` +exports[`Simple with multiple JSX spreads #6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -820,7 +820,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #7 1`] = ` +exports[`Simple with multiple JSX spreads #7: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -837,7 +837,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #7 2`] = ` +exports[`Simple with multiple JSX spreads #7: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -854,7 +854,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #7 3`] = ` +exports[`Simple with multiple JSX spreads #7: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -871,7 +871,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #7 4`] = ` +exports[`Simple with multiple JSX spreads #7: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -888,7 +888,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #8 1`] = ` +exports[`Simple with multiple JSX spreads #8: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -905,7 +905,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #8 2`] = ` +exports[`Simple with multiple JSX spreads #8: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -922,7 +922,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #8 3`] = ` +exports[`Simple with multiple JSX spreads #8: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -939,7 +939,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #8 4`] = ` +exports[`Simple with multiple JSX spreads #8: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -956,7 +956,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #9 1`] = ` +exports[`Simple with multiple JSX spreads #9: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -993,7 +993,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #9 2`] = ` +exports[`Simple with multiple JSX spreads #9: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1030,7 +1030,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #9 3`] = ` +exports[`Simple with multiple JSX spreads #9: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1067,7 +1067,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #9 4`] = ` +exports[`Simple with multiple JSX spreads #9: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1104,7 +1104,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #10 1`] = ` +exports[`Simple with multiple JSX spreads #10: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1141,7 +1141,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #10 2`] = ` +exports[`Simple with multiple JSX spreads #10: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1178,7 +1178,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #10 3`] = ` +exports[`Simple with multiple JSX spreads #10: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1215,7 +1215,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #10 4`] = ` +exports[`Simple with multiple JSX spreads #10: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1252,7 +1252,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #11 1`] = ` +exports[`Simple with multiple JSX spreads #11: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1289,7 +1289,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #11 2`] = ` +exports[`Simple with multiple JSX spreads #11: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1326,7 +1326,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #11 3`] = ` +exports[`Simple with multiple JSX spreads #11: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1363,7 +1363,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #11 4`] = ` +exports[`Simple with multiple JSX spreads #11: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1400,7 +1400,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #12 1`] = ` +exports[`Simple with multiple JSX spreads #12: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1424,7 +1424,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #12 2`] = ` +exports[`Simple with multiple JSX spreads #12: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1448,7 +1448,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #12 3`] = ` +exports[`Simple with multiple JSX spreads #12: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1472,7 +1472,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #12 4`] = ` +exports[`Simple with multiple JSX spreads #12: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1496,7 +1496,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #13 1`] = ` +exports[`Simple with multiple JSX spreads #13: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1533,7 +1533,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #13 2`] = ` +exports[`Simple with multiple JSX spreads #13: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1570,7 +1570,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #13 3`] = ` +exports[`Simple with multiple JSX spreads #13: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1607,7 +1607,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads #13 4`] = ` +exports[`Simple with multiple JSX spreads #13: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1644,7 +1644,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 1`] = ` +exports[`Simple with multiple JSX spreads: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1675,7 +1675,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 2`] = ` +exports[`Simple with multiple JSX spreads: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1706,7 +1706,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 3`] = ` +exports[`Simple with multiple JSX spreads: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1737,7 +1737,7 @@ ReactStatistics { } `; -exports[`Simple with multiple JSX spreads 4`] = ` +exports[`Simple with multiple JSX spreads: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1768,7 +1768,7 @@ ReactStatistics { } `; -exports[`Unsafe spread 1`] = ` +exports[`Unsafe spread: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1785,9 +1785,7 @@ ReactStatistics { } `; -exports[`Unsafe spread 2`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; - -exports[`Unsafe spread 3`] = ` +exports[`Unsafe spread: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1804,4 +1802,6 @@ ReactStatistics { } `; -exports[`Unsafe spread 4`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; +exports[`Unsafe spread: (createElement => JSX) 1`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; + +exports[`Unsafe spread: (createElement => createElement) 1`] = `"Failed to optimize React component tree for \\"App\\" due to a fatal error during evaluation: A fatal error occurred while prepacking."`; diff --git a/test/react/__snapshots__/ClassComponents-test.js.snap b/test/react/__snapshots__/ClassComponents-test.js.snap index 87226d04a5..40ba42a813 100644 --- a/test/react/__snapshots__/ClassComponents-test.js.snap +++ b/test/react/__snapshots__/ClassComponents-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Classes with state 1`] = ` +exports[`Classes with state: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -17,7 +17,7 @@ ReactStatistics { } `; -exports[`Classes with state 2`] = ` +exports[`Classes with state: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -34,7 +34,7 @@ ReactStatistics { } `; -exports[`Classes with state 3`] = ` +exports[`Classes with state: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -51,7 +51,7 @@ ReactStatistics { } `; -exports[`Classes with state 4`] = ` +exports[`Classes with state: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -68,7 +68,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #2 1`] = ` +exports[`Complex class components folding into functional root component #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -99,7 +99,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #2 2`] = ` +exports[`Complex class components folding into functional root component #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -130,7 +130,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #2 3`] = ` +exports[`Complex class components folding into functional root component #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -161,7 +161,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #2 4`] = ` +exports[`Complex class components folding into functional root component #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -192,7 +192,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #3 1`] = ` +exports[`Complex class components folding into functional root component #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -223,7 +223,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #3 2`] = ` +exports[`Complex class components folding into functional root component #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -254,7 +254,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #3 3`] = ` +exports[`Complex class components folding into functional root component #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -285,7 +285,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #3 4`] = ` +exports[`Complex class components folding into functional root component #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -316,7 +316,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #4 1`] = ` +exports[`Complex class components folding into functional root component #4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 12, "evaluatedRootNodes": Array [ @@ -394,7 +394,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #4 2`] = ` +exports[`Complex class components folding into functional root component #4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 12, "evaluatedRootNodes": Array [ @@ -472,7 +472,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #4 3`] = ` +exports[`Complex class components folding into functional root component #4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 12, "evaluatedRootNodes": Array [ @@ -550,7 +550,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #4 4`] = ` +exports[`Complex class components folding into functional root component #4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 12, "evaluatedRootNodes": Array [ @@ -628,7 +628,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #5 1`] = ` +exports[`Complex class components folding into functional root component #5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -659,7 +659,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #5 2`] = ` +exports[`Complex class components folding into functional root component #5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -690,7 +690,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #5 3`] = ` +exports[`Complex class components folding into functional root component #5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -721,7 +721,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component #5 4`] = ` +exports[`Complex class components folding into functional root component #5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -752,7 +752,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component 1`] = ` +exports[`Complex class components folding into functional root component: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -776,7 +776,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component 2`] = ` +exports[`Complex class components folding into functional root component: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -800,7 +800,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component 3`] = ` +exports[`Complex class components folding into functional root component: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -824,7 +824,7 @@ ReactStatistics { } `; -exports[`Complex class components folding into functional root component 4`] = ` +exports[`Complex class components folding into functional root component: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -848,7 +848,7 @@ ReactStatistics { } `; -exports[`Inheritance chaining 1`] = ` +exports[`Inheritance chaining: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -872,7 +872,7 @@ ReactStatistics { } `; -exports[`Inheritance chaining 2`] = ` +exports[`Inheritance chaining: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -896,7 +896,7 @@ ReactStatistics { } `; -exports[`Inheritance chaining 3`] = ` +exports[`Inheritance chaining: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -920,7 +920,7 @@ ReactStatistics { } `; -exports[`Inheritance chaining 4`] = ` +exports[`Inheritance chaining: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -944,75 +944,7 @@ ReactStatistics { } `; -exports[`Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple classes #2 1`] = ` +exports[`Simple classes #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1029,7 +961,7 @@ ReactStatistics { } `; -exports[`Simple classes #2 2`] = ` +exports[`Simple classes #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1046,7 +978,7 @@ ReactStatistics { } `; -exports[`Simple classes #2 3`] = ` +exports[`Simple classes #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1063,7 +995,7 @@ ReactStatistics { } `; -exports[`Simple classes #2 4`] = ` +exports[`Simple classes #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1080,7 +1012,7 @@ ReactStatistics { } `; -exports[`Simple classes #3 1`] = ` +exports[`Simple classes #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1104,7 +1036,7 @@ ReactStatistics { } `; -exports[`Simple classes #3 2`] = ` +exports[`Simple classes #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1128,7 +1060,7 @@ ReactStatistics { } `; -exports[`Simple classes #3 3`] = ` +exports[`Simple classes #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1152,7 +1084,7 @@ ReactStatistics { } `; -exports[`Simple classes #3 4`] = ` +exports[`Simple classes #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1176,7 +1108,7 @@ ReactStatistics { } `; -exports[`Simple classes 1`] = ` +exports[`Simple classes with Array.from 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1185,7 +1117,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -1195,12 +1127,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Simple classes 2`] = ` +exports[`Simple classes with Array.from 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1209,7 +1141,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -1219,12 +1151,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Simple classes 3`] = ` +exports[`Simple classes with Array.from 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1233,7 +1165,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -1243,12 +1175,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Simple classes 4`] = ` +exports[`Simple classes with Array.from 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1257,7 +1189,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Child", + "name": "A", "status": "INLINED", }, ], @@ -1267,12 +1199,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 0, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Simple classes with Array.from 1`] = ` +exports[`Simple classes with Array.from: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1296,7 +1228,7 @@ ReactStatistics { } `; -exports[`Simple classes with Array.from 2`] = ` +exports[`Simple classes with Array.from: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1320,7 +1252,7 @@ ReactStatistics { } `; -exports[`Simple classes with Array.from 2 1`] = ` +exports[`Simple classes with Array.from: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1344,7 +1276,7 @@ ReactStatistics { } `; -exports[`Simple classes with Array.from 2 2`] = ` +exports[`Simple classes with Array.from: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1368,7 +1300,7 @@ ReactStatistics { } `; -exports[`Simple classes with Array.from 2 3`] = ` +exports[`Simple classes: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1377,7 +1309,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "A", + "name": "Child", "status": "INLINED", }, ], @@ -1387,12 +1319,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Simple classes with Array.from 2 4`] = ` +exports[`Simple classes: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1401,7 +1333,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "A", + "name": "Child", "status": "INLINED", }, ], @@ -1411,12 +1343,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Simple classes with Array.from 3`] = ` +exports[`Simple classes: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1425,7 +1357,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "A", + "name": "Child", "status": "INLINED", }, ], @@ -1435,12 +1367,12 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Simple classes with Array.from 4`] = ` +exports[`Simple classes: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1449,7 +1381,7 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "A", + "name": "Child", "status": "INLINED", }, ], @@ -1459,7 +1391,75 @@ ReactStatistics { }, ], "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; diff --git a/test/react/__snapshots__/FBMocks-test.js.snap b/test/react/__snapshots__/FBMocks-test.js.snap index 4c08cebbc5..ff519021f6 100644 --- a/test/react/__snapshots__/FBMocks-test.js.snap +++ b/test/react/__snapshots__/FBMocks-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Function bind 1`] = ` +exports[`Function bind: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -24,7 +24,7 @@ ReactStatistics { } `; -exports[`Function bind 2`] = ` +exports[`Function bind: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -48,7 +48,7 @@ ReactStatistics { } `; -exports[`Function bind 3`] = ` +exports[`Function bind: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -72,7 +72,7 @@ ReactStatistics { } `; -exports[`Function bind 4`] = ` +exports[`Function bind: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -96,7 +96,7 @@ ReactStatistics { } `; -exports[`Hacker News app 1`] = ` +exports[`Hacker News app: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -154,7 +154,7 @@ ReactStatistics { } `; -exports[`Hacker News app 2`] = ` +exports[`Hacker News app: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -212,7 +212,7 @@ ReactStatistics { } `; -exports[`Hacker News app 3`] = ` +exports[`Hacker News app: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -270,7 +270,7 @@ ReactStatistics { } `; -exports[`Hacker News app 4`] = ` +exports[`Hacker News app: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -328,55 +328,7 @@ ReactStatistics { } `; -exports[`fb-www 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`fb-www 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`fb-www 2 1`] = ` +exports[`fb-www 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -393,7 +345,7 @@ ReactStatistics { } `; -exports[`fb-www 2 2`] = ` +exports[`fb-www 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -410,7 +362,7 @@ ReactStatistics { } `; -exports[`fb-www 2 3`] = ` +exports[`fb-www 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -427,7 +379,7 @@ ReactStatistics { } `; -exports[`fb-www 2 4`] = ` +exports[`fb-www 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -444,31 +396,7 @@ ReactStatistics { } `; -exports[`fb-www 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`fb-www 3 1`] = ` +exports[`fb-www 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -478,7 +406,7 @@ ReactStatistics { } `; -exports[`fb-www 3 2`] = ` +exports[`fb-www 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -488,7 +416,7 @@ ReactStatistics { } `; -exports[`fb-www 3 3`] = ` +exports[`fb-www 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -498,7 +426,7 @@ ReactStatistics { } `; -exports[`fb-www 3 4`] = ` +exports[`fb-www 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -508,31 +436,7 @@ ReactStatistics { } `; -exports[`fb-www 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, - "optimizedTrees": 1, -} -`; - -exports[`fb-www 4 1`] = ` +exports[`fb-www 4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -542,7 +446,7 @@ ReactStatistics { } `; -exports[`fb-www 4 2`] = ` +exports[`fb-www 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -552,7 +456,7 @@ ReactStatistics { } `; -exports[`fb-www 4 3`] = ` +exports[`fb-www 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -562,7 +466,7 @@ ReactStatistics { } `; -exports[`fb-www 4 4`] = ` +exports[`fb-www 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -572,7 +476,7 @@ ReactStatistics { } `; -exports[`fb-www 5 1`] = ` +exports[`fb-www 5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -582,7 +486,7 @@ ReactStatistics { } `; -exports[`fb-www 5 2`] = ` +exports[`fb-www 5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -592,7 +496,7 @@ ReactStatistics { } `; -exports[`fb-www 5 3`] = ` +exports[`fb-www 5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -602,7 +506,7 @@ ReactStatistics { } `; -exports[`fb-www 5 4`] = ` +exports[`fb-www 5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -612,7 +516,7 @@ ReactStatistics { } `; -exports[`fb-www 6 1`] = ` +exports[`fb-www 6: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -622,7 +526,7 @@ ReactStatistics { } `; -exports[`fb-www 6 2`] = ` +exports[`fb-www 6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -632,7 +536,7 @@ ReactStatistics { } `; -exports[`fb-www 6 3`] = ` +exports[`fb-www 6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -642,7 +546,7 @@ ReactStatistics { } `; -exports[`fb-www 6 4`] = ` +exports[`fb-www 6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -652,7 +556,7 @@ ReactStatistics { } `; -exports[`fb-www 7 1`] = ` +exports[`fb-www 7: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -669,7 +573,7 @@ ReactStatistics { } `; -exports[`fb-www 7 2`] = ` +exports[`fb-www 7: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -686,7 +590,7 @@ ReactStatistics { } `; -exports[`fb-www 7 3`] = ` +exports[`fb-www 7: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -703,7 +607,7 @@ ReactStatistics { } `; -exports[`fb-www 7 4`] = ` +exports[`fb-www 7: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -720,7 +624,7 @@ ReactStatistics { } `; -exports[`fb-www 8 1`] = ` +exports[`fb-www 8: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -744,7 +648,7 @@ ReactStatistics { } `; -exports[`fb-www 8 2`] = ` +exports[`fb-www 8: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -768,7 +672,7 @@ ReactStatistics { } `; -exports[`fb-www 8 3`] = ` +exports[`fb-www 8: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -792,7 +696,7 @@ ReactStatistics { } `; -exports[`fb-www 8 4`] = ` +exports[`fb-www 8: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -816,7 +720,7 @@ ReactStatistics { } `; -exports[`fb-www 9 1`] = ` +exports[`fb-www 9: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 9, "evaluatedRootNodes": Array [ @@ -886,7 +790,7 @@ ReactStatistics { } `; -exports[`fb-www 9 2`] = ` +exports[`fb-www 9: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 9, "evaluatedRootNodes": Array [ @@ -956,7 +860,7 @@ ReactStatistics { } `; -exports[`fb-www 9 3`] = ` +exports[`fb-www 9: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 9, "evaluatedRootNodes": Array [ @@ -1026,7 +930,7 @@ ReactStatistics { } `; -exports[`fb-www 9 4`] = ` +exports[`fb-www 9: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 9, "evaluatedRootNodes": Array [ @@ -1096,7 +1000,7 @@ ReactStatistics { } `; -exports[`fb-www 10 1`] = ` +exports[`fb-www 10: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1140,7 +1044,7 @@ ReactStatistics { } `; -exports[`fb-www 10 2`] = ` +exports[`fb-www 10: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1184,7 +1088,7 @@ ReactStatistics { } `; -exports[`fb-www 10 3`] = ` +exports[`fb-www 10: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1228,7 +1132,7 @@ ReactStatistics { } `; -exports[`fb-www 10 4`] = ` +exports[`fb-www 10: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1272,7 +1176,7 @@ ReactStatistics { } `; -exports[`fb-www 11 1`] = ` +exports[`fb-www 11: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 13, "evaluatedRootNodes": Array [ @@ -1368,7 +1272,7 @@ ReactStatistics { } `; -exports[`fb-www 11 2`] = ` +exports[`fb-www 11: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 13, "evaluatedRootNodes": Array [ @@ -1464,7 +1368,7 @@ ReactStatistics { } `; -exports[`fb-www 11 3`] = ` +exports[`fb-www 11: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 13, "evaluatedRootNodes": Array [ @@ -1560,7 +1464,7 @@ ReactStatistics { } `; -exports[`fb-www 11 4`] = ` +exports[`fb-www 11: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 13, "evaluatedRootNodes": Array [ @@ -1656,15 +1560,15 @@ ReactStatistics { } `; -exports[`fb-www 12 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 12: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 12 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 12: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 12 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 12: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 12 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 12: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 13 1`] = ` +exports[`fb-www 13: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -1674,7 +1578,7 @@ ReactStatistics { } `; -exports[`fb-www 13 2`] = ` +exports[`fb-www 13: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -1684,7 +1588,7 @@ ReactStatistics { } `; -exports[`fb-www 13 3`] = ` +exports[`fb-www 13: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -1694,7 +1598,7 @@ ReactStatistics { } `; -exports[`fb-www 13 4`] = ` +exports[`fb-www 13: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -1704,7 +1608,7 @@ ReactStatistics { } `; -exports[`fb-www 14 1`] = ` +exports[`fb-www 14: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1735,7 +1639,7 @@ ReactStatistics { } `; -exports[`fb-www 14 2`] = ` +exports[`fb-www 14: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1766,7 +1670,7 @@ ReactStatistics { } `; -exports[`fb-www 14 3`] = ` +exports[`fb-www 14: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1797,7 +1701,7 @@ ReactStatistics { } `; -exports[`fb-www 14 4`] = ` +exports[`fb-www 14: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1828,23 +1732,23 @@ ReactStatistics { } `; -exports[`fb-www 15 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; +exports[`fb-www 15: (JSX => JSX) 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; -exports[`fb-www 15 2`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; +exports[`fb-www 15: (JSX => createElement) 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; -exports[`fb-www 15 3`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; +exports[`fb-www 15: (createElement => JSX) 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; -exports[`fb-www 15 4`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; +exports[`fb-www 15: (createElement => createElement) 1`] = `"Failed to render React component \\"Outer\\" due to side-effects from mutating the binding \\"result\\""`; -exports[`fb-www 16 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; +exports[`fb-www 16: (JSX => JSX) 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; -exports[`fb-www 16 2`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; +exports[`fb-www 16: (JSX => createElement) 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; -exports[`fb-www 16 3`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; +exports[`fb-www 16: (createElement => JSX) 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; -exports[`fb-www 16 4`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; +exports[`fb-www 16: (createElement => createElement) 1`] = `"Failed to render React component root \\"ViewCount\\" due to side-effects from mutating a property "`; -exports[`fb-www 17 1`] = ` +exports[`fb-www 17: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1882,7 +1786,7 @@ ReactStatistics { } `; -exports[`fb-www 17 2`] = ` +exports[`fb-www 17: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1920,7 +1824,7 @@ ReactStatistics { } `; -exports[`fb-www 17 3`] = ` +exports[`fb-www 17: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1958,7 +1862,7 @@ ReactStatistics { } `; -exports[`fb-www 17 4`] = ` +exports[`fb-www 17: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1996,23 +1900,23 @@ ReactStatistics { } `; -exports[`fb-www 18 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 18: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 18 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 18: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 18 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 18: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 18 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 18: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 19 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 19: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 19 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 19: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 19 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 19: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 19 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`fb-www 19: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`fb-www 20 1`] = ` +exports[`fb-www 20: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2036,7 +1940,7 @@ ReactStatistics { } `; -exports[`fb-www 20 2`] = ` +exports[`fb-www 20: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2060,7 +1964,7 @@ ReactStatistics { } `; -exports[`fb-www 20 3`] = ` +exports[`fb-www 20: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2084,7 +1988,7 @@ ReactStatistics { } `; -exports[`fb-www 20 4`] = ` +exports[`fb-www 20: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2108,7 +2012,7 @@ ReactStatistics { } `; -exports[`fb-www 21 1`] = ` +exports[`fb-www 21: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2144,7 +2048,7 @@ ReactStatistics { } `; -exports[`fb-www 21 2`] = ` +exports[`fb-www 21: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2180,7 +2084,7 @@ ReactStatistics { } `; -exports[`fb-www 21 3`] = ` +exports[`fb-www 21: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2216,7 +2120,7 @@ ReactStatistics { } `; -exports[`fb-www 21 4`] = ` +exports[`fb-www 21: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2252,7 +2156,7 @@ ReactStatistics { } `; -exports[`fb-www 22 1`] = ` +exports[`fb-www 22: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2276,7 +2180,7 @@ ReactStatistics { } `; -exports[`fb-www 22 2`] = ` +exports[`fb-www 22: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2300,7 +2204,7 @@ ReactStatistics { } `; -exports[`fb-www 22 3`] = ` +exports[`fb-www 22: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2324,7 +2228,7 @@ ReactStatistics { } `; -exports[`fb-www 22 4`] = ` +exports[`fb-www 22: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2348,7 +2252,7 @@ ReactStatistics { } `; -exports[`fb-www 23 1`] = ` +exports[`fb-www 23: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2384,7 +2288,7 @@ ReactStatistics { } `; -exports[`fb-www 23 2`] = ` +exports[`fb-www 23: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2420,7 +2324,7 @@ ReactStatistics { } `; -exports[`fb-www 23 3`] = ` +exports[`fb-www 23: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2456,7 +2360,7 @@ ReactStatistics { } `; -exports[`fb-www 23 4`] = ` +exports[`fb-www 23: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -2492,7 +2396,103 @@ ReactStatistics { } `; -exports[`repl example 1`] = ` +exports[`fb-www: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`fb-www: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`repl example: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -2549,7 +2549,7 @@ ReactStatistics { } `; -exports[`repl example 2`] = ` +exports[`repl example: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -2606,7 +2606,7 @@ ReactStatistics { } `; -exports[`repl example 3`] = ` +exports[`repl example: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -2663,7 +2663,7 @@ ReactStatistics { } `; -exports[`repl example 4`] = ` +exports[`repl example: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/FactoryComponents-test.js.snap b/test/react/__snapshots__/FactoryComponents-test.js.snap index 7df3d19bd8..a9a293c2fd 100644 --- a/test/react/__snapshots__/FactoryComponents-test.js.snap +++ b/test/react/__snapshots__/FactoryComponents-test.js.snap @@ -1,40 +1,54 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Simple factory classes 1`] = ` +exports[`Simple factory classes 2: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], "message": "", - "name": "FactoryComponent", + "name": "App", "status": "ROOT", }, ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Simple factory classes 2`] = ` +exports[`Simple factory classes 2: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "non-root factory class components are not suppoted", + "name": "FactoryComponent", + "status": "BAIL-OUT", + }, + ], "message": "", - "name": "FactoryComponent", + "name": "App", "status": "ROOT", }, ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Simple factory classes 2 1`] = ` +exports[`Simple factory classes 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -58,7 +72,7 @@ ReactStatistics { } `; -exports[`Simple factory classes 2 2`] = ` +exports[`Simple factory classes 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -82,55 +96,41 @@ ReactStatistics { } `; -exports[`Simple factory classes 2 3`] = ` +exports[`Simple factory classes: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], + "children": Array [], "message": "", - "name": "App", + "name": "FactoryComponent", "status": "ROOT", }, ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Simple factory classes 2 4`] = ` +exports[`Simple factory classes: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "non-root factory class components are not suppoted", - "name": "FactoryComponent", - "status": "BAIL-OUT", - }, - ], + "children": Array [], "message": "", - "name": "App", + "name": "FactoryComponent", "status": "ROOT", }, ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Simple factory classes 3`] = ` +exports[`Simple factory classes: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -147,7 +147,7 @@ ReactStatistics { } `; -exports[`Simple factory classes 4`] = ` +exports[`Simple factory classes: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/FirstRenderOnly-test.js.snap b/test/react/__snapshots__/FirstRenderOnly-test.js.snap index 257ba8a4e1..bb1bba9e29 100644 --- a/test/react/__snapshots__/FirstRenderOnly-test.js.snap +++ b/test/react/__snapshots__/FirstRenderOnly-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`React Context 1`] = ` +exports[`React Context 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -38,7 +38,7 @@ ReactStatistics { } `; -exports[`React Context 2`] = ` +exports[`React Context 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -76,7 +76,7 @@ ReactStatistics { } `; -exports[`React Context 2 1`] = ` +exports[`React Context 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -114,7 +114,7 @@ ReactStatistics { } `; -exports[`React Context 2 2`] = ` +exports[`React Context 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -152,121 +152,7 @@ ReactStatistics { } `; -exports[`React Context 2 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 2 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 3 1`] = ` +exports[`React Context 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -297,7 +183,7 @@ ReactStatistics { } `; -exports[`React Context 3 2`] = ` +exports[`React Context 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -328,7 +214,7 @@ ReactStatistics { } `; -exports[`React Context 3 3`] = ` +exports[`React Context 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -359,7 +245,7 @@ ReactStatistics { } `; -exports[`React Context 3 4`] = ` +exports[`React Context 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -390,14 +276,34 @@ ReactStatistics { } `; -exports[`React Context 4`] = ` +exports[`React Context 4: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 7, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, Object { "children": Array [ Object { @@ -422,13 +328,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 3, + "inlinedComponents": 6, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context 4 1`] = ` +exports[`React Context 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -486,7 +392,7 @@ ReactStatistics { } `; -exports[`React Context 4 2`] = ` +exports[`React Context 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -544,7 +450,7 @@ ReactStatistics { } `; -exports[`React Context 4 3`] = ` +exports[`React Context 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -602,34 +508,14 @@ ReactStatistics { } `; -exports[`React Context 4 4`] = ` +exports[`React Context 5: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 7, + "componentsEvaluated": 5, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, Object { "children": Array [ Object { @@ -648,19 +534,32 @@ ReactStatistics { "name": "Context.Provider", "status": "INLINED", }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, + "inlinedComponents": 4, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`React Context 5 1`] = ` +exports[`React Context 5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -711,7 +610,7 @@ ReactStatistics { } `; -exports[`React Context 5 2`] = ` +exports[`React Context 5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -762,7 +661,7 @@ ReactStatistics { } `; -exports[`React Context 5 3`] = ` +exports[`React Context 5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -813,9 +712,9 @@ ReactStatistics { } `; -exports[`React Context 5 4`] = ` +exports[`React Context 6: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 7, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -829,6 +728,12 @@ ReactStatistics { "name": "Context.Consumer", "status": "INLINED", }, + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, ], "message": "", "name": "Child", @@ -842,7 +747,14 @@ ReactStatistics { Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Child2", + "status": "INLINED", + }, + ], "message": "", "name": "Context.Consumer", "status": "RENDER_PROPS", @@ -858,13 +770,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 4, + "inlinedComponents": 6, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`React Context 6 1`] = ` +exports[`React Context 6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -928,7 +840,7 @@ ReactStatistics { } `; -exports[`React Context 6 2`] = ` +exports[`React Context 6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -992,7 +904,7 @@ ReactStatistics { } `; -exports[`React Context 6 3`] = ` +exports[`React Context 6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1056,9 +968,47 @@ ReactStatistics { } `; -exports[`React Context 6 4`] = ` +exports[`React Context: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 7, + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1072,10 +1022,42 @@ ReactStatistics { "name": "Context.Consumer", "status": "INLINED", }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], + "message": "", + "name": "Context.Provider", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ Object { "children": Array [], "message": "", - "name": "Child2", + "name": "Context.Consumer", "status": "INLINED", }, ], @@ -1088,6 +1070,24 @@ ReactStatistics { "name": "Context.Provider", "status": "INLINED", }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`React Context: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ Object { "children": Array [ Object { @@ -1095,17 +1095,17 @@ ReactStatistics { Object { "children": Array [], "message": "", - "name": "Child2", + "name": "Context.Consumer", "status": "INLINED", }, ], "message": "", - "name": "Context.Consumer", - "status": "RENDER_PROPS", + "name": "Child", + "status": "INLINED", }, ], "message": "", - "name": "Child", + "name": "Context.Provider", "status": "INLINED", }, ], @@ -1114,13 +1114,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 6, - "optimizedNestedClosures": 1, + "inlinedComponents": 3, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Replace this in callbacks 2 1`] = ` +exports[`Replace this in callbacks 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1144,7 +1144,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 2 2`] = ` +exports[`Replace this in callbacks 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1168,7 +1168,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 2 3`] = ` +exports[`Replace this in callbacks 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1192,7 +1192,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 2 4`] = ` +exports[`Replace this in callbacks 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1216,7 +1216,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 3 1`] = ` +exports[`Replace this in callbacks 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1240,7 +1240,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 3 2`] = ` +exports[`Replace this in callbacks 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1264,7 +1264,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 3 3`] = ` +exports[`Replace this in callbacks 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1288,7 +1288,7 @@ ReactStatistics { } `; -exports[`Replace this in callbacks 3 4`] = ` +exports[`Replace this in callbacks 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1312,7 +1312,7 @@ ReactStatistics { } `; -exports[`Simple #2 1`] = ` +exports[`Simple #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1336,7 +1336,7 @@ ReactStatistics { } `; -exports[`Simple #2 2`] = ` +exports[`Simple #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1360,7 +1360,7 @@ ReactStatistics { } `; -exports[`Simple #2 3`] = ` +exports[`Simple #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1384,7 +1384,7 @@ ReactStatistics { } `; -exports[`Simple #2 4`] = ` +exports[`Simple #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1408,7 +1408,7 @@ ReactStatistics { } `; -exports[`Simple #3 1`] = ` +exports[`Simple #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1425,7 +1425,7 @@ ReactStatistics { } `; -exports[`Simple #3 2`] = ` +exports[`Simple #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1442,7 +1442,7 @@ ReactStatistics { } `; -exports[`Simple #3 3`] = ` +exports[`Simple #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1459,7 +1459,7 @@ ReactStatistics { } `; -exports[`Simple #3 4`] = ` +exports[`Simple #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1476,7 +1476,7 @@ ReactStatistics { } `; -exports[`Simple #4 1`] = ` +exports[`Simple #4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1493,7 +1493,7 @@ ReactStatistics { } `; -exports[`Simple #4 2`] = ` +exports[`Simple #4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1510,7 +1510,7 @@ ReactStatistics { } `; -exports[`Simple #4 3`] = ` +exports[`Simple #4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1527,7 +1527,7 @@ ReactStatistics { } `; -exports[`Simple #4 4`] = ` +exports[`Simple #4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -1544,7 +1544,7 @@ ReactStatistics { } `; -exports[`Simple 1`] = ` +exports[`Simple: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1589,7 +1589,7 @@ ReactStatistics { } `; -exports[`Simple 2`] = ` +exports[`Simple: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1634,7 +1634,7 @@ ReactStatistics { } `; -exports[`Simple 3`] = ` +exports[`Simple: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1679,7 +1679,7 @@ ReactStatistics { } `; -exports[`Simple 4`] = ` +exports[`Simple: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1724,7 +1724,7 @@ ReactStatistics { } `; -exports[`componentWillMount 1`] = ` +exports[`componentWillMount: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1769,7 +1769,7 @@ ReactStatistics { } `; -exports[`componentWillMount 2`] = ` +exports[`componentWillMount: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1814,7 +1814,7 @@ ReactStatistics { } `; -exports[`componentWillMount 3`] = ` +exports[`componentWillMount: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1859,7 +1859,7 @@ ReactStatistics { } `; -exports[`componentWillMount 4`] = ` +exports[`componentWillMount: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1904,7 +1904,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 1`] = ` +exports[`getDerivedStateFromProps 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1949,7 +1949,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 2`] = ` +exports[`getDerivedStateFromProps 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1994,7 +1994,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 2 1`] = ` +exports[`getDerivedStateFromProps 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2039,7 +2039,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 2 2`] = ` +exports[`getDerivedStateFromProps 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2084,7 +2084,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 2 3`] = ` +exports[`getDerivedStateFromProps 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2129,7 +2129,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 2 4`] = ` +exports[`getDerivedStateFromProps 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2174,7 +2174,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 3`] = ` +exports[`getDerivedStateFromProps 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2219,7 +2219,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 3 1`] = ` +exports[`getDerivedStateFromProps 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2264,7 +2264,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 3 2`] = ` +exports[`getDerivedStateFromProps 4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2309,7 +2309,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 3 3`] = ` +exports[`getDerivedStateFromProps 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2354,7 +2354,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 3 4`] = ` +exports[`getDerivedStateFromProps 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2399,7 +2399,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 4`] = ` +exports[`getDerivedStateFromProps 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2444,7 +2444,75 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 4 1`] = ` +exports[`getDerivedStateFromProps 5: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps 5: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "MyComponent", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`getDerivedStateFromProps: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2489,7 +2557,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 4 2`] = ` +exports[`getDerivedStateFromProps: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2534,7 +2602,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 4 3`] = ` +exports[`getDerivedStateFromProps: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2579,7 +2647,7 @@ ReactStatistics { } `; -exports[`getDerivedStateFromProps 4 4`] = ` +exports[`getDerivedStateFromProps: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2623,71 +2691,3 @@ ReactStatistics { "optimizedTrees": 1, } `; - -exports[`getDerivedStateFromProps 5 1`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`getDerivedStateFromProps 5 2`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`getDerivedStateFromProps 5 3`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`getDerivedStateFromProps 5 4`] = ` -ReactStatistics { - "componentsEvaluated": 1, - "evaluatedRootNodes": Array [ - Object { - "children": Array [], - "message": "", - "name": "MyComponent", - "status": "ROOT", - }, - ], - "inlinedComponents": 0, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; diff --git a/test/react/__snapshots__/FunctionalComponents-test.js.snap b/test/react/__snapshots__/FunctionalComponents-test.js.snap index 2faf90fbb8..7601f2fd26 100644 --- a/test/react/__snapshots__/FunctionalComponents-test.js.snap +++ b/test/react/__snapshots__/FunctionalComponents-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`__reactCompilerDoNotOptimize 1`] = ` +exports[`__reactCompilerDoNotOptimize: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -17,7 +17,7 @@ ReactStatistics { } `; -exports[`__reactCompilerDoNotOptimize 2`] = ` +exports[`__reactCompilerDoNotOptimize: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -34,7 +34,7 @@ ReactStatistics { } `; -exports[`__reactCompilerDoNotOptimize 3`] = ` +exports[`__reactCompilerDoNotOptimize: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -51,7 +51,7 @@ ReactStatistics { } `; -exports[`__reactCompilerDoNotOptimize 4`] = ` +exports[`__reactCompilerDoNotOptimize: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -68,7 +68,7 @@ ReactStatistics { } `; -exports[`16.3 refs 1`] = ` +exports[`16.3 refs 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -99,7 +99,7 @@ ReactStatistics { } `; -exports[`16.3 refs 2`] = ` +exports[`16.3 refs 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -130,7 +130,7 @@ ReactStatistics { } `; -exports[`16.3 refs 2 1`] = ` +exports[`16.3 refs 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -161,7 +161,7 @@ ReactStatistics { } `; -exports[`16.3 refs 2 2`] = ` +exports[`16.3 refs 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -192,16 +192,23 @@ ReactStatistics { } `; -exports[`16.3 refs 2 3`] = ` +exports[`16.3 refs 3: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], "message": "", "name": "Child", "status": "INLINED", @@ -219,20 +226,27 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`16.3 refs 2 4`] = ` +exports[`16.3 refs 3: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], "message": "", "name": "Child", "status": "INLINED", @@ -250,20 +264,27 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`16.3 refs 3`] = ` +exports[`16.3 refs 3: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "ClassComponent", + "status": "NEW_TREE", + }, + ], "message": "", "name": "Child", "status": "INLINED", @@ -281,11 +302,11 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`16.3 refs 3 1`] = ` +exports[`16.3 refs 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -323,23 +344,16 @@ ReactStatistics { } `; -exports[`16.3 refs 3 2`] = ` +exports[`16.3 refs: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "Child", "status": "INLINED", @@ -357,27 +371,20 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`16.3 refs 3 3`] = ` +exports[`16.3 refs: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "Child", "status": "INLINED", @@ -395,27 +402,20 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`16.3 refs 3 4`] = ` +exports[`16.3 refs: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "ClassComponent", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", "name": "Child", "status": "INLINED", @@ -433,11 +433,11 @@ ReactStatistics { ], "inlinedComponents": 1, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`16.3 refs 4`] = ` +exports[`16.3 refs: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -468,7 +468,7 @@ ReactStatistics { } `; -exports[`Additional functions closure scope capturing 1`] = ` +exports[`Additional functions closure scope capturing: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -485,7 +485,7 @@ ReactStatistics { } `; -exports[`Additional functions closure scope capturing 2`] = ` +exports[`Additional functions closure scope capturing: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -502,7 +502,7 @@ ReactStatistics { } `; -exports[`Additional functions closure scope capturing 3`] = ` +exports[`Additional functions closure scope capturing: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -519,7 +519,7 @@ ReactStatistics { } `; -exports[`Additional functions closure scope capturing 4`] = ` +exports[`Additional functions closure scope capturing: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -536,7 +536,7 @@ ReactStatistics { } `; -exports[`Circular reference 1`] = ` +exports[`Circular reference: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -553,7 +553,7 @@ ReactStatistics { } `; -exports[`Circular reference 2`] = ` +exports[`Circular reference: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -570,7 +570,7 @@ ReactStatistics { } `; -exports[`Circular reference 3`] = ` +exports[`Circular reference: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -587,7 +587,7 @@ ReactStatistics { } `; -exports[`Circular reference 4`] = ` +exports[`Circular reference: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -604,7 +604,7 @@ ReactStatistics { } `; -exports[`Class component as root 1`] = ` +exports[`Class component as root with instance variables #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -635,7 +635,7 @@ ReactStatistics { } `; -exports[`Class component as root 2`] = ` +exports[`Class component as root with instance variables #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -666,7 +666,7 @@ ReactStatistics { } `; -exports[`Class component as root 3`] = ` +exports[`Class component as root with instance variables #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -697,7 +697,7 @@ ReactStatistics { } `; -exports[`Class component as root 4`] = ` +exports[`Class component as root with instance variables #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -728,7 +728,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables #2 1`] = ` +exports[`Class component as root with instance variables: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -759,7 +759,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables #2 2`] = ` +exports[`Class component as root with instance variables: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -790,7 +790,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables #2 3`] = ` +exports[`Class component as root with instance variables: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -821,7 +821,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables #2 4`] = ` +exports[`Class component as root with instance variables: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -852,7 +852,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables 1`] = ` +exports[`Class component as root with multiple render methods: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -883,7 +883,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables 2`] = ` +exports[`Class component as root with multiple render methods: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -914,7 +914,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables 3`] = ` +exports[`Class component as root with multiple render methods: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -945,7 +945,7 @@ ReactStatistics { } `; -exports[`Class component as root with instance variables 4`] = ` +exports[`Class component as root with multiple render methods: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -976,7 +976,7 @@ ReactStatistics { } `; -exports[`Class component as root with multiple render methods 1`] = ` +exports[`Class component as root with props: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1007,7 +1007,7 @@ ReactStatistics { } `; -exports[`Class component as root with multiple render methods 2`] = ` +exports[`Class component as root with props: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1038,7 +1038,7 @@ ReactStatistics { } `; -exports[`Class component as root with multiple render methods 3`] = ` +exports[`Class component as root with props: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1069,7 +1069,7 @@ ReactStatistics { } `; -exports[`Class component as root with multiple render methods 4`] = ` +exports[`Class component as root with props: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1100,7 +1100,7 @@ ReactStatistics { } `; -exports[`Class component as root with props 1`] = ` +exports[`Class component as root with refs: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1131,7 +1131,7 @@ ReactStatistics { } `; -exports[`Class component as root with props 2`] = ` +exports[`Class component as root with refs: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1162,7 +1162,7 @@ ReactStatistics { } `; -exports[`Class component as root with props 3`] = ` +exports[`Class component as root with refs: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1193,7 +1193,7 @@ ReactStatistics { } `; -exports[`Class component as root with props 4`] = ` +exports[`Class component as root with refs: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1224,7 +1224,7 @@ ReactStatistics { } `; -exports[`Class component as root with refs 1`] = ` +exports[`Class component as root with state: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1255,7 +1255,7 @@ ReactStatistics { } `; -exports[`Class component as root with refs 2`] = ` +exports[`Class component as root with state: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1286,7 +1286,7 @@ ReactStatistics { } `; -exports[`Class component as root with refs 3`] = ` +exports[`Class component as root with state: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1317,7 +1317,7 @@ ReactStatistics { } `; -exports[`Class component as root with refs 4`] = ` +exports[`Class component as root with state: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1348,7 +1348,7 @@ ReactStatistics { } `; -exports[`Class component as root with state 1`] = ` +exports[`Class component as root: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1379,7 +1379,7 @@ ReactStatistics { } `; -exports[`Class component as root with state 2`] = ` +exports[`Class component as root: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1410,7 +1410,7 @@ ReactStatistics { } `; -exports[`Class component as root with state 3`] = ` +exports[`Class component as root: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1441,7 +1441,7 @@ ReactStatistics { } `; -exports[`Class component as root with state 4`] = ` +exports[`Class component as root: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1472,7 +1472,7 @@ ReactStatistics { } `; -exports[`Conditional 1`] = ` +exports[`Conditional: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1496,7 +1496,7 @@ ReactStatistics { } `; -exports[`Conditional 2`] = ` +exports[`Conditional: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1520,7 +1520,7 @@ ReactStatistics { } `; -exports[`Conditional 3`] = ` +exports[`Conditional: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1544,7 +1544,7 @@ ReactStatistics { } `; -exports[`Conditional 4`] = ` +exports[`Conditional: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -1568,7 +1568,7 @@ ReactStatistics { } `; -exports[`Delete element prop key 1`] = ` +exports[`Delete element prop key: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1604,7 +1604,7 @@ ReactStatistics { } `; -exports[`Delete element prop key 2`] = ` +exports[`Delete element prop key: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1640,7 +1640,7 @@ ReactStatistics { } `; -exports[`Delete element prop key 3`] = ` +exports[`Delete element prop key: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1676,7 +1676,7 @@ ReactStatistics { } `; -exports[`Delete element prop key 4`] = ` +exports[`Delete element prop key: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1712,7 +1712,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #2 1`] = ` +exports[`Dynamic ReactElement type #2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1748,7 +1748,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #2 2`] = ` +exports[`Dynamic ReactElement type #2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1784,7 +1784,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #2 3`] = ` +exports[`Dynamic ReactElement type #2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1820,7 +1820,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #2 4`] = ` +exports[`Dynamic ReactElement type #2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1856,7 +1856,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #3 1`] = ` +exports[`Dynamic ReactElement type #3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1886,7 +1886,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #3 2`] = ` +exports[`Dynamic ReactElement type #3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1916,7 +1916,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #3 3`] = ` +exports[`Dynamic ReactElement type #3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1946,7 +1946,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #3 4`] = ` +exports[`Dynamic ReactElement type #3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1976,7 +1976,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #4 1`] = ` +exports[`Dynamic ReactElement type #4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2000,7 +2000,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #4 2`] = ` +exports[`Dynamic ReactElement type #4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2024,7 +2024,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #4 3`] = ` +exports[`Dynamic ReactElement type #4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2048,7 +2048,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type #4 4`] = ` +exports[`Dynamic ReactElement type #4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2072,7 +2072,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type 1`] = ` +exports[`Dynamic ReactElement type: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2102,7 +2102,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type 2`] = ` +exports[`Dynamic ReactElement type: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2132,7 +2132,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type 3`] = ` +exports[`Dynamic ReactElement type: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2162,7 +2162,7 @@ ReactStatistics { } `; -exports[`Dynamic ReactElement type 4`] = ` +exports[`Dynamic ReactElement type: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2192,7 +2192,7 @@ ReactStatistics { } `; -exports[`Dynamic context 1`] = ` +exports[`Dynamic context: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2216,7 +2216,7 @@ ReactStatistics { } `; -exports[`Dynamic context 2`] = ` +exports[`Dynamic context: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2240,7 +2240,7 @@ ReactStatistics { } `; -exports[`Dynamic context 3`] = ` +exports[`Dynamic context: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2264,7 +2264,7 @@ ReactStatistics { } `; -exports[`Dynamic context 4`] = ` +exports[`Dynamic context: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2288,7 +2288,7 @@ ReactStatistics { } `; -exports[`Dynamic props 1`] = ` +exports[`Dynamic props: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2312,7 +2312,7 @@ ReactStatistics { } `; -exports[`Dynamic props 2`] = ` +exports[`Dynamic props: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2336,7 +2336,7 @@ ReactStatistics { } `; -exports[`Dynamic props 3`] = ` +exports[`Dynamic props: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2360,7 +2360,7 @@ ReactStatistics { } `; -exports[`Dynamic props 4`] = ` +exports[`Dynamic props: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2384,7 +2384,7 @@ ReactStatistics { } `; -exports[`Equivalence 1`] = ` +exports[`Equivalence: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2401,7 +2401,7 @@ ReactStatistics { } `; -exports[`Equivalence 2`] = ` +exports[`Equivalence: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2418,7 +2418,7 @@ ReactStatistics { } `; -exports[`Equivalence 3`] = ` +exports[`Equivalence: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2435,7 +2435,7 @@ ReactStatistics { } `; -exports[`Equivalence 4`] = ` +exports[`Equivalence: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2452,7 +2452,7 @@ ReactStatistics { } `; -exports[`Event handlers 1`] = ` +exports[`Event handlers: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2469,7 +2469,7 @@ ReactStatistics { } `; -exports[`Event handlers 2`] = ` +exports[`Event handlers: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2486,7 +2486,7 @@ ReactStatistics { } `; -exports[`Event handlers 3`] = ` +exports[`Event handlers: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2503,7 +2503,7 @@ ReactStatistics { } `; -exports[`Event handlers 4`] = ` +exports[`Event handlers: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2520,7 +2520,7 @@ ReactStatistics { } `; -exports[`Handle mapped arrays 1`] = ` +exports[`Handle mapped arrays 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2544,7 +2544,7 @@ ReactStatistics { } `; -exports[`Handle mapped arrays 2`] = ` +exports[`Handle mapped arrays 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2568,7 +2568,7 @@ ReactStatistics { } `; -exports[`Handle mapped arrays 2 1`] = ` +exports[`Handle mapped arrays 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2592,7 +2592,7 @@ ReactStatistics { } `; -exports[`Handle mapped arrays 2 2`] = ` +exports[`Handle mapped arrays 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2616,171 +2616,171 @@ ReactStatistics { } `; -exports[`Handle mapped arrays 2 3`] = ` +exports[`Handle mapped arrays from Array.from: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays 2 4`] = ` +exports[`Handle mapped arrays from Array.from: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays 3`] = ` +exports[`Handle mapped arrays from Array.from: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays 4`] = ` +exports[`Handle mapped arrays from Array.from: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 2, + "componentsEvaluated": 1, "evaluatedRootNodes": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 1, + "inlinedComponents": 0, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays from Array.from 1`] = ` +exports[`Handle mapped arrays: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 1, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays from Array.from 2`] = ` +exports[`Handle mapped arrays: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 1, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays from Array.from 3`] = ` +exports[`Handle mapped arrays: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 1, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Handle mapped arrays from Array.from 4`] = ` +exports[`Handle mapped arrays: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 2, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 1, "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`Havocing of ReactElements should not result in property assignments 1`] = ` +exports[`Havocing of ReactElements should not result in property assignments: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2797,7 +2797,7 @@ ReactStatistics { } `; -exports[`Havocing of ReactElements should not result in property assignments 2`] = ` +exports[`Havocing of ReactElements should not result in property assignments: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2814,7 +2814,7 @@ ReactStatistics { } `; -exports[`Havocing of ReactElements should not result in property assignments 3`] = ` +exports[`Havocing of ReactElements should not result in property assignments: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2831,7 +2831,7 @@ ReactStatistics { } `; -exports[`Havocing of ReactElements should not result in property assignments 4`] = ` +exports[`Havocing of ReactElements should not result in property assignments: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2848,15 +2848,15 @@ ReactStatistics { } `; -exports[`Mutations - not-safe 1 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; +exports[`Mutations - not-safe 1: (JSX => JSX) 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; -exports[`Mutations - not-safe 1 2`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; +exports[`Mutations - not-safe 1: (JSX => createElement) 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; -exports[`Mutations - not-safe 1 3`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; +exports[`Mutations - not-safe 1: (createElement => JSX) 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; -exports[`Mutations - not-safe 1 4`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; +exports[`Mutations - not-safe 1: (createElement => createElement) 1`] = `"Failed to render React component root \\"Bar\\" due to side-effects from mutating the binding \\"x\\""`; -exports[`Mutations - not-safe 2 1`] = ` +exports[`Mutations - not-safe 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2873,7 +2873,7 @@ ReactStatistics { } `; -exports[`Mutations - not-safe 2 2`] = ` +exports[`Mutations - not-safe 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2890,7 +2890,7 @@ ReactStatistics { } `; -exports[`Mutations - not-safe 2 3`] = ` +exports[`Mutations - not-safe 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2907,7 +2907,7 @@ ReactStatistics { } `; -exports[`Mutations - not-safe 2 4`] = ` +exports[`Mutations - not-safe 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2924,15 +2924,15 @@ ReactStatistics { } `; -exports[`Mutations - not-safe 3 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; +exports[`Mutations - not-safe 3: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; -exports[`Mutations - not-safe 3 2`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; +exports[`Mutations - not-safe 3: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; -exports[`Mutations - not-safe 3 3`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; +exports[`Mutations - not-safe 3: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; -exports[`Mutations - not-safe 3 4`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; +exports[`Mutations - not-safe 3: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from mutating a property \\"x\\""`; -exports[`Mutations - safe 1 1`] = ` +exports[`Mutations - safe 1: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2949,7 +2949,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 1 2`] = ` +exports[`Mutations - safe 1: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2966,7 +2966,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 1 3`] = ` +exports[`Mutations - safe 1: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2983,7 +2983,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 1 4`] = ` +exports[`Mutations - safe 1: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3000,7 +3000,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 2 1`] = ` +exports[`Mutations - safe 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3017,7 +3017,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 2 2`] = ` +exports[`Mutations - safe 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3034,7 +3034,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 2 3`] = ` +exports[`Mutations - safe 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3051,7 +3051,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 2 4`] = ` +exports[`Mutations - safe 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3068,7 +3068,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 3 1`] = ` +exports[`Mutations - safe 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3085,7 +3085,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 3 2`] = ` +exports[`Mutations - safe 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3102,7 +3102,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 3 3`] = ` +exports[`Mutations - safe 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3119,7 +3119,7 @@ ReactStatistics { } `; -exports[`Mutations - safe 3 4`] = ` +exports[`Mutations - safe 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3136,7 +3136,7 @@ ReactStatistics { } `; -exports[`Null or undefined props 1`] = ` +exports[`Null or undefined props: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3153,7 +3153,7 @@ ReactStatistics { } `; -exports[`Null or undefined props 2`] = ` +exports[`Null or undefined props: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3170,7 +3170,7 @@ ReactStatistics { } `; -exports[`Null or undefined props 3`] = ` +exports[`Null or undefined props: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3187,7 +3187,7 @@ ReactStatistics { } `; -exports[`Null or undefined props 4`] = ` +exports[`Null or undefined props: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -3204,7 +3204,7 @@ ReactStatistics { } `; -exports[`React.cloneElement 1`] = ` +exports[`React.cloneElement: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3235,7 +3235,7 @@ ReactStatistics { } `; -exports[`React.cloneElement 2`] = ` +exports[`React.cloneElement: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3266,7 +3266,7 @@ ReactStatistics { } `; -exports[`React.cloneElement 3`] = ` +exports[`React.cloneElement: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3297,7 +3297,7 @@ ReactStatistics { } `; -exports[`React.cloneElement 4`] = ` +exports[`React.cloneElement: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3328,7 +3328,7 @@ ReactStatistics { } `; -exports[`Render array twice 1`] = ` +exports[`Render array twice: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3352,7 +3352,7 @@ ReactStatistics { } `; -exports[`Render array twice 2`] = ` +exports[`Render array twice: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3376,7 +3376,7 @@ ReactStatistics { } `; -exports[`Render array twice 3`] = ` +exports[`Render array twice: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3400,7 +3400,7 @@ ReactStatistics { } `; -exports[`Render array twice 4`] = ` +exports[`Render array twice: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3424,7 +3424,7 @@ ReactStatistics { } `; -exports[`Render nested array children 1`] = ` +exports[`Render nested array children: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3448,7 +3448,7 @@ ReactStatistics { } `; -exports[`Render nested array children 2`] = ` +exports[`Render nested array children: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3472,7 +3472,7 @@ ReactStatistics { } `; -exports[`Render nested array children 3`] = ` +exports[`Render nested array children: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3496,7 +3496,7 @@ ReactStatistics { } `; -exports[`Render nested array children 4`] = ` +exports[`Render nested array children: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3520,7 +3520,7 @@ ReactStatistics { } `; -exports[`Return text 1`] = ` +exports[`Return text: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3550,7 +3550,7 @@ ReactStatistics { } `; -exports[`Return text 2`] = ` +exports[`Return text: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3580,7 +3580,7 @@ ReactStatistics { } `; -exports[`Return text 3`] = ` +exports[`Return text: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3610,7 +3610,7 @@ ReactStatistics { } `; -exports[`Return text 4`] = ` +exports[`Return text: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -3640,7 +3640,7 @@ ReactStatistics { } `; -exports[`Return undefined 1`] = ` +exports[`Return undefined: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3670,7 +3670,7 @@ ReactStatistics { } `; -exports[`Return undefined 2`] = ` +exports[`Return undefined: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3700,7 +3700,7 @@ ReactStatistics { } `; -exports[`Return undefined 3`] = ` +exports[`Return undefined: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3730,7 +3730,7 @@ ReactStatistics { } `; -exports[`Return undefined 4`] = ` +exports[`Return undefined: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3760,87 +3760,15 @@ ReactStatistics { } `; -exports[`Runtime error 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Runtime error: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Runtime error 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Runtime error: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Runtime error 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Runtime error: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Runtime error 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; - -exports[`Simple 1`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 2`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; +exports[`Runtime error: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 2 1`] = ` +exports[`Simple 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3864,7 +3792,7 @@ ReactStatistics { } `; -exports[`Simple 2 2`] = ` +exports[`Simple 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3888,7 +3816,7 @@ ReactStatistics { } `; -exports[`Simple 2 3`] = ` +exports[`Simple 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3912,7 +3840,7 @@ ReactStatistics { } `; -exports[`Simple 2 4`] = ` +exports[`Simple 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3936,43 +3864,7 @@ ReactStatistics { } `; -exports[`Simple 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 3 1`] = ` +exports[`Simple 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -3996,7 +3888,7 @@ ReactStatistics { } `; -exports[`Simple 3 2`] = ` +exports[`Simple 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4020,7 +3912,7 @@ ReactStatistics { } `; -exports[`Simple 3 3`] = ` +exports[`Simple 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4044,7 +3936,7 @@ ReactStatistics { } `; -exports[`Simple 3 4`] = ` +exports[`Simple 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4068,43 +3960,7 @@ ReactStatistics { } `; -exports[`Simple 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "A", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "B", - "status": "INLINED", - }, - Object { - "children": Array [], - "message": "", - "name": "C", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`Simple 4 1`] = ` +exports[`Simple 4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4128,7 +3984,7 @@ ReactStatistics { } `; -exports[`Simple 4 2`] = ` +exports[`Simple 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4152,7 +4008,7 @@ ReactStatistics { } `; -exports[`Simple 4 3`] = ` +exports[`Simple 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4176,7 +4032,7 @@ ReactStatistics { } `; -exports[`Simple 4 4`] = ` +exports[`Simple 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4200,7 +4056,7 @@ ReactStatistics { } `; -exports[`Simple 5 1`] = ` +exports[`Simple 5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -4230,7 +4086,7 @@ ReactStatistics { } `; -exports[`Simple 5 2`] = ` +exports[`Simple 5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -4260,7 +4116,7 @@ ReactStatistics { } `; -exports[`Simple 5 3`] = ` +exports[`Simple 5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -4290,7 +4146,7 @@ ReactStatistics { } `; -exports[`Simple 5 4`] = ` +exports[`Simple 5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -4320,7 +4176,7 @@ ReactStatistics { } `; -exports[`Simple 6 1`] = ` +exports[`Simple 6: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4337,7 +4193,7 @@ ReactStatistics { } `; -exports[`Simple 6 2`] = ` +exports[`Simple 6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4354,7 +4210,7 @@ ReactStatistics { } `; -exports[`Simple 6 3`] = ` +exports[`Simple 6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4371,7 +4227,7 @@ ReactStatistics { } `; -exports[`Simple 6 4`] = ` +exports[`Simple 6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4388,7 +4244,7 @@ ReactStatistics { } `; -exports[`Simple 7 1`] = ` +exports[`Simple 7: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4405,7 +4261,7 @@ ReactStatistics { } `; -exports[`Simple 7 2`] = ` +exports[`Simple 7: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4422,7 +4278,7 @@ ReactStatistics { } `; -exports[`Simple 7 3`] = ` +exports[`Simple 7: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4439,7 +4295,7 @@ ReactStatistics { } `; -exports[`Simple 7 4`] = ` +exports[`Simple 7: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4456,39 +4312,39 @@ ReactStatistics { } `; -exports[`Simple 8 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 8: (JSX => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 8 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 8: (JSX => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 8 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 8: (createElement => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 8 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 8: (createElement => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 9 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 9: (JSX => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 9 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 9: (JSX => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 9 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 9: (createElement => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 9 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 9: (createElement => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 10 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 10: (JSX => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 10 2`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 10: (JSX => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 10 3`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 10: (createElement => JSX) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 10 4`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; +exports[`Simple 10: (createElement => createElement) 1`] = `"Failed to render React component \\"App\\" due to side-effects from mutating the binding \\"lazyVariable\\""`; -exports[`Simple 11 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 11: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 11 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 11: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 11 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 11: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 11 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 11: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 12 1`] = ` +exports[`Simple 12: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4512,7 +4368,7 @@ ReactStatistics { } `; -exports[`Simple 12 2`] = ` +exports[`Simple 12: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4536,7 +4392,7 @@ ReactStatistics { } `; -exports[`Simple 12 3`] = ` +exports[`Simple 12: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4560,7 +4416,7 @@ ReactStatistics { } `; -exports[`Simple 12 4`] = ` +exports[`Simple 12: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -4584,15 +4440,15 @@ ReactStatistics { } `; -exports[`Simple 13 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 13: (JSX => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 13 2`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 13: (JSX => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 13 3`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 13: (createElement => JSX) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 13 4`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; +exports[`Simple 13: (createElement => createElement) 1`] = `"Failed to render React component root \\"App\\" due to side-effects from throwing exception"`; -exports[`Simple 14 1`] = ` +exports[`Simple 14: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4609,7 +4465,7 @@ ReactStatistics { } `; -exports[`Simple 14 2`] = ` +exports[`Simple 14: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4626,7 +4482,7 @@ ReactStatistics { } `; -exports[`Simple 14 3`] = ` +exports[`Simple 14: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4643,7 +4499,7 @@ ReactStatistics { } `; -exports[`Simple 14 4`] = ` +exports[`Simple 14: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4660,7 +4516,7 @@ ReactStatistics { } `; -exports[`Simple 15 1`] = ` +exports[`Simple 15: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4677,7 +4533,7 @@ ReactStatistics { } `; -exports[`Simple 15 2`] = ` +exports[`Simple 15: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4694,7 +4550,7 @@ ReactStatistics { } `; -exports[`Simple 15 3`] = ` +exports[`Simple 15: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4711,7 +4567,7 @@ ReactStatistics { } `; -exports[`Simple 15 4`] = ` +exports[`Simple 15: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4728,7 +4584,7 @@ ReactStatistics { } `; -exports[`Simple 16 1`] = ` +exports[`Simple 16: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4745,7 +4601,7 @@ ReactStatistics { } `; -exports[`Simple 16 2`] = ` +exports[`Simple 16: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4762,7 +4618,7 @@ ReactStatistics { } `; -exports[`Simple 16 3`] = ` +exports[`Simple 16: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4779,7 +4635,7 @@ ReactStatistics { } `; -exports[`Simple 16 4`] = ` +exports[`Simple 16: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4796,7 +4652,7 @@ ReactStatistics { } `; -exports[`Simple 17 1`] = ` +exports[`Simple 17: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4813,7 +4669,7 @@ ReactStatistics { } `; -exports[`Simple 17 2`] = ` +exports[`Simple 17: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4830,7 +4686,7 @@ ReactStatistics { } `; -exports[`Simple 17 3`] = ` +exports[`Simple 17: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4847,7 +4703,7 @@ ReactStatistics { } `; -exports[`Simple 17 4`] = ` +exports[`Simple 17: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4864,7 +4720,7 @@ ReactStatistics { } `; -exports[`Simple 18 1`] = ` +exports[`Simple 18: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4881,7 +4737,7 @@ ReactStatistics { } `; -exports[`Simple 18 2`] = ` +exports[`Simple 18: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4898,7 +4754,7 @@ ReactStatistics { } `; -exports[`Simple 18 3`] = ` +exports[`Simple 18: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4915,7 +4771,7 @@ ReactStatistics { } `; -exports[`Simple 18 4`] = ` +exports[`Simple 18: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -4932,7 +4788,7 @@ ReactStatistics { } `; -exports[`Simple 19 1`] = ` +exports[`Simple 19: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4962,7 +4818,7 @@ ReactStatistics { } `; -exports[`Simple 19 2`] = ` +exports[`Simple 19: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -4992,7 +4848,7 @@ ReactStatistics { } `; -exports[`Simple 19 3`] = ` +exports[`Simple 19: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5022,7 +4878,7 @@ ReactStatistics { } `; -exports[`Simple 19 4`] = ` +exports[`Simple 19: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5052,7 +4908,7 @@ ReactStatistics { } `; -exports[`Simple 20 1`] = ` +exports[`Simple 20: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5082,7 +4938,7 @@ ReactStatistics { } `; -exports[`Simple 20 2`] = ` +exports[`Simple 20: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5112,7 +4968,7 @@ ReactStatistics { } `; -exports[`Simple 20 3`] = ` +exports[`Simple 20: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5142,7 +4998,7 @@ ReactStatistics { } `; -exports[`Simple 20 4`] = ` +exports[`Simple 20: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5172,7 +5028,7 @@ ReactStatistics { } `; -exports[`Simple 21 1`] = ` +exports[`Simple 21: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5196,7 +5052,7 @@ ReactStatistics { } `; -exports[`Simple 21 2`] = ` +exports[`Simple 21: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5220,7 +5076,7 @@ ReactStatistics { } `; -exports[`Simple 21 3`] = ` +exports[`Simple 21: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5244,7 +5100,7 @@ ReactStatistics { } `; -exports[`Simple 21 4`] = ` +exports[`Simple 21: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5268,7 +5124,7 @@ ReactStatistics { } `; -exports[`Simple children 1`] = ` +exports[`Simple children: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5299,7 +5155,7 @@ ReactStatistics { } `; -exports[`Simple children 2`] = ` +exports[`Simple children: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5330,7 +5186,7 @@ ReactStatistics { } `; -exports[`Simple children 3`] = ` +exports[`Simple children: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5361,7 +5217,7 @@ ReactStatistics { } `; -exports[`Simple children 4`] = ` +exports[`Simple children: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5392,7 +5248,7 @@ ReactStatistics { } `; -exports[`Simple fragments 1`] = ` +exports[`Simple fragments: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -5435,7 +5291,7 @@ ReactStatistics { } `; -exports[`Simple fragments 2`] = ` +exports[`Simple fragments: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -5478,7 +5334,7 @@ ReactStatistics { } `; -exports[`Simple fragments 3`] = ` +exports[`Simple fragments: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -5521,7 +5377,7 @@ ReactStatistics { } `; -exports[`Simple fragments 4`] = ` +exports[`Simple fragments: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -5564,7 +5420,7 @@ ReactStatistics { } `; -exports[`Simple refs 1`] = ` +exports[`Simple refs: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5588,7 +5444,7 @@ ReactStatistics { } `; -exports[`Simple refs 2`] = ` +exports[`Simple refs: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5612,7 +5468,7 @@ ReactStatistics { } `; -exports[`Simple refs 3`] = ` +exports[`Simple refs: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5636,7 +5492,7 @@ ReactStatistics { } `; -exports[`Simple refs 4`] = ` +exports[`Simple refs: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5660,7 +5516,7 @@ ReactStatistics { } `; -exports[`Simple with abstract props 1`] = ` +exports[`Simple with abstract props: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5691,7 +5547,7 @@ ReactStatistics { } `; -exports[`Simple with abstract props 2`] = ` +exports[`Simple with abstract props: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5722,7 +5578,7 @@ ReactStatistics { } `; -exports[`Simple with abstract props 3`] = ` +exports[`Simple with abstract props: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5753,7 +5609,7 @@ ReactStatistics { } `; -exports[`Simple with abstract props 4`] = ` +exports[`Simple with abstract props: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -5784,7 +5640,7 @@ ReactStatistics { } `; -exports[`Simple with new expression 1`] = ` +exports[`Simple with new expression: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5801,7 +5657,7 @@ ReactStatistics { } `; -exports[`Simple with new expression 2`] = ` +exports[`Simple with new expression: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5818,7 +5674,7 @@ ReactStatistics { } `; -exports[`Simple with new expression 3`] = ` +exports[`Simple with new expression: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5835,7 +5691,7 @@ ReactStatistics { } `; -exports[`Simple with new expression 4`] = ` +exports[`Simple with new expression: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -5852,7 +5708,7 @@ ReactStatistics { } `; -exports[`Simple with unary expressions 1`] = ` +exports[`Simple with unary expressions: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5876,7 +5732,7 @@ ReactStatistics { } `; -exports[`Simple with unary expressions 2`] = ` +exports[`Simple with unary expressions: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5900,7 +5756,7 @@ ReactStatistics { } `; -exports[`Simple with unary expressions 3`] = ` +exports[`Simple with unary expressions: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5924,7 +5780,7 @@ ReactStatistics { } `; -exports[`Simple with unary expressions 4`] = ` +exports[`Simple with unary expressions: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5948,7 +5804,151 @@ ReactStatistics { } `; -exports[`Two roots 1`] = ` +exports[`Simple: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Simple: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "A", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "B", + "status": "INLINED", + }, + Object { + "children": Array [], + "message": "", + "name": "C", + "status": "INLINED", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 3, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Two roots: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5971,7 +5971,7 @@ ReactStatistics { } `; -exports[`Two roots 2`] = ` +exports[`Two roots: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -5994,7 +5994,7 @@ ReactStatistics { } `; -exports[`Two roots 3`] = ` +exports[`Two roots: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -6017,7 +6017,7 @@ ReactStatistics { } `; -exports[`Two roots 4`] = ` +exports[`Two roots: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -6040,7 +6040,7 @@ ReactStatistics { } `; -exports[`defaultProps 1`] = ` +exports[`defaultProps: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -6064,7 +6064,7 @@ ReactStatistics { } `; -exports[`defaultProps 2`] = ` +exports[`defaultProps: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -6088,7 +6088,7 @@ ReactStatistics { } `; -exports[`defaultProps 3`] = ` +exports[`defaultProps: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -6112,7 +6112,7 @@ ReactStatistics { } `; -exports[`defaultProps 4`] = ` +exports[`defaultProps: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/ReactDOM-test.js.snap b/test/react/__snapshots__/ReactDOM-test.js.snap index dc7bf9930f..8e68b020c4 100644 --- a/test/react/__snapshots__/ReactDOM-test.js.snap +++ b/test/react/__snapshots__/ReactDOM-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`createPortal 1`] = ` +exports[`createPortal: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -38,7 +38,7 @@ ReactStatistics { } `; -exports[`createPortal 2`] = ` +exports[`createPortal: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -76,7 +76,7 @@ ReactStatistics { } `; -exports[`createPortal 3`] = ` +exports[`createPortal: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -114,7 +114,7 @@ ReactStatistics { } `; -exports[`createPortal 4`] = ` +exports[`createPortal: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/Reconciliation-test.js.snap b/test/react/__snapshots__/Reconciliation-test.js.snap index 4848134124..49b70f45f7 100644 --- a/test/react/__snapshots__/Reconciliation-test.js.snap +++ b/test/react/__snapshots__/Reconciliation-test.js.snap @@ -1,94 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Component type change 1`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Component type change 2`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Component type change 2 1`] = ` +exports[`Component type change 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -118,7 +30,7 @@ ReactStatistics { } `; -exports[`Component type change 2 2`] = ` +exports[`Component type change 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -148,7 +60,7 @@ ReactStatistics { } `; -exports[`Component type change 2 3`] = ` +exports[`Component type change 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -178,7 +90,7 @@ ReactStatistics { } `; -exports[`Component type change 2 4`] = ` +exports[`Component type change 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -208,51 +120,7 @@ ReactStatistics { } `; -exports[`Component type change 3`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Component type change 3 1`] = ` +exports[`Component type change 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -282,7 +150,7 @@ ReactStatistics { } `; -exports[`Component type change 3 2`] = ` +exports[`Component type change 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -312,7 +180,7 @@ ReactStatistics { } `; -exports[`Component type change 3 3`] = ` +exports[`Component type change 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -342,7 +210,7 @@ ReactStatistics { } `; -exports[`Component type change 3 4`] = ` +exports[`Component type change 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -372,51 +240,7 @@ ReactStatistics { } `; -exports[`Component type change 4`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "MessagePane", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], - "message": "", - "name": "SettingsPane", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 2, - "optimizedNestedClosures": 0, - "optimizedTrees": 2, -} -`; - -exports[`Component type change 4 1`] = ` +exports[`Component type change 4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -458,7 +282,7 @@ ReactStatistics { } `; -exports[`Component type change 4 2`] = ` +exports[`Component type change 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -500,7 +324,7 @@ ReactStatistics { } `; -exports[`Component type change 4 3`] = ` +exports[`Component type change 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -542,7 +366,7 @@ ReactStatistics { } `; -exports[`Component type change 4 4`] = ` +exports[`Component type change 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -584,7 +408,7 @@ ReactStatistics { } `; -exports[`Component type change 5 1`] = ` +exports[`Component type change 5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -626,7 +450,7 @@ ReactStatistics { } `; -exports[`Component type change 5 2`] = ` +exports[`Component type change 5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -668,7 +492,7 @@ ReactStatistics { } `; -exports[`Component type change 5 3`] = ` +exports[`Component type change 5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -710,7 +534,7 @@ ReactStatistics { } `; -exports[`Component type change 5 4`] = ` +exports[`Component type change 5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -752,7 +576,7 @@ ReactStatistics { } `; -exports[`Component type change 6 1`] = ` +exports[`Component type change 6: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -782,7 +606,7 @@ ReactStatistics { } `; -exports[`Component type change 6 2`] = ` +exports[`Component type change 6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -812,7 +636,7 @@ ReactStatistics { } `; -exports[`Component type change 6 3`] = ` +exports[`Component type change 6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -842,7 +666,7 @@ ReactStatistics { } `; -exports[`Component type change 6 4`] = ` +exports[`Component type change 6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -872,7 +696,7 @@ ReactStatistics { } `; -exports[`Component type change 7 1`] = ` +exports[`Component type change 7: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -902,7 +726,7 @@ ReactStatistics { } `; -exports[`Component type change 7 2`] = ` +exports[`Component type change 7: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -932,7 +756,7 @@ ReactStatistics { } `; -exports[`Component type change 7 3`] = ` +exports[`Component type change 7: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -962,7 +786,7 @@ ReactStatistics { } `; -exports[`Component type change 7 4`] = ` +exports[`Component type change 7: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -992,7 +816,7 @@ ReactStatistics { } `; -exports[`Component type change 8 1`] = ` +exports[`Component type change 8: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1022,7 +846,7 @@ ReactStatistics { } `; -exports[`Component type change 8 2`] = ` +exports[`Component type change 8: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1052,7 +876,7 @@ ReactStatistics { } `; -exports[`Component type change 8 3`] = ` +exports[`Component type change 8: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1082,7 +906,7 @@ ReactStatistics { } `; -exports[`Component type change 8 4`] = ` +exports[`Component type change 8: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1112,7 +936,7 @@ ReactStatistics { } `; -exports[`Component type change 9 1`] = ` +exports[`Component type change 9: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1142,7 +966,7 @@ ReactStatistics { } `; -exports[`Component type change 9 2`] = ` +exports[`Component type change 9: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1172,7 +996,7 @@ ReactStatistics { } `; -exports[`Component type change 9 3`] = ` +exports[`Component type change 9: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1202,7 +1026,7 @@ ReactStatistics { } `; -exports[`Component type change 9 4`] = ` +exports[`Component type change 9: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1232,7 +1056,7 @@ ReactStatistics { } `; -exports[`Component type change 10 1`] = ` +exports[`Component type change 10: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1262,7 +1086,7 @@ ReactStatistics { } `; -exports[`Component type change 10 2`] = ` +exports[`Component type change 10: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1292,7 +1116,7 @@ ReactStatistics { } `; -exports[`Component type change 10 3`] = ` +exports[`Component type change 10: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1322,7 +1146,7 @@ ReactStatistics { } `; -exports[`Component type change 10 4`] = ` +exports[`Component type change 10: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1352,7 +1176,7 @@ ReactStatistics { } `; -exports[`Component type change 11 1`] = ` +exports[`Component type change 11: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1382,7 +1206,7 @@ ReactStatistics { } `; -exports[`Component type change 11 2`] = ` +exports[`Component type change 11: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1412,7 +1236,7 @@ ReactStatistics { } `; -exports[`Component type change 11 3`] = ` +exports[`Component type change 11: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1442,7 +1266,7 @@ ReactStatistics { } `; -exports[`Component type change 11 4`] = ` +exports[`Component type change 11: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1472,22 +1296,36 @@ ReactStatistics { } `; -exports[`Component type same 1`] = ` +exports[`Component type change: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "MessagePane", "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "SettingsPane", "status": "INLINED", }, ], @@ -1498,26 +1336,40 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Component type same 2`] = ` +exports[`Component type change: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "MessagePane", "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "SettingsPane", "status": "INLINED", }, ], @@ -1528,26 +1380,40 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Component type same 3`] = ` +exports[`Component type change: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "MessagePane", "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "SettingsPane", "status": "INLINED", }, ], @@ -1558,26 +1424,40 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Component type same 4`] = ` +exports[`Component type change: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], - "message": "", - "name": "Foo", - "status": "INLINED", + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "MessagePane", + "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Foo", + "name": "SettingsPane", "status": "INLINED", }, ], @@ -1588,27 +1468,27 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Key change 1`] = ` +exports[`Component type same: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, ], "message": "", @@ -1616,29 +1496,29 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change 2`] = ` +exports[`Component type same: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, ], "message": "", @@ -1646,29 +1526,29 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change 3`] = ` +exports[`Component type same: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, ], "message": "", @@ -1676,29 +1556,29 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change 4`] = ` +exports[`Component type same: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 4, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, Object { "children": Array [], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "Foo", + "status": "INLINED", }, ], "message": "", @@ -1706,13 +1586,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key change with fragments 1`] = ` +exports[`Key change with fragments: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1749,7 +1629,7 @@ ReactStatistics { } `; -exports[`Key change with fragments 2`] = ` +exports[`Key change with fragments: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1786,7 +1666,7 @@ ReactStatistics { } `; -exports[`Key change with fragments 3`] = ` +exports[`Key change with fragments: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1823,7 +1703,7 @@ ReactStatistics { } `; -exports[`Key change with fragments 4`] = ` +exports[`Key change with fragments: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -1860,37 +1740,23 @@ ReactStatistics { } `; -exports[`Key nesting 1`] = ` +exports[`Key change: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "MessagePane", - "status": "INLINED", + "name": "Stateful", + "status": "NEW_TREE", }, Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", - "status": "INLINED", + "name": "Stateful", + "status": "NEW_TREE", }, ], "message": "", @@ -1898,43 +1764,29 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 2, } `; -exports[`Key nesting 2`] = ` +exports[`Key change: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "MessagePane", - "status": "INLINED", + "name": "Stateful", + "status": "NEW_TREE", }, Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", - "status": "INLINED", + "name": "Stateful", + "status": "NEW_TREE", }, ], "message": "", @@ -1942,13 +1794,73 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 2, + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 2, +} +`; + +exports[`Key change: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 4, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, "optimizedNestedClosures": 0, "optimizedTrees": 2, } `; -exports[`Key nesting 2 1`] = ` +exports[`Key nesting 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1978,7 +1890,7 @@ ReactStatistics { } `; -exports[`Key nesting 2 2`] = ` +exports[`Key nesting 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2008,7 +1920,7 @@ ReactStatistics { } `; -exports[`Key nesting 2 3`] = ` +exports[`Key nesting 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2038,7 +1950,7 @@ ReactStatistics { } `; -exports[`Key nesting 2 4`] = ` +exports[`Key nesting 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2068,36 +1980,22 @@ ReactStatistics { } `; -exports[`Key nesting 3`] = ` +exports[`Key nesting 3: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "MessagePane", + "name": "Child", "status": "INLINED", }, Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Stateful", - "status": "NEW_TREE", - }, - ], + "children": Array [], "message": "", - "name": "SettingsPane", + "name": "Child", "status": "INLINED", }, ], @@ -2108,11 +2006,11 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 2, + "optimizedTrees": 1, } `; -exports[`Key nesting 3 1`] = ` +exports[`Key nesting 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2142,7 +2040,7 @@ ReactStatistics { } `; -exports[`Key nesting 3 2`] = ` +exports[`Key nesting 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2172,7 +2070,7 @@ ReactStatistics { } `; -exports[`Key nesting 3 3`] = ` +exports[`Key nesting 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2202,22 +2100,36 @@ ReactStatistics { } `; -exports[`Key nesting 3 4`] = ` +exports[`Key nesting: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Child", + "name": "MessagePane", "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Child", + "name": "SettingsPane", "status": "INLINED", }, ], @@ -2228,11 +2140,11 @@ ReactStatistics { ], "inlinedComponents": 2, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Key nesting 4`] = ` +exports[`Key nesting: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 6, "evaluatedRootNodes": Array [ @@ -2276,9 +2188,9 @@ ReactStatistics { } `; -exports[`Key not changing with fragments 1`] = ` +exports[`Key nesting: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2292,14 +2204,21 @@ ReactStatistics { }, ], "message": "", - "name": "React.Fragment", - "status": "NORMAL", + "name": "MessagePane", + "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "SettingsPane", + "status": "INLINED", }, ], "message": "", @@ -2307,15 +2226,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 2, } `; -exports[`Key not changing with fragments 2`] = ` +exports[`Key nesting: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 5, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -2329,14 +2248,21 @@ ReactStatistics { }, ], "message": "", - "name": "React.Fragment", - "status": "NORMAL", + "name": "MessagePane", + "status": "INLINED", }, Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", - "name": "Stateful", - "status": "NEW_TREE", + "name": "SettingsPane", + "status": "INLINED", }, ], "message": "", @@ -2344,13 +2270,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, + "inlinedComponents": 2, "optimizedNestedClosures": 0, "optimizedTrees": 2, } `; -exports[`Key not changing with fragments 3`] = ` +exports[`Key not changing with fragments: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2387,7 +2313,7 @@ ReactStatistics { } `; -exports[`Key not changing with fragments 4`] = ` +exports[`Key not changing with fragments: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -2424,12 +2350,32 @@ ReactStatistics { } `; -exports[`Lazy branched elements 1`] = ` +exports[`Key not changing with fragments: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 5, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", "name": "App", "status": "ROOT", @@ -2437,16 +2383,36 @@ ReactStatistics { ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Lazy branched elements 2`] = ` +exports[`Key not changing with fragments: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 5, "evaluatedRootNodes": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], + "message": "", + "name": "React.Fragment", + "status": "NORMAL", + }, + Object { + "children": Array [], + "message": "", + "name": "Stateful", + "status": "NEW_TREE", + }, + ], "message": "", "name": "App", "status": "ROOT", @@ -2454,11 +2420,11 @@ ReactStatistics { ], "inlinedComponents": 0, "optimizedNestedClosures": 0, - "optimizedTrees": 1, + "optimizedTrees": 2, } `; -exports[`Lazy branched elements 2 1`] = ` +exports[`Lazy branched elements 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2482,7 +2448,7 @@ ReactStatistics { } `; -exports[`Lazy branched elements 2 2`] = ` +exports[`Lazy branched elements 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2506,7 +2472,7 @@ ReactStatistics { } `; -exports[`Lazy branched elements 2 3`] = ` +exports[`Lazy branched elements 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2530,7 +2496,7 @@ ReactStatistics { } `; -exports[`Lazy branched elements 2 4`] = ` +exports[`Lazy branched elements 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -2554,7 +2520,41 @@ ReactStatistics { } `; -exports[`Lazy branched elements 3`] = ` +exports[`Lazy branched elements: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 0, + "optimizedTrees": 1, +} +`; + +exports[`Lazy branched elements: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2571,7 +2571,7 @@ ReactStatistics { } `; -exports[`Lazy branched elements 4`] = ` +exports[`Lazy branched elements: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/RenderProps-test.js.snap b/test/react/__snapshots__/RenderProps-test.js.snap index ae76c525a7..4334997948 100644 --- a/test/react/__snapshots__/RenderProps-test.js.snap +++ b/test/react/__snapshots__/RenderProps-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`React Context 1`] = ` +exports[`React Context 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -38,7 +38,7 @@ ReactStatistics { } `; -exports[`React Context 2`] = ` +exports[`React Context 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -76,7 +76,7 @@ ReactStatistics { } `; -exports[`React Context 2 1`] = ` +exports[`React Context 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -114,7 +114,7 @@ ReactStatistics { } `; -exports[`React Context 2 2`] = ` +exports[`React Context 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -152,121 +152,7 @@ ReactStatistics { } `; -exports[`React Context 2 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 2 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 3`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 3 1`] = ` +exports[`React Context 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -297,7 +183,7 @@ ReactStatistics { } `; -exports[`React Context 3 2`] = ` +exports[`React Context 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -328,7 +214,7 @@ ReactStatistics { } `; -exports[`React Context 3 3`] = ` +exports[`React Context 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -359,7 +245,7 @@ ReactStatistics { } `; -exports[`React Context 3 4`] = ` +exports[`React Context 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 2, "evaluatedRootNodes": Array [ @@ -390,45 +276,7 @@ ReactStatistics { } `; -exports[`React Context 4`] = ` -ReactStatistics { - "componentsEvaluated": 4, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 3, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context 4 1`] = ` +exports[`React Context 4: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -486,7 +334,7 @@ ReactStatistics { } `; -exports[`React Context 4 2`] = ` +exports[`React Context 4: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -544,7 +392,7 @@ ReactStatistics { } `; -exports[`React Context 4 3`] = ` +exports[`React Context 4: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -602,7 +450,7 @@ ReactStatistics { } `; -exports[`React Context 4 4`] = ` +exports[`React Context 4: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -660,7 +508,7 @@ ReactStatistics { } `; -exports[`React Context 5 1`] = ` +exports[`React Context 5: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -711,7 +559,7 @@ ReactStatistics { } `; -exports[`React Context 5 2`] = ` +exports[`React Context 5: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -762,7 +610,7 @@ ReactStatistics { } `; -exports[`React Context 5 3`] = ` +exports[`React Context 5: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -813,7 +661,7 @@ ReactStatistics { } `; -exports[`React Context 5 4`] = ` +exports[`React Context 5: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 5, "evaluatedRootNodes": Array [ @@ -864,7 +712,7 @@ ReactStatistics { } `; -exports[`React Context 6 1`] = ` +exports[`React Context 6: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -902,7 +750,7 @@ ReactStatistics { } `; -exports[`React Context 6 2`] = ` +exports[`React Context 6: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -940,7 +788,7 @@ ReactStatistics { } `; -exports[`React Context 6 3`] = ` +exports[`React Context 6: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -978,7 +826,7 @@ ReactStatistics { } `; -exports[`React Context 6 4`] = ` +exports[`React Context 6: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 4, "evaluatedRootNodes": Array [ @@ -1016,7 +864,7 @@ ReactStatistics { } `; -exports[`React Context 7 1`] = ` +exports[`React Context 7: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1054,7 +902,7 @@ ReactStatistics { } `; -exports[`React Context 7 2`] = ` +exports[`React Context 7: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1092,7 +940,7 @@ ReactStatistics { } `; -exports[`React Context 7 3`] = ` +exports[`React Context 7: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1130,7 +978,7 @@ ReactStatistics { } `; -exports[`React Context 7 4`] = ` +exports[`React Context 7: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -1168,9 +1016,9 @@ ReactStatistics { } `; -exports[`React Context from root tree 1`] = ` +exports[`React Context from root tree 2: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 7, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1179,54 +1027,23 @@ ReactStatistics { Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], "message": "", - "name": "Context.Consumer", + "name": "Child", "status": "INLINED", }, ], "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", + "name": "Context.Provider", "status": "INLINED", }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, - ], - "message": "", - "name": "App", - "status": "ROOT", - }, - ], - "inlinedComponents": 5, - "optimizedNestedClosures": 0, - "optimizedTrees": 1, -} -`; - -exports[`React Context from root tree 2`] = ` -ReactStatistics { - "componentsEvaluated": 6, - "evaluatedRootNodes": Array [ - Object { - "children": Array [ - Object { - "children": Array [ Object { "children": Array [ Object { @@ -1245,32 +1062,19 @@ ReactStatistics { "name": "Context.Provider", "status": "INLINED", }, - Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], - "message": "", - "name": "Child", - "status": "INLINED", - }, ], "message": "", "name": "App", "status": "ROOT", }, ], - "inlinedComponents": 5, + "inlinedComponents": 6, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context from root tree 2 1`] = ` +exports[`React Context from root tree 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1328,7 +1132,7 @@ ReactStatistics { } `; -exports[`React Context from root tree 2 2`] = ` +exports[`React Context from root tree 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1386,7 +1190,7 @@ ReactStatistics { } `; -exports[`React Context from root tree 2 3`] = ` +exports[`React Context from root tree 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1444,7 +1248,7 @@ ReactStatistics { } `; -exports[`React Context from root tree 2 4`] = ` +exports[`React Context from root tree 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1502,9 +1306,9 @@ ReactStatistics { } `; -exports[`React Context from root tree 3`] = ` +exports[`React Context from root tree 3: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 6, + "componentsEvaluated": 7, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1513,32 +1317,39 @@ ReactStatistics { Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], "message": "", - "name": "Context.Consumer", + "name": "Child", "status": "INLINED", }, ], "message": "", - "name": "Child", + "name": "Context.Provider", "status": "INLINED", }, - ], - "message": "", - "name": "Context.Provider", - "status": "INLINED", - }, - Object { - "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], "message": "", - "name": "Context.Consumer", + "name": "Child", "status": "INLINED", }, ], "message": "", - "name": "Child", + "name": "Context.Provider", "status": "INLINED", }, ], @@ -1547,13 +1358,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 5, + "inlinedComponents": 6, "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context from root tree 3 1`] = ` +exports[`React Context from root tree 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1611,7 +1422,7 @@ ReactStatistics { } `; -exports[`React Context from root tree 3 2`] = ` +exports[`React Context from root tree 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 7, "evaluatedRootNodes": Array [ @@ -1669,9 +1480,9 @@ ReactStatistics { } `; -exports[`React Context from root tree 3 3`] = ` +exports[`React Context from root tree 4: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 7, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1680,30 +1491,48 @@ ReactStatistics { Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", - "name": "Child", - "status": "INLINED", + "name": "Context.Consumer", + "status": "RENDER_PROPS", }, ], "message": "", - "name": "Context.Provider", + "name": "Child", "status": "INLINED", }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "INLINED", + "status": "RENDER_PROPS", }, ], "message": "", @@ -1713,7 +1542,7 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "INLINED", + "status": "NORMAL", }, ], "message": "", @@ -1721,15 +1550,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`React Context from root tree 3 4`] = ` +exports[`React Context from root tree 4: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 7, + "componentsEvaluated": 3, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1738,30 +1567,48 @@ ReactStatistics { Object { "children": Array [ Object { - "children": Array [ - Object { - "children": Array [], - "message": "", - "name": "Context.Consumer", - "status": "INLINED", - }, - ], + "children": Array [], "message": "", - "name": "Child", - "status": "INLINED", + "name": "Context.Consumer", + "status": "RENDER_PROPS", }, ], "message": "", - "name": "Context.Provider", + "name": "Child", "status": "INLINED", }, + ], + "message": "", + "name": "Context.Provider", + "status": "NORMAL", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 1, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`React Context from root tree 4: (createElement => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 3, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [ Object { "children": Array [ Object { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "INLINED", + "status": "RENDER_PROPS", }, ], "message": "", @@ -1771,7 +1618,7 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "INLINED", + "status": "NORMAL", }, ], "message": "", @@ -1779,13 +1626,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 6, - "optimizedNestedClosures": 0, + "inlinedComponents": 1, + "optimizedNestedClosures": 1, "optimizedTrees": 1, } `; -exports[`React Context from root tree 4`] = ` +exports[`React Context from root tree: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 6, "evaluatedRootNodes": Array [ @@ -1836,9 +1683,9 @@ ReactStatistics { } `; -exports[`React Context from root tree 4 1`] = ` +exports[`React Context from root tree: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1850,7 +1697,7 @@ ReactStatistics { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "RENDER_PROPS", + "status": "INLINED", }, ], "message": "", @@ -1860,7 +1707,20 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "NORMAL", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", }, ], "message": "", @@ -1868,15 +1728,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "inlinedComponents": 5, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context from root tree 4 2`] = ` +exports[`React Context from root tree: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1888,7 +1748,7 @@ ReactStatistics { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "RENDER_PROPS", + "status": "INLINED", }, ], "message": "", @@ -1898,7 +1758,20 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "NORMAL", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", }, ], "message": "", @@ -1906,15 +1779,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "inlinedComponents": 5, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context from root tree 4 3`] = ` +exports[`React Context from root tree: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 6, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1926,7 +1799,7 @@ ReactStatistics { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "RENDER_PROPS", + "status": "INLINED", }, ], "message": "", @@ -1936,7 +1809,20 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "NORMAL", + "status": "INLINED", + }, + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", }, ], "message": "", @@ -1944,15 +1830,15 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "inlinedComponents": 5, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`React Context from root tree 4 4`] = ` +exports[`React Context: (JSX => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 3, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ @@ -1964,7 +1850,7 @@ ReactStatistics { "children": Array [], "message": "", "name": "Context.Consumer", - "status": "RENDER_PROPS", + "status": "INLINED", }, ], "message": "", @@ -1974,7 +1860,7 @@ ReactStatistics { ], "message": "", "name": "Context.Provider", - "status": "NORMAL", + "status": "INLINED", }, ], "message": "", @@ -1982,23 +1868,37 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 1, - "optimizedNestedClosures": 1, + "inlinedComponents": 3, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Relay QueryRenderer 1`] = ` +exports[`React Context: (JSX => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", + "name": "Context.Provider", + "status": "INLINED", }, ], "message": "", @@ -2006,23 +1906,37 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, + "inlinedComponents": 3, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Relay QueryRenderer 2`] = ` +exports[`React Context: (createElement => JSX) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", + "name": "Context.Provider", + "status": "INLINED", }, ], "message": "", @@ -2030,23 +1944,37 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, + "inlinedComponents": 3, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Relay QueryRenderer 2 1`] = ` +exports[`React Context: (createElement => createElement) 1`] = ` ReactStatistics { - "componentsEvaluated": 1, + "componentsEvaluated": 4, "evaluatedRootNodes": Array [ Object { "children": Array [ Object { - "children": Array [], + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "Context.Consumer", + "status": "INLINED", + }, + ], + "message": "", + "name": "Child", + "status": "INLINED", + }, + ], "message": "", - "name": "QueryRenderer", - "status": "RENDER_PROPS", + "name": "Context.Provider", + "status": "INLINED", }, ], "message": "", @@ -2054,13 +1982,13 @@ ReactStatistics { "status": "ROOT", }, ], - "inlinedComponents": 0, - "optimizedNestedClosures": 1, + "inlinedComponents": 3, + "optimizedNestedClosures": 0, "optimizedTrees": 1, } `; -exports[`Relay QueryRenderer 2 2`] = ` +exports[`Relay QueryRenderer 2: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2084,7 +2012,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 2 3`] = ` +exports[`Relay QueryRenderer 2: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2108,7 +2036,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 2 4`] = ` +exports[`Relay QueryRenderer 2: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2132,7 +2060,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 3`] = ` +exports[`Relay QueryRenderer 2: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ @@ -2156,7 +2084,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 3 1`] = ` +exports[`Relay QueryRenderer 3: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2187,7 +2115,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 3 2`] = ` +exports[`Relay QueryRenderer 3: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2218,7 +2146,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 3 3`] = ` +exports[`Relay QueryRenderer 3: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2249,7 +2177,7 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 3 4`] = ` +exports[`Relay QueryRenderer 3: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 3, "evaluatedRootNodes": Array [ @@ -2280,7 +2208,79 @@ ReactStatistics { } `; -exports[`Relay QueryRenderer 4`] = ` +exports[`Relay QueryRenderer: (JSX => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer: (JSX => createElement) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer: (createElement => JSX) 1`] = ` +ReactStatistics { + "componentsEvaluated": 1, + "evaluatedRootNodes": Array [ + Object { + "children": Array [ + Object { + "children": Array [], + "message": "", + "name": "QueryRenderer", + "status": "RENDER_PROPS", + }, + ], + "message": "", + "name": "App", + "status": "ROOT", + }, + ], + "inlinedComponents": 0, + "optimizedNestedClosures": 1, + "optimizedTrees": 1, +} +`; + +exports[`Relay QueryRenderer: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 1, "evaluatedRootNodes": Array [ diff --git a/test/react/__snapshots__/ServerRendering-test.js.snap b/test/react/__snapshots__/ServerRendering-test.js.snap index bdd6f76c77..d0fe1723ee 100644 --- a/test/react/__snapshots__/ServerRendering-test.js.snap +++ b/test/react/__snapshots__/ServerRendering-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Hacker News app 1`] = ` +exports[`Hacker News app: (JSX => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -10,7 +10,7 @@ ReactStatistics { } `; -exports[`Hacker News app 2`] = ` +exports[`Hacker News app: (JSX => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -20,7 +20,7 @@ ReactStatistics { } `; -exports[`Hacker News app 3`] = ` +exports[`Hacker News app: (createElement => JSX) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], @@ -30,7 +30,7 @@ ReactStatistics { } `; -exports[`Hacker News app 4`] = ` +exports[`Hacker News app: (createElement => createElement) 1`] = ` ReactStatistics { "componentsEvaluated": 0, "evaluatedRootNodes": Array [], diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index f7ac374901..7ead03b8d0 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -185,7 +185,7 @@ function prepareReactTests() { } } - function runTestWithOptions(source, useJSXOutput, options) { + function runTestWithOptions(source, useJSXOutput, options, snapshotName) { let { firstRenderOnly = false, // By default, we recover from PP0025 even though it's technically unsafe. @@ -200,7 +200,7 @@ function prepareReactTests() { ({ compiledSource, statistics } = compileSourceWithPrepack(source, useJSXOutput, diagnosticLog, shouldRecover)); } catch (err) { if (err.__isReconcilerFatalError && expectReconcilerError) { - expect(err.message).toMatchSnapshot(); + expect(err.message).toMatchSnapshot(undefined, snapshotName); return; } diagnosticLog.forEach(diag => { @@ -209,7 +209,7 @@ function prepareReactTests() { throw err; } - expect(statistics).toMatchSnapshot(); + expect(statistics).toMatchSnapshot(undefined, snapshotName); let A = runSource(source); let B = runSource(compiledSource); @@ -262,10 +262,10 @@ function prepareReactTests() { function runTest(fixturePath: string, options: TestOptions = {}) { let source = fs.readFileSync(fixturePath).toString(); let jsxSource = transpileSource(source); - runTestWithOptions(jsxSource, false, options); - runTestWithOptions(source, false, options); - runTestWithOptions(jsxSource, true, options); - runTestWithOptions(source, true, options); + runTestWithOptions(jsxSource, false, options, '(JSX => createElement)'); + runTestWithOptions(source, false, options, '(createElement => createElement)'); + runTestWithOptions(jsxSource, true, options, '(JSX => JSX)'); + runTestWithOptions(source, true, options, '(createElement => JSX)'); } return { From 6168f6ba55590427c0e41b24c560b27dbb9357ce Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 02:53:10 +0100 Subject: [PATCH 13/22] Fail tests earlier without running Babel --- test/react/prepareReactTests.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/react/prepareReactTests.js b/test/react/prepareReactTests.js index 7ead03b8d0..ecdeb57a8a 100644 --- a/test/react/prepareReactTests.js +++ b/test/react/prepareReactTests.js @@ -261,11 +261,12 @@ function prepareReactTests() { function runTest(fixturePath: string, options: TestOptions = {}) { let source = fs.readFileSync(fixturePath).toString(); + // Run tests that don't need the transform first so they can fail early. + runTestWithOptions(source, false, options, '(createElement => createElement)'); + runTestWithOptions(source, true, options, '(createElement => JSX)'); let jsxSource = transpileSource(source); runTestWithOptions(jsxSource, false, options, '(JSX => createElement)'); - runTestWithOptions(source, false, options, '(createElement => createElement)'); runTestWithOptions(jsxSource, true, options, '(JSX => JSX)'); - runTestWithOptions(source, true, options, '(createElement => JSX)'); } return { From ebdacc417ba97e4e5a72cffb976c650f963ce6f5 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 30 Jun 2018 02:55:46 +0100 Subject: [PATCH 14/22] Run Prettier on all React tests and fixtures --- scripts/prettier.js | 2 +- test/react/AssignSpread/simple-assign.js | 8 +- test/react/AssignSpread/simple-assign2.js | 22 ++-- test/react/AssignSpread/simple-assign3.js | 10 +- test/react/AssignSpread/simple-assign4.js | 16 +-- test/react/AssignSpread/simple-assign5.js | 10 +- .../AssignSpread/simple-with-jsx-spread.js | 20 ++-- .../AssignSpread/simple-with-jsx-spread10.js | 10 +- .../AssignSpread/simple-with-jsx-spread11.js | 12 +- .../AssignSpread/simple-with-jsx-spread12.js | 19 +-- .../AssignSpread/simple-with-jsx-spread13.js | 21 ++-- .../AssignSpread/simple-with-jsx-spread2.js | 20 ++-- .../AssignSpread/simple-with-jsx-spread3.js | 14 +-- .../AssignSpread/simple-with-jsx-spread4.js | 16 +-- .../AssignSpread/simple-with-jsx-spread5.js | 8 +- .../AssignSpread/simple-with-jsx-spread6.js | 10 +- .../AssignSpread/simple-with-jsx-spread7.js | 21 ++-- .../AssignSpread/simple-with-jsx-spread8.js | 25 ++-- .../AssignSpread/simple-with-jsx-spread9.js | 10 +- test/react/AssignSpread/unsafe-spread.js | 13 +- test/react/ClassComponents/array-from.js | 31 ++--- test/react/ClassComponents/array-from2.js | 24 ++-- .../ClassComponents/classes-with-state.js | 6 +- .../complex-class-into-functional-root.js | 20 +++- .../complex-class-into-functional-root2.js | 20 ++-- .../complex-class-into-functional-root3.js | 28 +++-- .../complex-class-into-functional-root4.js | 14 ++- .../complex-class-into-functional-root5.js | 22 ++-- .../ClassComponents/inheritance-chain.js | 16 ++- .../react/ClassComponents/simple-classes-2.js | 6 +- .../react/ClassComponents/simple-classes-3.js | 12 +- test/react/ClassComponents/simple-classes.js | 30 ++--- test/react/ClassComponents/simple.js | 2 +- test/react/FBMocks/fb1.js | 12 +- test/react/FBMocks/fb10.js | 21 ++-- test/react/FBMocks/fb11.js | 33 +++-- test/react/FBMocks/fb12.js | 17 +-- test/react/FBMocks/fb13.js | 6 +- test/react/FBMocks/fb14.js | 21 ++-- test/react/FBMocks/fb15.js | 14 +-- test/react/FBMocks/fb16.js | 12 +- test/react/FBMocks/fb17.js | 12 +- test/react/FBMocks/fb18.js | 6 +- test/react/FBMocks/fb19.js | 7 +- test/react/FBMocks/fb2.js | 12 +- test/react/FBMocks/fb20.js | 8 +- test/react/FBMocks/fb21.js | 8 +- test/react/FBMocks/fb22.js | 8 +- test/react/FBMocks/fb23.js | 16 ++- test/react/FBMocks/fb3.js | 4 +- test/react/FBMocks/fb4.js | 3 +- test/react/FBMocks/fb5.js | 50 ++++---- test/react/FBMocks/fb6.js | 14 +-- test/react/FBMocks/fb7.js | 21 ++-- test/react/FBMocks/fb8.js | 27 +++-- test/react/FBMocks/fb9.js | 28 ++--- test/react/FBMocks/function-bind.js | 19 +-- test/react/FBMocks/hacker-news.js | 113 +++++++++--------- test/react/FBMocks/repl-example.js | 26 ++-- test/react/FactoryComponents/simple.js | 10 +- test/react/FactoryComponents/simple2.js | 16 ++- .../get-derived-state-from-props.js | 27 ++--- .../get-derived-state-from-props2.js | 27 ++--- .../get-derived-state-from-props3.js | 29 ++--- .../get-derived-state-from-props4.js | 31 ++--- .../get-derived-state-from-props5.js | 26 ++-- test/react/FirstRenderOnly/react-context.js | 12 +- test/react/FirstRenderOnly/react-context2.js | 12 +- test/react/FirstRenderOnly/react-context3.js | 22 ++-- test/react/FirstRenderOnly/react-context4.js | 12 +- test/react/FirstRenderOnly/react-context5.js | 12 +- test/react/FirstRenderOnly/react-context6.js | 16 ++- .../replace-this-in-callbacks.js | 11 +- .../replace-this-in-callbacks2.js | 9 +- .../replace-this-in-callbacks3.js | 9 +- test/react/FirstRenderOnly/simple-2.js | 8 +- test/react/FirstRenderOnly/simple-3.js | 13 +- test/react/FirstRenderOnly/simple-4.js | 16 ++- test/react/FirstRenderOnly/simple.js | 22 ++-- test/react/FirstRenderOnly/will-mount.js | 22 ++-- .../additional-function-regression.js | 26 ++-- test/react/FunctionalComponents/array-from.js | 27 ++--- test/react/FunctionalComponents/array-map.js | 24 ++-- test/react/FunctionalComponents/array-map2.js | 24 ++-- .../react/FunctionalComponents/array-twice.js | 17 ++- .../circular-reference.js | 10 +- .../class-root-with-instance-vars-2.js | 38 +++--- .../class-root-with-instance-vars.js | 41 ++++--- .../class-root-with-props.js | 24 ++-- .../class-root-with-refs.js | 32 ++--- .../class-root-with-render-methods.js | 26 ++-- .../class-root-with-state.js | 12 +- test/react/FunctionalComponents/class-root.js | 24 ++-- .../FunctionalComponents/clone-element.js | 10 +- .../react/FunctionalComponents/conditional.js | 6 +- .../FunctionalComponents/default-props.js | 23 ++-- .../delete-element-prop-key.js | 8 +- .../FunctionalComponents/do-not-optimize.js | 10 +- .../FunctionalComponents/dynamic-context.js | 28 +++-- .../FunctionalComponents/dynamic-props.js | 6 +- .../FunctionalComponents/dynamic-type.js | 12 +- .../FunctionalComponents/dynamic-type2.js | 12 +- .../FunctionalComponents/dynamic-type3.js | 12 +- .../FunctionalComponents/dynamic-type4.js | 14 +-- .../react/FunctionalComponents/equivalence.js | 22 ++-- .../FunctionalComponents/event-handlers.js | 31 +++-- .../nested-array-children.js | 8 +- test/react/FunctionalComponents/not-safe.js | 2 +- test/react/FunctionalComponents/not-safe2.js | 2 +- test/react/FunctionalComponents/not-safe3.js | 7 +- .../null-or-undefined-props.js | 20 ++-- .../react-element-havoc.js | 12 +- test/react/FunctionalComponents/refs.js | 12 +- test/react/FunctionalComponents/refs2.js | 16 ++- test/react/FunctionalComponents/refs3.js | 14 +-- .../react/FunctionalComponents/return-text.js | 15 +-- .../FunctionalComponents/return-undefined.js | 9 +- .../FunctionalComponents/runtime-error.js | 8 +- test/react/FunctionalComponents/safe.js | 2 +- test/react/FunctionalComponents/safe2.js | 2 +- test/react/FunctionalComponents/safe3.js | 7 +- test/react/FunctionalComponents/safe4.js | 12 +- test/react/FunctionalComponents/simple-10.js | 8 +- test/react/FunctionalComponents/simple-11.js | 8 +- test/react/FunctionalComponents/simple-12.js | 2 +- test/react/FunctionalComponents/simple-13.js | 3 +- test/react/FunctionalComponents/simple-14.js | 11 +- test/react/FunctionalComponents/simple-15.js | 11 +- test/react/FunctionalComponents/simple-16.js | 11 +- test/react/FunctionalComponents/simple-17.js | 10 +- test/react/FunctionalComponents/simple-18.js | 12 +- test/react/FunctionalComponents/simple-19.js | 20 ++-- test/react/FunctionalComponents/simple-2.js | 8 +- test/react/FunctionalComponents/simple-20.js | 22 ++-- test/react/FunctionalComponents/simple-21.js | 18 ++- test/react/FunctionalComponents/simple-3.js | 8 +- test/react/FunctionalComponents/simple-4.js | 8 +- test/react/FunctionalComponents/simple-5.js | 30 ++--- test/react/FunctionalComponents/simple-6.js | 12 +- test/react/FunctionalComponents/simple-7.js | 12 +- test/react/FunctionalComponents/simple-8.js | 8 +- test/react/FunctionalComponents/simple-9.js | 8 +- .../FunctionalComponents/simple-children.js | 12 +- .../FunctionalComponents/simple-fragments.js | 8 +- .../react/FunctionalComponents/simple-refs.js | 14 +-- .../simple-with-abstract-props.js | 14 +-- .../simple-with-new-expression.js | 23 ++-- .../FunctionalComponents/simple-with-unary.js | 12 +- test/react/FunctionalComponents/simple.js | 8 +- test/react/FunctionalComponents/two-roots.js | 2 +- test/react/ReactDOM/create-portal.js | 14 +-- .../Reconciliation/key-change-fragments.js | 36 +++--- test/react/Reconciliation/key-change.js | 36 +++--- test/react/Reconciliation/key-nesting-2.js | 25 ++-- test/react/Reconciliation/key-nesting-3.js | 28 +++-- test/react/Reconciliation/key-nesting.js | 46 +++---- .../key-not-change-fragments.js | 36 +++--- .../Reconciliation/lazy-branched-elements.js | 14 +-- .../Reconciliation/lazy-branched-elements2.js | 10 +- test/react/Reconciliation/type-change.js | 28 ++--- test/react/Reconciliation/type-change10.js | 10 +- test/react/Reconciliation/type-change11.js | 10 +- test/react/Reconciliation/type-change2.js | 16 +-- test/react/Reconciliation/type-change3.js | 10 +- test/react/Reconciliation/type-change4.js | 10 +- test/react/Reconciliation/type-change5.js | 8 +- test/react/Reconciliation/type-change6.js | 8 +- test/react/Reconciliation/type-change7.js | 14 +-- test/react/Reconciliation/type-change8.js | 22 ++-- test/react/Reconciliation/type-change9.js | 10 +- test/react/Reconciliation/type-same.js | 16 +-- test/react/RenderProps/react-context.js | 14 +-- test/react/RenderProps/react-context2.js | 14 +-- test/react/RenderProps/react-context3.js | 28 +++-- test/react/RenderProps/react-context4.js | 14 +-- test/react/RenderProps/react-context5.js | 14 +-- test/react/RenderProps/react-context6.js | 24 ++-- test/react/RenderProps/react-context7.js | 16 +-- test/react/RenderProps/react-root-context.js | 24 ++-- test/react/RenderProps/react-root-context2.js | 14 +-- test/react/RenderProps/react-root-context3.js | 14 +-- test/react/RenderProps/react-root-context4.js | 16 +-- .../react/RenderProps/relay-query-renderer.js | 12 +- .../RenderProps/relay-query-renderer2.js | 12 +- .../RenderProps/relay-query-renderer3.js | 14 +-- test/react/ServerRendering/hacker-news.js | 112 ++++++++--------- test/react/prepareReactTests.js | 15 ++- 187 files changed, 1569 insertions(+), 1583 deletions(-) diff --git a/scripts/prettier.js b/scripts/prettier.js index b128a45053..9459c9700b 100644 --- a/scripts/prettier.js +++ b/scripts/prettier.js @@ -36,7 +36,7 @@ const config = { patterns: ["scripts/**/*.js"], }, jest: { - patterns: ["test/react/**/*-test.js"], + patterns: ["test/react/**/*.js"], }, }; diff --git a/test/react/AssignSpread/simple-assign.js b/test/react/AssignSpread/simple-assign.js index f0c5c7045d..866a017b4e 100644 --- a/test/react/AssignSpread/simple-assign.js +++ b/test/react/AssignSpread/simple-assign.js @@ -1,5 +1,5 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); +this["React"] = React; function A(props) { return
Hello {props.x}
; @@ -16,11 +16,11 @@ function App(props) { App.getTrials = function(renderer, Root) { renderer.update(); - return [['simple render with object assign', renderer.toJSON()]]; + return [["simple render with object assign", renderer.toJSON()]]; }; if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; \ No newline at end of file +module.exports = App; diff --git a/test/react/AssignSpread/simple-assign2.js b/test/react/AssignSpread/simple-assign2.js index 56436ddd35..51ec7eeb14 100644 --- a/test/react/AssignSpread/simple-assign2.js +++ b/test/react/AssignSpread/simple-assign2.js @@ -1,5 +1,5 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); +this["React"] = React; function A(props) { var copyOfProps = Object.assign({}, props.bag); @@ -7,24 +7,26 @@ function A(props) { get() { return 30; }, - }) - return
Hello {copyOfProps.x} {copyOfProps.y}
; + }); + return ( +
+ Hello {copyOfProps.x} {copyOfProps.y} +
+ ); } function App(props) { - var copyOfProps = Object.assign({}, props, {x: 20}); - return ( - - ); + var copyOfProps = Object.assign({}, props, { x: 20 }); + return ; } App.getTrials = function(renderer, Root) { renderer.update(); - return [['simple render with object assign', renderer.toJSON()]]; + return [["simple render with object assign", renderer.toJSON()]]; }; if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; \ No newline at end of file +module.exports = App; diff --git a/test/react/AssignSpread/simple-assign3.js b/test/react/AssignSpread/simple-assign3.js index 893ecbefbc..d192e1755f 100644 --- a/test/react/AssignSpread/simple-assign3.js +++ b/test/react/AssignSpread/simple-assign3.js @@ -1,8 +1,8 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); +this["React"] = React; function App(props) { - var obj1 = Object.assign({}, props, {x: 20}); + var obj1 = Object.assign({}, props, { x: 20 }); var obj2 = Object.assign({}, obj1); return (
@@ -14,11 +14,11 @@ function App(props) { App.getTrials = function(renderer, Root) { renderer.update(); - return [['simple render with object assign', renderer.toJSON()]]; + return [["simple render with object assign", renderer.toJSON()]]; }; if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; \ No newline at end of file +module.exports = App; diff --git a/test/react/AssignSpread/simple-assign4.js b/test/react/AssignSpread/simple-assign4.js index c16102a9ff..4961b1369e 100644 --- a/test/react/AssignSpread/simple-assign4.js +++ b/test/react/AssignSpread/simple-assign4.js @@ -1,22 +1,18 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); +this["React"] = React; function App(props) { - var obj = Object.assign({}, {x: 20}, props); - return ( -
- {obj.x} -
- ); + var obj = Object.assign({}, { x: 20 }, props); + return
{obj.x}
; } App.getTrials = function(renderer, Root) { renderer.update(); - return [['simple render with object assign', renderer.toJSON()]]; + return [["simple render with object assign", renderer.toJSON()]]; }; if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; \ No newline at end of file +module.exports = App; diff --git a/test/react/AssignSpread/simple-assign5.js b/test/react/AssignSpread/simple-assign5.js index 01aa8e8f14..3559175ed5 100644 --- a/test/react/AssignSpread/simple-assign5.js +++ b/test/react/AssignSpread/simple-assign5.js @@ -1,10 +1,10 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); +this["React"] = React; function App(props) { var obj1 = {}; var obj2 = {}; - Object.assign(obj1, props, obj2, {x: 20}); + Object.assign(obj1, props, obj2, { x: 20 }); obj2.foo = 2; return (
@@ -16,11 +16,11 @@ function App(props) { App.getTrials = function(renderer, Root) { renderer.update(); - return [['simple render with object assign', renderer.toJSON()]]; + return [["simple render with object assign", renderer.toJSON()]]; }; if (this.__optimizeReactComponentTree) { __optimizeReactComponentTree(App); } -module.exports = App; \ No newline at end of file +module.exports = App; diff --git a/test/react/AssignSpread/simple-with-jsx-spread.js b/test/react/AssignSpread/simple-with-jsx-spread.js index 2f8ad2e215..6ece7b6412 100644 --- a/test/react/AssignSpread/simple-with-jsx-spread.js +++ b/test/react/AssignSpread/simple-with-jsx-spread.js @@ -1,30 +1,34 @@ -var React = require('react'); +var React = require("react"); // the JSX transform converts to React, so we need to add it back in -this['React'] = React; +this["React"] = React; function IWantThisToBeInlined(props) { - return
{props.text} {props.name} {props.id}
+ return ( +
+ {props.text} {props.name} {props.id} +
+ ); } function Button(props) { - return props.switch ? : null + return props.switch ? : null; } Button.defaultProps = { - name: "Dominic", + name: "Dominic", }; function App(props) { - return