@samitouri / QOS-React-2 / commits / 121bfb03bc

update legacy context warning message (#16196)

The link in the legacy context message doesn't point to anything context related. This changes the link to point to https://fb.me/react-legacy-context, which points to https://reactjs.org/docs/context.html#legacy-api. Also adds a line that it'll probably be gone later.

Sunil Pai committed Jul 25, 2019 at 00:34 UTC 121bfb03bccf3bdb4c5d1ba7cc53b573edb74434
5 files changed +40 -2
packages/react-reconciler/src/ReactStrictModeWarnings.js
+3 -1
@@ -347,9 +347,11 @@ if (__DEV__) {
347 warningWithoutStack(
348 false,
349 'Legacy context API has been detected within a strict-mode tree: %s' +
350 + '\n\nThe old API will be supported in all 16.x releases, but applications ' +
351 + 'using it should migrate to the new version.' +
352 '\n\nPlease update the following components: %s' +
353 '\n\nLearn more about this warning here:' +
352 - '\nhttps://fb.me/react-strict-mode-warnings',
354 + '\nhttps://fb.me/react-legacy-context',
355 strictRootComponentStack,
356 sortedNames,
357 );
packages/react-reconciler/src/__tests__/ReactIncremental-test.internal.js
+28
@@ -1914,6 +1914,8 @@ describe('ReactIncremental', () => {
1914 ]),
1915 ).toWarnDev(
1916 'Legacy context API has been detected within a strict-mode tree: \n\n' +
1917 + 'The old API will be supported in all 16.x releases, but applications ' +
1918 + 'using it should migrate to the new version.\n\n' +
1919 'Please update the following components: Intl, ShowBoth, ShowLocale',
1920 {withoutStack: true},
1921 );
@@ -1969,6 +1971,8 @@ describe('ReactIncremental', () => {
1971 ]),
1972 ).toWarnDev(
1973 'Legacy context API has been detected within a strict-mode tree: \n\n' +
1974 + 'The old API will be supported in all 16.x releases, but applications ' +
1975 + 'using it should migrate to the new version.\n\n' +
1976 'Please update the following components: Router, ShowRoute',
1977 {withoutStack: true},
1978 );
@@ -1998,6 +2002,8 @@ describe('ReactIncremental', () => {
2002 ReactNoop.render(<Recurse />);
2003 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2004 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2005 + 'The old API will be supported in all 16.x releases, but applications ' +
2006 + 'using it should migrate to the new version.\n\n' +
2007 'Please update the following components: Recurse',
2008 {withoutStack: true},
2009 );
@@ -2041,6 +2047,8 @@ describe('ReactIncremental', () => {
2047 '`Recurse.prototype = React.Component.prototype`. ' +
2048 "Don't use an arrow function since it cannot be called with `new` by React.",
2049 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2050 + 'The old API will be supported in all 16.x releases, but applications ' +
2051 + 'using it should migrate to the new version.\n\n' +
2052 'Please update the following components: Recurse',
2053 ],
2054 {withoutStack: true},
@@ -2107,6 +2115,8 @@ describe('ReactIncremental', () => {
2115 ]),
2116 ).toWarnDev(
2117 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2118 + 'The old API will be supported in all 16.x releases, but applications ' +
2119 + 'using it should migrate to the new version.\n\n' +
2120 'Please update the following components: Intl, ShowLocale',
2121 {withoutStack: true},
2122 );
@@ -2186,6 +2196,8 @@ describe('ReactIncremental', () => {
2196 );
2197 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2198 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2199 + 'The old API will be supported in all 16.x releases, but applications ' +
2200 + 'using it should migrate to the new version.\n\n' +
2201 'Please update the following components: Intl, ShowLocaleClass, ShowLocaleFn',
2202 {withoutStack: true},
2203 );
@@ -2278,6 +2290,8 @@ describe('ReactIncremental', () => {
2290 );
2291 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2292 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2293 + 'The old API will be supported in all 16.x releases, but applications ' +
2294 + 'using it should migrate to the new version.\n\n' +
2295 'Please update the following components: Intl, ShowLocaleClass, ShowLocaleFn',
2296 {withoutStack: true},
2297 );
@@ -2347,6 +2361,8 @@ describe('ReactIncremental', () => {
2361 ReactNoop.render(<Root />);
2362 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2363 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2364 + 'The old API will be supported in all 16.x releases, but applications ' +
2365 + 'using it should migrate to the new version.\n\n' +
2366 'Please update the following components: Child',
2367 {withoutStack: true},
2368 );
@@ -2397,6 +2413,8 @@ describe('ReactIncremental', () => {
2413 ReactNoop.render(<Root />);
2414 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2415 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2416 + 'The old API will be supported in all 16.x releases, but applications ' +
2417 + 'using it should migrate to the new version.\n\n' +
2418 'Please update the following components: ContextProvider',
2419 {withoutStack: true},
2420 );
@@ -2448,6 +2466,8 @@ describe('ReactIncremental', () => {
2466 [
2467 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended',
2468 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2469 + 'The old API will be supported in all 16.x releases, but applications ' +
2470 + 'using it should migrate to the new version.\n\n' +
2471 'Please update the following components: MyComponent',
2472 ],
2473 {withoutStack: true},
@@ -2595,6 +2615,8 @@ describe('ReactIncremental', () => {
2615
2616 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2617 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2618 + 'The old API will be supported in all 16.x releases, but applications ' +
2619 + 'using it should migrate to the new version.\n\n' +
2620 'Please update the following components: Child, TopContextProvider',
2621 {withoutStack: true},
2622 );
@@ -2657,6 +2679,8 @@ describe('ReactIncremental', () => {
2679
2680 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2681 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2682 + 'The old API will be supported in all 16.x releases, but applications ' +
2683 + 'using it should migrate to the new version.\n\n' +
2684 'Please update the following components: Child, MiddleContextProvider, TopContextProvider',
2685 {withoutStack: true},
2686 );
@@ -2728,6 +2752,8 @@ describe('ReactIncremental', () => {
2752
2753 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2754 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2755 + 'The old API will be supported in all 16.x releases, but applications ' +
2756 + 'using it should migrate to the new version.\n\n' +
2757 'Please update the following components: Child, MiddleContextProvider, TopContextProvider',
2758 {withoutStack: true},
2759 );
@@ -2809,6 +2835,8 @@ describe('ReactIncremental', () => {
2835
2836 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
2837 'Legacy context API has been detected within a strict-mode tree: \n\n' +
2838 + 'The old API will be supported in all 16.x releases, but applications ' +
2839 + 'using it should migrate to the new version.\n\n' +
2840 'Please update the following components: Child, MiddleContextProvider, TopContextProvider',
2841 {withoutStack: true},
2842 );
packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
+4
@@ -1119,6 +1119,8 @@ describe('ReactIncrementalErrorHandling', () => {
1119 );
1120 expect(() => expect(Scheduler).toFlushWithoutYielding()).toWarnDev(
1121 'Legacy context API has been detected within a strict-mode tree: \n\n' +
1122 + 'The old API will be supported in all 16.x releases, but ' +
1123 + 'applications using it should migrate to the new version.\n\n' +
1124 'Please update the following components: Connector, Provider',
1125 {withoutStack: true},
1126 );
@@ -1620,6 +1622,8 @@ describe('ReactIncrementalErrorHandling', () => {
1622 '`Provider.prototype = React.Component.prototype`. ' +
1623 "Don't use an arrow function since it cannot be called with `new` by React.",
1624 'Legacy context API has been detected within a strict-mode tree: \n\n' +
1625 + 'The old API will be supported in all 16.x releases, but ' +
1626 + 'applications using it should migrate to the new version.\n\n' +
1627 'Please update the following components: Provider',
1628 ],
1629 {withoutStack: true},
packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js
+2
@@ -1197,6 +1197,8 @@ describe('ReactNewContext', () => {
1197 expect(Scheduler).toFlushAndYield(['LegacyProvider', 'App', 'Child']);
1198 }).toWarnDev(
1199 'Legacy context API has been detected within a strict-mode tree: \n\n' +
1200 + 'The old API will be supported in all 16.x releases, but applications ' +
1201 + 'using it should migrate to the new version.\n\n' +
1202 'Please update the following components: LegacyProvider',
1203 {withoutStack: true},
1204 );
packages/react/src/__tests__/ReactStrictMode-test.internal.js
+3 -1
@@ -817,10 +817,12 @@ Please update the following components: Parent`,
817 '\n in StrictMode (at **)' +
818 '\n in div (at **)' +
819 '\n in Root (at **)' +
820 + '\n\nThe old API will be supported in all 16.x releases, but applications ' +
821 + 'using it should migrate to the new version.' +
822 '\n\nPlease update the following components: ' +
823 'FunctionalLegacyContextConsumer, LegacyContextConsumer, LegacyContextProvider' +
824 '\n\nLearn more about this warning here:' +
823 - '\nhttps://fb.me/react-strict-mode-warnings',
825 + '\nhttps://fb.me/react-legacy-context',
826 );
827
828 // Dedupe