Rename 17 to 18 in warnings (#19031)
We're not really supposed to refer to future versions by numbers. These will all slip so these numbers don't make sense anymore.
Sebastian Markbåge committed
May 28, 2020 at 10:25 UTC
4985bb0a80f5cbeaa61d21a7daf7da5ecff2d892
17 files changed
+29
-29
packages/react-dom/index.experimental.js
+1
-1
@@ -27,6 +27,6 @@ export {
27
unstable_renderSubtreeIntoContainer,
28
// Disabled behind disableUnstableCreatePortal
29
// Temporary alias since we already shipped React 16 RC with it.
30
- // TODO: remove in React 17.
30
+ // TODO: remove in React 18.
31
unstable_createPortal,
32
} from './src/client/ReactDOM';
packages/react-dom/index.stable.js
+1
-1
@@ -19,6 +19,6 @@ export {
19
unmountComponentAtNode,
20
unstable_renderSubtreeIntoContainer,
21
// Temporary alias since we already shipped React 16 RC with it.
22
- // TODO: remove in React 17.
22
+ // TODO: remove in React 18.
23
unstable_createPortal,
24
} from './src/client/ReactDOM';
packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
+3
-3
@@ -1386,20 +1386,20 @@ describe('ReactComponentLifeCycle', () => {
1386
`Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
1387
1388
* Move code with side effects to componentDidMount, and set initial state in the constructor.
1389
-* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1389
+* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1390
1391
Please update the following components: MyComponent`,
1392
`Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
1393
1394
* Move data fetching code or side effects to componentDidUpdate.
1395
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
1396
-* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1396
+* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1397
1398
Please update the following components: MyComponent`,
1399
`Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
1400
1401
* Move data fetching code or side effects to componentDidUpdate.
1402
-* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1402
+* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1403
1404
Please update the following components: MyComponent`,
1405
/* eslint-enable max-len */
packages/react-dom/src/__tests__/ReactCompositeComponent-test.js
+1
-1
@@ -196,7 +196,7 @@ describe('ReactCompositeComponent', () => {
196
ReactDOM.render(<Parent />, container),
197
).toWarnDev(
198
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
199
- 'will stop working in React v17. Replace the ReactDOM.render() call ' +
199
+ 'will stop working in React v18. Replace the ReactDOM.render() call ' +
200
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
201
{withoutStack: true},
202
);
packages/react-dom/src/__tests__/ReactDOMFiber-test.js
+2
-2
@@ -246,7 +246,7 @@ describe('ReactDOMFiber', () => {
246
expect(container.innerHTML).toBe('');
247
});
248
249
- // TODO: remove in React 17
249
+ // TODO: remove in React 18
250
if (!__EXPERIMENTAL__) {
251
it('should support unstable_createPortal alias', () => {
252
const portalContainer = document.createElement('div');
@@ -260,7 +260,7 @@ describe('ReactDOMFiber', () => {
260
),
261
).toWarnDev(
262
'The ReactDOM.unstable_createPortal() alias has been deprecated, ' +
263
- 'and will be removed in React 17+. Update your code to use ' +
263
+ 'and will be removed in React 18+. Update your code to use ' +
264
'ReactDOM.createPortal() instead. It has the exact same API, ' +
265
'but without the "unstable_" prefix.',
266
{withoutStack: true},
packages/react-dom/src/__tests__/ReactRenderDocument-test.js
+2
-2
@@ -39,7 +39,7 @@ describe('rendering React components at document', () => {
39
callback,
40
).toWarnDev(
41
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
42
- 'will stop working in React v17. Replace the ReactDOM.render() call ' +
42
+ 'will stop working in React v18. Replace the ReactDOM.render() call ' +
43
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
44
{withoutStack: true},
45
);
@@ -201,7 +201,7 @@ describe('rendering React components at document', () => {
201
ReactDOM.render(<Component text="Hello world" />, testDocument),
202
).toWarnDev(
203
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
204
- 'will stop working in React v17. Replace the ReactDOM.render() call ' +
204
+ 'will stop working in React v18. Replace the ReactDOM.render() call ' +
205
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
206
{withoutStack: true},
207
);
packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js
+1
-1
@@ -83,7 +83,7 @@ describe('ReactDOMServerHydration', () => {
83
instance = ReactDOM.render(<TestComponent name="x" />, element);
84
}).toWarnDev(
85
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
86
- 'will stop working in React v17. Replace the ReactDOM.render() call ' +
86
+ 'will stop working in React v18. Replace the ReactDOM.render() call ' +
87
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
88
{withoutStack: true},
89
);
packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.internal.js
+1
-1
@@ -32,7 +32,7 @@ it('should warn in legacy mode', () => {
32
expect(() => {
33
ReactDOM.render(<App />, document.createElement('div'));
34
}).toErrorDev(
35
- ['Starting from React v17, the "scheduler" module will need to be mocked'],
35
+ ['Starting from React v18, the "scheduler" module will need to be mocked'],
36
{withoutStack: true},
37
);
38
// does not warn twice
packages/react-dom/src/client/ReactDOM.js
+2
-2
@@ -164,7 +164,7 @@ function unstable_createPortal(
164
didWarnAboutUnstableCreatePortal = true;
165
console.warn(
166
'The ReactDOM.unstable_createPortal() alias has been deprecated, ' +
167
- 'and will be removed in React 17+. Update your code to use ' +
167
+ 'and will be removed in React 18+. Update your code to use ' +
168
'ReactDOM.createPortal() instead. It has the exact same API, ' +
169
'but without the "unstable_" prefix.',
170
);
@@ -210,7 +210,7 @@ export {
210
renderSubtreeIntoContainer as unstable_renderSubtreeIntoContainer,
211
// Disabled behind disableUnstableCreatePortal
212
// Temporary alias since we already shipped React 16 RC with it.
213
- // TODO: remove in React 17.
213
+ // TODO: remove in React 18.
214
unstable_createPortal,
215
// enableCreateEventHandleAPI
216
createEventHandle as unstable_createEventHandle,
packages/react-dom/src/client/ReactDOMLegacy.js
+1
-1
@@ -143,7 +143,7 @@ function legacyCreateRootFromDOMContainer(
143
warnedAboutHydrateAPI = true;
144
console.warn(
145
'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' +
146
- 'will stop working in React v17. Replace the ReactDOM.render() call ' +
146
+ 'will stop working in React v18. Replace the ReactDOM.render() call ' +
147
'with ReactDOM.hydrate() if you want React to attach to the server HTML.',
148
);
149
}
packages/react-is/src/ReactIs.js
+2
-2
@@ -84,7 +84,7 @@ export function isAsyncMode(object: any) {
84
// Using console['warn'] to evade Babel and ESLint
85
console['warn'](
86
'The ReactIs.isAsyncMode() alias has been deprecated, ' +
87
- 'and will be removed in React 17+.',
87
+ 'and will be removed in React 18+.',
88
);
89
}
90
}
@@ -97,7 +97,7 @@ export function isConcurrentMode(object: any) {
97
// Using console['warn'] to evade Babel and ESLint
98
console['warn'](
99
'The ReactIs.isConcurrentMode() alias has been deprecated, ' +
100
- 'and will be removed in React 17+.',
100
+ 'and will be removed in React 18+.',
101
);
102
}
103
}
packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+1
-1
@@ -3141,7 +3141,7 @@ export function warnIfUnmockedScheduler(fiber: Fiber) {
3141
} else if (warnAboutUnmockedScheduler === true) {
3142
didWarnAboutUnmockedScheduler = true;
3143
console.error(
3144
- 'Starting from React v17, the "scheduler" module will need to be mocked ' +
3144
+ 'Starting from React v18, the "scheduler" module will need to be mocked ' +
3145
'to guarantee consistent behaviour across tests and browsers. ' +
3146
'For example, with jest: \n' +
3147
// Break up requires to avoid accidentally parsing them as dependencies.
packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+1
-1
@@ -3310,7 +3310,7 @@ export function warnIfUnmockedScheduler(fiber: Fiber) {
3310
} else if (warnAboutUnmockedScheduler === true) {
3311
didWarnAboutUnmockedScheduler = true;
3312
console.error(
3313
- 'Starting from React v17, the "scheduler" module will need to be mocked ' +
3313
+ 'Starting from React v18, the "scheduler" module will need to be mocked ' +
3314
'to guarantee consistent behaviour across tests and browsers. ' +
3315
'For example, with jest: \n' +
3316
// Break up requires to avoid accidentally parsing them as dependencies.
packages/react-reconciler/src/ReactStrictModeWarnings.new.js
+3
-3
@@ -239,7 +239,7 @@ if (__DEV__) {
239
'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' +
240
'* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' +
241
'* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' +
242
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
242
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
243
'To rename all deprecated lifecycles to their new names, you can run ' +
244
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
245
'\nPlease update the following components: %s',
@@ -260,7 +260,7 @@ if (__DEV__) {
260
'code to use memoization techniques or move it to ' +
261
'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' +
262
'* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' +
263
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
263
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
264
'To rename all deprecated lifecycles to their new names, you can run ' +
265
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
266
'\nPlease update the following components: %s',
@@ -276,7 +276,7 @@ if (__DEV__) {
276
'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' +
277
'* Move data fetching code or side effects to componentDidUpdate.\n' +
278
'* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' +
279
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
279
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
280
'To rename all deprecated lifecycles to their new names, you can run ' +
281
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
282
'\nPlease update the following components: %s',
packages/react-reconciler/src/ReactStrictModeWarnings.old.js
+3
-3
@@ -239,7 +239,7 @@ if (__DEV__) {
239
'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' +
240
'* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' +
241
'* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' +
242
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
242
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
243
'To rename all deprecated lifecycles to their new names, you can run ' +
244
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
245
'\nPlease update the following components: %s',
@@ -260,7 +260,7 @@ if (__DEV__) {
260
'code to use memoization techniques or move it to ' +
261
'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' +
262
'* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' +
263
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
263
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
264
'To rename all deprecated lifecycles to their new names, you can run ' +
265
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
266
'\nPlease update the following components: %s',
@@ -276,7 +276,7 @@ if (__DEV__) {
276
'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' +
277
'* Move data fetching code or side effects to componentDidUpdate.\n' +
278
'* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' +
279
- 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' +
279
+ 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' +
280
'To rename all deprecated lifecycles to their new names, you can run ' +
281
'`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' +
282
'\nPlease update the following components: %s',
packages/react/src/__tests__/ReactStrictMode-test.js
+3
-3
@@ -487,20 +487,20 @@ Please update the following components: AsyncRoot`,
487
`Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
488
489
* Move code with side effects to componentDidMount, and set initial state in the constructor.
490
-* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
490
+* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
491
492
Please update the following components: Parent`,
493
`Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
494
495
* Move data fetching code or side effects to componentDidUpdate.
496
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
497
-* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
497
+* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
498
499
Please update the following components: Parent`,
500
`Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
501
502
* Move data fetching code or side effects to componentDidUpdate.
503
-* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
503
+* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
504
505
Please update the following components: Parent`,
506
/* eslint-enable max-len */
packages/shared/ReactFeatureFlags.js
+1
-1
@@ -62,7 +62,7 @@ export const enableCreateEventHandleAPI = false;
62
63
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
64
65
-// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
65
+// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v18?)
66
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
67
export const warnAboutUnmockedScheduler = false;
68