Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop exposing shallow renderer from TestUtils #10682

Merged
merged 3 commits into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/rollup/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"gzip": 94276
},
"react-dom-test-utils.development.js (NODE_DEV)": {
"size": 53750,
"gzip": 13493
"size": 44954,
"gzip": 11677
},
"ReactTestUtils-dev.js (FB_DEV)": {
"size": 53159,
"gzip": 13402
"size": 44385,
"gzip": 11593
},
"react-dom-unstable-native-dependencies.development.js (UMD_DEV)": {
"size": 88140,
Expand Down
23 changes: 0 additions & 23 deletions src/renderers/dom/test/ReactTestUtilsEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ var React = require('react');
var ReactDOM = require('react-dom');
var ReactFiberTreeReflection = require('ReactFiberTreeReflection');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactShallowRenderer = require('ReactShallowRendererEntry'); // TODO (bvaughn) Remove this import before 16.0.0
var ReactTypeOfWork = require('ReactTypeOfWork');
var SyntheticEvent = require('SyntheticEvent');

var invariant = require('fbjs/lib/invariant');

if (__DEV__) {
var warning = require('fbjs/lib/warning');
}

var {findDOMNode} = ReactDOM;
var {
EventPluginHub,
Expand All @@ -44,20 +39,6 @@ var {
HostText,
} = ReactTypeOfWork;

// TODO (bvaughn) Remove this warning before 16.0.0
// It's only being added for temporary deprecation notice in RN.
let warnedAboutShallowRenderer = false;
function createRendererWithWarning() {
warning(
warnedAboutShallowRenderer,
'Shallow renderer has been moved to react-test-renderer/shallow. ' +
'Update references to remove this warning. ' +
'TestUtils.createRenderer will be removed completely in React 16.',
);
warnedAboutShallowRenderer = true;
return new ReactShallowRenderer();
}

function Event(suffix) {}

/**
Expand Down Expand Up @@ -426,10 +407,6 @@ var ReactTestUtils = {
};
},

// TODO (bvaughn) Remove this warning accessor before 16.0.0.
// It's only being added for temporary deprecation notice in RN.
createRenderer: createRendererWithWarning,

Simulate: null,
SimulateNative: {},
};
Expand Down