diff --git a/fb-www/README.md b/fb-www/README.md index a5de468680..e97ad7d1d3 100644 --- a/fb-www/README.md +++ b/fb-www/README.md @@ -81,46 +81,32 @@ To enter a watching mode, run `yarn test-react --watch`. This will re-run them o If you’re debugging a specific test case, the easiest way to focus on it is to: -* Open `scripts/test-react.js`. +* Open `test/react/SomeTestFileName-test.js`. * Find the test in the code by searching for its filename. For example, you may find something like: ```js - it("fb-www 5", async () => { - await runTest(directory, "fb5.js"); + it("fb-www 5", () => { + runTest(directory, "fb5.js"); }); ``` * Change `it` to `fit` to “focus” on a specific test and skip all other tests. ```diff - - it("fb-www 5", async () => { - + fit("fb-www 5", async () => { - await runTest(directory, "fb5.js"); + - it("fb-www 5", () => { + + fit("fb-www 5", () => { + runTest(directory, "fb5.js"); }); ``` -* Run the watch mode: `yarn test-react --watch` +* Run the watch mode: `yarn test-react --watch SomeTestFileName` Now only this test alone will re-run on every change which should help debug problems faster. -By default, tests run in four different input/output configurations. If too many runs are confusing when debugging a problem, you can comment out all modes except one [at the very bottom of the test file](https://github.com/facebook/prepack/blob/30876d5becade1dad7319682a075b6df252341a2/scripts/test-react.js#L748-L753). +By default, tests run in four different input/output configurations. If too many runs are confusing when debugging a problem, you can run a subset with `yarn test-react-fast --watch SomeFileName`. Unlike `yarn test-react`, `yarn test-react-fast` skips checking that JSX syntax works. This mode is much faster but you will see some annoying messages about obsolete snapshots (which you should ignore in this mode). -For example: - -```diff -// pre non-transpiled -runTestSuite(true, false); --runTestSuite(false, false); -+// runTestSuite(false, false); -// pre transpiled --runTestSuite(true, true); -+ // runTestSuite(true, true); --runTestSuite(false, true); -+ // runTestSuite(false, true); -``` - -Finally, sometimes it’s helpful to see the code Prepack is emitting. Search for a [variable called `transformedSource`](https://github.com/facebook/prepack/blob/30876d5becade1dad7319682a075b6df252341a2/scripts/test-react.js#L115) in the test file. +Finally, sometimes it’s helpful to see the code Prepack is emitting. Search for a variable called `transformedSource` a file called `setupReactTests.js`. If you add `console.log(transformedSource)` you will see the Prepack output during test runs. Don’t forget to revert any such changes before committing! diff --git a/package.json b/package.json index d32c955e34..68a772b832 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "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-fast": "SKIP_REACT_JSX_TESTS=true 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", @@ -97,7 +98,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", @@ -126,8 +127,12 @@ "license": "BSD-3-Clause", "author": "Facebook", "jest": { + "roots": [ + "/lib/", + "/test/react/" + ], "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..9459c9700b 100644 --- a/scripts/prettier.js +++ b/scripts/prettier.js @@ -35,6 +35,9 @@ const config = { scripts: { patterns: ["scripts/**/*.js"], }, + jest: { + patterns: ["test/react/**/*.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/AssignSpread-test.js b/test/react/AssignSpread-test.js new file mode 100644 index 0000000000..57a6f20e60 --- /dev/null +++ b/test/react/AssignSpread-test.js @@ -0,0 +1,97 @@ +/** + * 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 setupReactTests = require("./setupReactTests"); +const { runTest } = setupReactTests(); + +/* eslint-disable no-undef */ +const { expect, it } = global; + +it("Unsafe spread", () => { + runTest(__dirname + "/AssignSpread/unsafe-spread.js", { + expectReconcilerError: true, + // Don't attempt to recover even from PP0025. + shouldRecover: () => false, + }); +}); + +it("Simple with multiple JSX spreads", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread.js"); +}); + +it("Simple with multiple JSX spreads #2", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread2.js"); +}); + +it("Simple with multiple JSX spreads #3", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread3.js"); +}); + +it("Simple with multiple JSX spreads #4", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread4.js"); +}); + +it("Simple with multiple JSX spreads #5", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread5.js"); +}); + +it("Simple with multiple JSX spreads #6", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread6.js"); +}); + +it("Simple with multiple JSX spreads #7", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread7.js"); +}); + +it("Simple with multiple JSX spreads #8", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread8.js"); +}); + +it("Simple with multiple JSX spreads #9", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread9.js"); +}); + +it("Simple with multiple JSX spreads #10", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread10.js"); +}); + +it("Simple with multiple JSX spreads #11", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread11.js"); +}); + +it("Simple with multiple JSX spreads #12", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread12.js"); +}); + +it("Simple with multiple JSX spreads #13", () => { + runTest(__dirname + "/AssignSpread/simple-with-jsx-spread13.js"); +}); + +it("Simple with Object.assign", () => { + runTest(__dirname + "/AssignSpread/simple-assign.js"); +}); + +it("Simple with Object.assign #2", () => { + runTest(__dirname + "/AssignSpread/simple-assign2.js"); +}); + +it("Simple with Object.assign #3", () => { + runTest(__dirname + "/AssignSpread/simple-assign3.js"); +}); + +it("Simple with Object.assign #4", () => { + runTest(__dirname + "/AssignSpread/simple-assign4.js"); +}); + +it("Simple with Object.assign #5", () => { + runTest(__dirname + "/AssignSpread/simple-assign5.js"); +}); diff --git a/test/react/functional-components/simple-assign.js b/test/react/AssignSpread/simple-assign.js similarity index 72% rename from test/react/functional-components/simple-assign.js rename to test/react/AssignSpread/simple-assign.js index f0c5c7045d..be4af189a9 100644 --- a/test/react/functional-components/simple-assign.js +++ b/test/react/AssignSpread/simple-assign.js @@ -1,5 +1,4 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); function A(props) { return
Hello {props.x}
; @@ -16,11 +15,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/functional-components/simple-assign2.js b/test/react/AssignSpread/simple-assign2.js similarity index 56% rename from test/react/functional-components/simple-assign2.js rename to test/react/AssignSpread/simple-assign2.js index 56436ddd35..83f867496f 100644 --- a/test/react/functional-components/simple-assign2.js +++ b/test/react/AssignSpread/simple-assign2.js @@ -1,5 +1,4 @@ -var React = require('react'); -this['React'] = React; +var React = require("react"); function A(props) { var copyOfProps = Object.assign({}, props.bag); @@ -7,24 +6,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/functional-components/simple-assign3.js b/test/react/AssignSpread/simple-assign3.js similarity index 61% rename from test/react/functional-components/simple-assign3.js rename to test/react/AssignSpread/simple-assign3.js index 893ecbefbc..d6f3c75371 100644 --- a/test/react/functional-components/simple-assign3.js +++ b/test/react/AssignSpread/simple-assign3.js @@ -1,8 +1,7 @@ -var React = require('react'); -this['React'] = React; +var React = require("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 +13,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 new file mode 100644 index 0000000000..b70e5e0e66 --- /dev/null +++ b/test/react/AssignSpread/simple-assign4.js @@ -0,0 +1,17 @@ +var React = require("react"); + +function App(props) { + 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()]]; +}; + +if (this.__optimizeReactComponentTree) { + __optimizeReactComponentTree(App); +} + +module.exports = App; diff --git a/test/react/functional-components/simple-assign5.js b/test/react/AssignSpread/simple-assign5.js similarity index 63% rename from test/react/functional-components/simple-assign5.js rename to test/react/AssignSpread/simple-assign5.js index 01aa8e8f14..d8a09822a4 100644 --- a/test/react/functional-components/simple-assign5.js +++ b/test/react/AssignSpread/simple-assign5.js @@ -1,10 +1,9 @@ -var React = require('react'); -this['React'] = React; +var React = require("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 +15,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/functional-components/simple-with-jsx-spread.js b/test/react/AssignSpread/simple-with-jsx-spread.js similarity index 61% rename from test/react/functional-components/simple-with-jsx-spread.js rename to test/react/AssignSpread/simple-with-jsx-spread.js index 2f8ad2e215..39d077ae59 100644 --- a/test/react/functional-components/simple-with-jsx-spread.js +++ b/test/react/AssignSpread/simple-with-jsx-spread.js @@ -1,30 +1,32 @@ -var React = require('react'); -// the JSX transform converts to React, so we need to add it back in -this['React'] = React; +var React = require("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