Skip to content

Commit fa973be

Browse files
authored
Drop Haste (#11303)
* Use relative paths in packages/react * Use relative paths in packages/react-art * Use relative paths in packages/react-cs * Use relative paths in other packages * Fix as many issues as I can This uncovered an interesting problem where ./b from package/src/a would resolve to a different instantiation of package/src/b in Jest. Either this is a showstopper or we can solve it by completely fobbidding remaining /src/. * Fix all tests It seems we can't use relative requires in tests anymore. Otherwise Jest becomes confused between real file and symlink. jestjs/jest#3830 This seems bad... Except that we already *don't* want people to create tests that import individual source files. All existing cases of us doing so are actually TODOs waiting to be fixed. So perhaps this requirement isn't too bad because it makes bad code looks bad. Of course, if we go with this, we'll have to lint against relative requires in tests. It also makes moving things more painful. * Prettier * Remove @providesModule * Fix remaining Haste imports I missed earlier * Fix up paths to reflect new flat structure * Fix Flow * Fix CJS and UMD builds * Fix FB bundles * Fix RN bundles * Prettier * Fix lint * Fix warning printing and error codes * Fix buggy return * Fix lint and Flow * Use Yarn on CI * Unbreak Jest * Fix lint * Fix aliased originals getting included in DEV Shouldn't affect correctness (they were ignored) but fixes DEV size regression. * Record sizes * Fix weird version in package.json * Tweak bundle labels * Get rid of output option by introducing react-dom/server.node * Reconciler should depend on prop-types * Update sizes last time
1 parent edf86be commit fa973be

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ReactShallowRenderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const React = require('react');
1414
const emptyObject = require('fbjs/lib/emptyObject');
1515
const invariant = require('fbjs/lib/invariant');
1616

17-
const describeComponentFrame = require('describeComponentFrame');
18-
const getComponentName = require('getComponentName');
17+
const describeComponentFrame = require('shared/describeComponentFrame');
18+
const getComponentName = require('shared/getComponentName');
1919

2020
class ReactShallowRenderer {
2121
static createRenderer = function() {

src/ReactTestRenderer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
'use strict';
1111

1212
var ReactFiberReconciler = require('react-reconciler');
13-
var ReactFiberTreeReflection = require('ReactFiberTreeReflection');
14-
var ReactGenericBatching = require('ReactGenericBatching');
13+
var ReactFiberTreeReflection = require('shared/ReactFiberTreeReflection');
14+
var ReactGenericBatching = require('events/ReactGenericBatching');
1515
var emptyObject = require('fbjs/lib/emptyObject');
16-
var ReactTypeOfWork = require('ReactTypeOfWork');
16+
var ReactTypeOfWork = require('shared/ReactTypeOfWork');
1717
var invariant = require('fbjs/lib/invariant');
1818
var {
1919
Fragment,
@@ -24,8 +24,8 @@ var {
2424
HostRoot,
2525
} = ReactTypeOfWork;
2626

27-
import type {Fiber} from 'ReactFiber';
28-
import type {FiberRoot} from 'ReactFiberRoot';
27+
import type {Fiber} from 'react-reconciler/src/ReactFiber';
28+
import type {FiberRoot} from 'react-reconciler/src/ReactFiberRoot';
2929

3030
type TestRendererOptions = {
3131
createNodeMock: (element: React$Element<any>) => any,

0 commit comments

Comments
 (0)