@samitouri / QOS-React / commits / 8e876d244c

Move ReactFiberTreeReflection to react-reconciler/reflection (#11683)

* Move ReactFiberTreeReflection to react-reconciler/reflection #11659 * Use * for react-reconciler We don't know the latest local version, and release script currently doesn't bump deps automatically. * Remove unused field * Use CommonJS in entry point for consistency * Undo the CommonJS change I didn't realize it would break the build. * Record sizes * Remove reconciler fixtures They're unnecessary now that we run real tests on reconciler bundles.

rivenhk committed Nov 29, 2017 at 00:57 UTC 8e876d244cbfd0cf150db7a372f0908cd0ce1a8d
22 files changed +58 -536
fixtures/reconciler/README.md deleted
-14
@@ -1,14 +0,0 @@
1 -# React Reconciler Test Fixture
2 -
3 -This folder exists for **React contributors** only.
4 -If you use React you don't need to worry about it.
5 -
6 -These fixtures are a smoke-screen verification that the built React Reconciler distribution works.
7 -
8 -To test, from the project root:
9 -* `yarn build`
10 -* `cd fixtures/reconciler`
11 -* `yarn`
12 -* `yarn test`
13 -
14 -They should run as part of the CI check.
fixtures/reconciler/index.js deleted
-371
@@ -1,371 +0,0 @@
1 -/**
2 - * This is a renderer of React that doesn't have a render target output.
3 - * It is used to test that the react-reconciler package doesn't blow up.
4 - *
5 - * @flow
6 - */
7 -'use strict';
8 -
9 -var React = require('react');
10 -var assert = require('assert');
11 -var ReactFiberReconciler = require('react-reconciler');
12 -var emptyObject = require('fbjs/lib/emptyObject');
13 -var assert = require('assert');
14 -
15 -const UPDATE_SIGNAL = {};
16 -
17 -var scheduledCallback = null;
18 -
19 -type Container = {rootID: string, children: Array<Instance | TextInstance>};
20 -type Props = {prop: any, hidden?: boolean};
21 -type Instance = {|
22 - type: string,
23 - id: number,
24 - children: Array<Instance | TextInstance>,
25 - prop: any,
26 -|};
27 -type TextInstance = {|text: string, id: number|};
28 -
29 -var instanceCounter = 0;
30 -
31 -function appendChild(
32 - parentInstance: Instance | Container,
33 - child: Instance | TextInstance
34 -): void {
35 - const index = parentInstance.children.indexOf(child);
36 - if (index !== -1) {
37 - parentInstance.children.splice(index, 1);
38 - }
39 - parentInstance.children.push(child);
40 -}
41 -
42 -function insertBefore(
43 - parentInstance: Instance | Container,
44 - child: Instance | TextInstance,
45 - beforeChild: Instance | TextInstance
46 -): void {
47 - const index = parentInstance.children.indexOf(child);
48 - if (index !== -1) {
49 - parentInstance.children.splice(index, 1);
50 - }
51 - const beforeIndex = parentInstance.children.indexOf(beforeChild);
52 - if (beforeIndex === -1) {
53 - throw new Error('This child does not exist.');
54 - }
55 - parentInstance.children.splice(beforeIndex, 0, child);
56 -}
57 -
58 -function removeChild(
59 - parentInstance: Instance | Container,
60 - child: Instance | TextInstance
61 -): void {
62 - const index = parentInstance.children.indexOf(child);
63 - if (index === -1) {
64 - throw new Error('This child does not exist.');
65 - }
66 - parentInstance.children.splice(index, 1);
67 -}
68 -
69 -var NoopRenderer = ReactFiberReconciler({
70 - getRootHostContext() {
71 - return emptyObject;
72 - },
73 -
74 - getChildHostContext() {
75 - return emptyObject;
76 - },
77 -
78 - getPublicInstance(instance) {
79 - return instance;
80 - },
81 -
82 - createInstance(type: string, props: Props): Instance {
83 - const inst = {
84 - id: instanceCounter++,
85 - type: type,
86 - children: [],
87 - prop: props.prop,
88 - };
89 - // Hide from unit tests
90 - Object.defineProperty(inst, 'id', {value: inst.id, enumerable: false});
91 - return inst;
92 - },
93 -
94 - appendInitialChild(
95 - parentInstance: Instance,
96 - child: Instance | TextInstance
97 - ): void {
98 - parentInstance.children.push(child);
99 - },
100 -
101 - finalizeInitialChildren(
102 - domElement: Instance,
103 - type: string,
104 - props: Props
105 - ): boolean {
106 - return false;
107 - },
108 -
109 - prepareUpdate(
110 - instance: Instance,
111 - type: string,
112 - oldProps: Props,
113 - newProps: Props
114 - ): null | {} {
115 - return UPDATE_SIGNAL;
116 - },
117 -
118 - shouldSetTextContent(type: string, props: Props): boolean {
119 - return (
120 - typeof props.children === 'string' || typeof props.children === 'number'
121 - );
122 - },
123 -
124 - shouldDeprioritizeSubtree(type: string, props: Props): boolean {
125 - return !!props.hidden;
126 - },
127 -
128 - now: Date.now,
129 -
130 - createTextInstance(
131 - text: string,
132 - rootContainerInstance: Container,
133 - hostContext: Object,
134 - internalInstanceHandle: Object
135 - ): TextInstance {
136 - var inst = {text: text, id: instanceCounter++};
137 - // Hide from unit tests
138 - Object.defineProperty(inst, 'id', {value: inst.id, enumerable: false});
139 - return inst;
140 - },
141 -
142 - scheduleDeferredCallback(callback) {
143 - if (scheduledCallback) {
144 - throw new Error(
145 - 'Scheduling a callback twice is excessive. Instead, keep track of ' +
146 - 'whether the callback has already been scheduled.'
147 - );
148 - }
149 - scheduledCallback = callback;
150 - },
151 -
152 - prepareForCommit(): void {},
153 -
154 - resetAfterCommit(): void {},
155 -
156 - mutation: {
157 - commitMount(instance: Instance, type: string, newProps: Props): void {
158 - // Noop
159 - },
160 -
161 - commitUpdate(
162 - instance: Instance,
163 - updatePayload: Object,
164 - type: string,
165 - oldProps: Props,
166 - newProps: Props
167 - ): void {
168 - instance.prop = newProps.prop;
169 - },
170 -
171 - commitTextUpdate(
172 - textInstance: TextInstance,
173 - oldText: string,
174 - newText: string
175 - ): void {
176 - textInstance.text = newText;
177 - },
178 -
179 - appendChild: appendChild,
180 - appendChildToContainer: appendChild,
181 - insertBefore: insertBefore,
182 - insertInContainerBefore: insertBefore,
183 - removeChild: removeChild,
184 - removeChildFromContainer: removeChild,
185 -
186 - resetTextContent(instance: Instance): void {},
187 - },
188 -});
189 -
190 -var rootContainers = new Map();
191 -var roots = new Map();
192 -var DEFAULT_ROOT_ID = '<default>';
193 -
194 -let yieldedValues = null;
195 -
196 -function* flushUnitsOfWork(n: number): Generator<Array<mixed>, void, void> {
197 - var didStop = false;
198 - while (!didStop && scheduledCallback !== null) {
199 - var cb = scheduledCallback;
200 - scheduledCallback = null;
201 - yieldedValues = null;
202 - var unitsRemaining = n;
203 - cb({
204 - timeRemaining() {
205 - if (yieldedValues !== null) {
206 - return 0;
207 - }
208 - if (unitsRemaining-- > 0) {
209 - return 999;
210 - }
211 - didStop = true;
212 - return 0;
213 - },
214 - });
215 -
216 - if (yieldedValues !== null) {
217 - const values = yieldedValues;
218 - yieldedValues = null;
219 - yield values;
220 - }
221 - }
222 -}
223 -
224 -var Noop = {
225 - getChildren(rootID: string = DEFAULT_ROOT_ID) {
226 - const container = rootContainers.get(rootID);
227 - if (container) {
228 - return container.children;
229 - } else {
230 - return null;
231 - }
232 - },
233 -
234 - // Shortcut for testing a single root
235 - render(element: React$Element<any>, callback: ?Function) {
236 - Noop.renderToRootWithID(element, DEFAULT_ROOT_ID, callback);
237 - },
238 -
239 - renderToRootWithID(
240 - element: React$Element<any>,
241 - rootID: string,
242 - callback: ?Function
243 - ) {
244 - let root = roots.get(rootID);
245 - if (!root) {
246 - const container = {rootID: rootID, children: []};
247 - rootContainers.set(rootID, container);
248 - root = NoopRenderer.createContainer(container);
249 - roots.set(rootID, root);
250 - }
251 - NoopRenderer.updateContainer(element, root, null, callback);
252 - },
253 -
254 - flush(): Array<mixed> {
255 - return Noop.flushUnitsOfWork(Infinity);
256 - },
257 -
258 - flushUnitsOfWork(n: number): Array<mixed> {
259 - let values = [];
260 - for (const value of flushUnitsOfWork(n)) {
261 - values.push(...value);
262 - }
263 - return values;
264 - },
265 -
266 - batchedUpdates: NoopRenderer.batchedUpdates,
267 -
268 - deferredUpdates: NoopRenderer.deferredUpdates,
269 -
270 - unbatchedUpdates: NoopRenderer.unbatchedUpdates,
271 -
272 - flushSync: NoopRenderer.flushSync,
273 -};
274 -
275 -type TestProps = {|
276 - active: boolean,
277 -|};
278 -type TestState = {|
279 - counter: number,
280 -|};
281 -
282 -let instance = null;
283 -class Test extends React.Component<TestProps, TestState> {
284 - state = {counter: 0};
285 - increment() {
286 - this.setState(({counter}) => ({
287 - counter: counter + 1,
288 - }));
289 - }
290 - render() {
291 - return [this.props.active ? 'Active' : 'Inactive', this.state.counter];
292 - }
293 -}
294 -const Children = props => props.children;
295 -Noop.render(
296 - <main>
297 - <div>Hello</div>
298 - <Children>
299 - Hello world
300 - <span>
301 - {'Number '}
302 - {42}
303 - </span>
304 - <Test active={true} ref={t => (instance = t)} />
305 - </Children>
306 - </main>
307 -);
308 -Noop.flush();
309 -const actual1 = Noop.getChildren();
310 -const expected1 = [
311 - {
312 - type: 'main',
313 - children: [
314 - {type: 'div', children: [], prop: undefined},
315 - {text: 'Hello world'},
316 - {
317 - type: 'span',
318 - children: [{text: 'Number '}, {text: '42'}],
319 - prop: undefined,
320 - },
321 - {text: 'Active'},
322 - {text: '0'},
323 - ],
324 - prop: undefined,
325 - },
326 -];
327 -assert.deepEqual(
328 - actual1,
329 - expected1,
330 - 'Error. Noop.getChildren() returned unexpected value.\nExpected: ' +
331 - JSON.stringify(expected1, null, 2) +
332 - '\n\nActual:\n ' +
333 - JSON.stringify(actual1, null, 2)
334 -);
335 -
336 -if (instance === null) {
337 - throw new Error('Expected instance to exist.');
338 -}
339 -
340 -instance.increment();
341 -Noop.flush();
342 -const actual2 = Noop.getChildren();
343 -const expected2 = [
344 - {
345 - type: 'main',
346 - children: [
347 - {type: 'div', children: [], prop: undefined},
348 - {text: 'Hello world'},
349 - {
350 - type: 'span',
351 - children: [{text: 'Number '}, {text: '42'}],
352 - prop: undefined,
353 - },
354 - {text: 'Active'},
355 - {text: '1'},
356 - ],
357 - prop: undefined,
358 - },
359 -];
360 -assert.deepEqual(
361 - actual2,
362 - expected2,
363 - 'Error. Noop.getChildren() returned unexpected value.\nExpected: ' +
364 - JSON.stringify(expected2, null, 2) +
365 - '\n\nActual:\n ' +
366 - JSON.stringify(actual2, null, 2)
367 -);
368 -
369 -const beginGreen = '\u001b[32m';
370 -const endGreen = '\u001b[39m';
371 -console.log(beginGreen + 'Reconciler package is OK!' + endGreen);
fixtures/reconciler/package.json deleted
-14
@@ -1,14 +0,0 @@
1 -{
2 - "name": "react-fixtures",
3 - "version": "0.1.0",
4 - "private": true,
5 - "dependencies": {
6 - "react": "file:../../build/packages/react",
7 - "react-reconciler": "file:../../build/packages/react-reconciler"
8 - },
9 - "scripts": {
10 - "test:dev": "../../node_modules/.bin/babel-node ./index",
11 - "test:prod": "NODE_ENV=production ../../node_modules/.bin/babel-node ./index",
12 - "test": "npm run test:dev && npm run test:prod"
13 - }
14 -}
fixtures/reconciler/yarn.lock deleted
-106
@@ -1,106 +0,0 @@
1 -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 -# yarn lockfile v1
3 -
4 -
5 -asap@~2.0.3:
6 - version "2.0.6"
7 - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
8 -
9 -core-js@^1.0.0:
10 - version "1.2.7"
11 - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
12 -
13 -encoding@^0.1.11:
14 - version "0.1.12"
15 - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
16 - dependencies:
17 - iconv-lite "~0.4.13"
18 -
19 -fbjs@^0.8.16:
20 - version "0.8.16"
21 - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
22 - dependencies:
23 - core-js "^1.0.0"
24 - isomorphic-fetch "^2.1.1"
25 - loose-envify "^1.0.0"
26 - object-assign "^4.1.0"
27 - promise "^7.1.1"
28 - setimmediate "^1.0.5"
29 - ua-parser-js "^0.7.9"
30 -
31 -iconv-lite@~0.4.13:
32 - version "0.4.19"
33 - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
34 -
35 -is-stream@^1.0.1:
36 - version "1.1.0"
37 - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
38 -
39 -isomorphic-fetch@^2.1.1:
40 - version "2.2.1"
41 - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
42 - dependencies:
43 - node-fetch "^1.0.1"
44 - whatwg-fetch ">=0.10.0"
45 -
46 -js-tokens@^3.0.0:
47 - version "3.0.2"
48 - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
49 -
50 -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
51 - version "1.3.1"
52 - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
53 - dependencies:
54 - js-tokens "^3.0.0"
55 -
56 -node-fetch@^1.0.1:
57 - version "1.7.3"
58 - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
59 - dependencies:
60 - encoding "^0.1.11"
61 - is-stream "^1.0.1"
62 -
63 -object-assign@^4.1.0, object-assign@^4.1.1:
64 - version "4.1.1"
65 - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
66 -
67 -promise@^7.1.1:
68 - version "7.3.1"
69 - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
70 - dependencies:
71 - asap "~2.0.3"
72 -
73 -prop-types@^15.6.0:
74 - version "15.6.0"
75 - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
76 - dependencies:
77 - fbjs "^0.8.16"
78 - loose-envify "^1.3.1"
79 - object-assign "^4.1.1"
80 -
81 -"react-reconciler@file:../../build/packages/react-reconciler":
82 - version "0.1.0"
83 - dependencies:
84 - fbjs "^0.8.16"
85 - loose-envify "^1.1.0"
86 - object-assign "^4.1.1"
87 -
88 -"react@file:../../build/packages/react":
89 - version "16.0.0"
90 - dependencies:
91 - fbjs "^0.8.16"
92 - loose-envify "^1.1.0"
93 - object-assign "^4.1.1"
94 - prop-types "^15.6.0"
95 -
96 -setimmediate@^1.0.5:
97 - version "1.0.5"
98 - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
99 -
100 -ua-parser-js@^0.7.9:
101 - version "0.7.17"
102 - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
103 -
104 -whatwg-fetch@>=0.10.0:
105 - version "2.0.3"
106 - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
packages/react-dom/src/client/ReactDOMFB.js
+1 -1
@@ -7,7 +7,7 @@
7 * @flow
8 */
9
10 -import * as ReactFiberTreeReflection from 'shared/ReactFiberTreeReflection';
10 +import * as ReactFiberTreeReflection from 'react-reconciler/reflection';
11 import * as ReactInstanceMap from 'shared/ReactInstanceMap';
12 // TODO: direct imports like some-package/src/* are bad. Fix me.
13 import * as ReactFiberErrorLogger from 'react-reconciler/src/ReactFiberErrorLogger';
packages/react-dom/src/events/ReactDOMEventListener.js
+1 -1
@@ -6,7 +6,7 @@
6 */
7
8 import {batchedUpdates} from 'events/ReactGenericBatching';
9 -import {isFiberMounted} from 'shared/ReactFiberTreeReflection';
9 +import {isFiberMounted} from 'react-reconciler/reflection';
10 import {HostRoot} from 'shared/ReactTypeOfWork';
11 import EventListener from 'fbjs/lib/EventListener';
12
packages/react-dom/src/test-utils/ReactTestUtils.js
+1 -1
@@ -7,7 +7,7 @@
7
8 import React from 'react';
9 import ReactDOM from 'react-dom';
10 -import {findCurrentFiberUsingSlowPath} from 'shared/ReactFiberTreeReflection';
10 +import {findCurrentFiberUsingSlowPath} from 'react-reconciler/reflection';
11 import * as ReactInstanceMap from 'shared/ReactInstanceMap';
12 import {
13 ClassComponent,
packages/react-native-renderer/src/ReactNativeFiberInspector.js
+1 -1
@@ -12,7 +12,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
12 import {
13 findCurrentHostFiber,
14 findCurrentFiberUsingSlowPath,
15 -} from 'shared/ReactFiberTreeReflection';
15 +} from 'react-reconciler/reflection';
16 import getComponentName from 'shared/getComponentName';
17 import {HostComponent} from 'shared/ReactTypeOfWork';
18 import emptyObject from 'fbjs/lib/emptyObject';
packages/react-noop-renderer/package.json
+2 -1
@@ -10,7 +10,8 @@
10 "fbjs": "^0.8.16",
11 "object-assign": "^4.1.1",
12 "prop-types": "^15.6.0",
13 - "regenerator-runtime": "^0.11.0"
13 + "regenerator-runtime": "^0.11.0",
14 + "react-reconciler": "*"
15 },
16 "peerDependencies": {
17 "react": "^16.0.0"
packages/react-noop-renderer/src/ReactNoop.js
-7
@@ -17,8 +17,6 @@
17 import type {Fiber} from 'react-reconciler/src/ReactFiber';
18 import type {UpdateQueue} from 'react-reconciler/src/ReactFiberUpdateQueue';
19
20 -// TODO: direct imports like some-package/src/* are bad. Fix me.
21 -import ReactFiberInstrumentation from 'react-reconciler/src/ReactFiberInstrumentation';
20 import ReactFiberReconciler from 'react-reconciler';
21 import {enablePersistentReconciler} from 'shared/ReactFeatureFlags';
22 import * as ReactInstanceMap from 'shared/ReactInstanceMap';
@@ -565,11 +563,6 @@ var ReactNoop = {
563 failInBeginPhase = false;
564 }
565 },
568 -
569 - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
570 - // Private. Used only by fixtures/fiber-debugger.
571 - ReactFiberInstrumentation,
572 - },
566 };
567
568 export default ReactNoop;
packages/react-reconciler/npm/reflection.js new
+7
@@ -0,0 +1,7 @@
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/react-reconciler-reflection.production.min.js');
5 +} else {
6 + module.exports = require('./cjs/react-reconciler-reflection.development.js');
7 +}
packages/react-reconciler/package.json
+1
@@ -12,6 +12,7 @@
12 "LICENSE",
13 "README.md",
14 "index.js",
15 + "reflection.js",
16 "cjs/"
17 ],
18 "main": "index.js",
packages/react-reconciler/reflection.js new
+12
@@ -0,0 +1,12 @@
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + *
7 + * @flow
8 + */
9 +
10 +'use strict';
11 +
12 +export * from './src/ReactFiberTreeReflection';
packages/react-reconciler/src/ReactFiberClassComponent.js
+1 -1
@@ -15,7 +15,7 @@ import {
15 debugRenderPhaseSideEffects,
16 enableAsyncSubtreeAPI,
17 } from 'shared/ReactFeatureFlags';
18 -import {isMounted} from 'shared/ReactFiberTreeReflection';
18 +import {isMounted} from 'react-reconciler/reflection';
19 import * as ReactInstanceMap from 'shared/ReactInstanceMap';
20 import emptyObject from 'fbjs/lib/emptyObject';
21 import getComponentName from 'shared/getComponentName';
packages/react-reconciler/src/ReactFiberContext.js
+1 -1
@@ -10,7 +10,7 @@
10 import type {Fiber} from './ReactFiber';
11 import type {StackCursor} from './ReactFiberStack';
12
13 -import {isFiberMounted} from 'shared/ReactFiberTreeReflection';
13 +import {isFiberMounted} from 'react-reconciler/reflection';
14 import {ClassComponent, HostRoot} from 'shared/ReactTypeOfWork';
15 import getComponentName from 'shared/getComponentName';
16 import emptyObject from 'fbjs/lib/emptyObject';
packages/react-reconciler/src/ReactFiberReconciler.js
+1 -1
@@ -15,7 +15,7 @@ import {enableAsyncSubtreeAPI} from 'shared/ReactFeatureFlags';
15 import {
16 findCurrentHostFiber,
17 findCurrentHostFiberWithNoPortals,
18 -} from 'shared/ReactFiberTreeReflection';
18 +} from 'react-reconciler/reflection';
19 import * as ReactInstanceMap from 'shared/ReactInstanceMap';
20 import {HostComponent} from 'shared/ReactTypeOfWork';
21 import emptyObject from 'fbjs/lib/emptyObject';
packages/react-reconciler/src/ReactFiberTreeReflection.js renamed
+5 -5
@@ -12,17 +12,17 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
12 import invariant from 'fbjs/lib/invariant';
13 import warning from 'fbjs/lib/warning';
14
15 -import * as ReactInstanceMap from './ReactInstanceMap';
16 -import {ReactCurrentOwner} from './ReactGlobalSharedState';
17 -import getComponentName from './getComponentName';
15 +import * as ReactInstanceMap from 'shared/ReactInstanceMap';
16 +import {ReactCurrentOwner} from 'shared/ReactGlobalSharedState';
17 +import getComponentName from 'shared/getComponentName';
18 import {
19 ClassComponent,
20 HostComponent,
21 HostRoot,
22 HostPortal,
23 HostText,
24 -} from './ReactTypeOfWork';
25 -import {NoEffect, Placement} from './ReactTypeOfSideEffect';
24 +} from 'shared/ReactTypeOfWork';
25 +import {NoEffect, Placement} from 'shared/ReactTypeOfSideEffect';
26
27 var MOUNTING = 1;
28 var MOUNTED = 2;
packages/react-rt-renderer/src/ReactNativeRTFiberInspector.js
+1 -1
@@ -10,7 +10,7 @@
10 import {
11 findCurrentFiberUsingSlowPath,
12 findCurrentHostFiber,
13 -} from 'shared/ReactFiberTreeReflection';
13 +} from 'react-reconciler/reflection';
14 import getComponentName from 'shared/getComponentName';
15 import {HostComponent} from 'shared/ReactTypeOfWork';
16 import emptyObject from 'fbjs/lib/emptyObject';
packages/react-test-renderer/src/ReactTestRenderer.js
+1 -1
@@ -12,7 +12,7 @@ import type {FiberRoot} from 'react-reconciler/src/ReactFiberRoot';
12
13 import ReactFiberReconciler from 'react-reconciler';
14 import {batchedUpdates} from 'events/ReactGenericBatching';
15 -import {findCurrentFiberUsingSlowPath} from 'shared/ReactFiberTreeReflection';
15 +import {findCurrentFiberUsingSlowPath} from 'react-reconciler/reflection';
16 import emptyObject from 'fbjs/lib/emptyObject';
17 import {
18 Fragment,
scripts/circleci/build.sh
-5
@@ -10,8 +10,3 @@ yarn build --extract-errors
10
11 # Do a sanity check on bundles
12 yarn lint-build
13 -
14 -# Check that the standalone reconciler isn't borked
15 -cd fixtures/reconciler
16 -yarn
17 -yarn test
scripts/rollup/bundles.js
+10
@@ -211,6 +211,16 @@ const bundles = [
211 externals: ['react'],
212 },
213
214 + /******* Reflection *******/
215 + {
216 + label: 'reconciler-reflection',
217 + moduleType: RENDERER_UTILS,
218 + bundleTypes: [NODE_DEV, NODE_PROD],
219 + entry: 'react-reconciler/reflection',
220 + global: 'ReactFiberTreeReflection',
221 + externals: [],
222 + },
223 +
224 /******* React Call Return (experimental) *******/
225 {
226 label: 'react-call-return',
scripts/rollup/results.json
+12 -4
@@ -189,8 +189,8 @@
189 "gzip": 2725
190 },
191 "react-noop-renderer.development.js (NODE_DEV)": {
192 - "size": 277788,
193 - "gzip": 58527
192 + "size": 17474,
193 + "gzip": 4855
194 },
195 "react-reconciler.development.js (NODE_DEV)": {
196 "size": 262177,
@@ -217,8 +217,16 @@
217 "gzip": 3917
218 },
219 "react-noop-renderer.production.min.js (NODE_PROD)": {
220 - "size": 45144,
221 - "gzip": 14079
220 + "size": 6011,
221 + "gzip": 2418
222 + },
223 + "react-reconciler-reflection.development.js (NODE_DEV)": {
224 + "size": 10398,
225 + "gzip": 3198
226 + },
227 + "react-reconciler-reflection.production.min.js (NODE_PROD)": {
228 + "size": 2408,
229 + "gzip": 1062
230 }
231 }
232 }
\ No newline at end of file