Skip to content

Commit 34b7bb9

Browse files
committed
Revert to last successful www sync
1 parent fc07b07 commit 34b7bb9

File tree

110 files changed

+2552
-7842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2552
-7842
lines changed

packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,42 +1692,6 @@ const tests = {
16921692
},
16931693
],
16941694
},
1695-
{
1696-
code: normalizeIndent`
1697-
function MyComponent() {
1698-
useEffect()
1699-
useLayoutEffect()
1700-
useCallback()
1701-
useMemo()
1702-
}
1703-
`,
1704-
errors: [
1705-
{
1706-
message:
1707-
'React Hook useEffect requires an effect callback. ' +
1708-
'Did you forget to pass a callback to the hook?',
1709-
suggestions: undefined,
1710-
},
1711-
{
1712-
message:
1713-
'React Hook useLayoutEffect requires an effect callback. ' +
1714-
'Did you forget to pass a callback to the hook?',
1715-
suggestions: undefined,
1716-
},
1717-
{
1718-
message:
1719-
'React Hook useCallback requires an effect callback. ' +
1720-
'Did you forget to pass a callback to the hook?',
1721-
suggestions: undefined,
1722-
},
1723-
{
1724-
message:
1725-
'React Hook useMemo requires an effect callback. ' +
1726-
'Did you forget to pass a callback to the hook?',
1727-
suggestions: undefined,
1728-
},
1729-
],
1730-
},
17311695
{
17321696
// Regression test
17331697
code: normalizeIndent`

packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,19 +1119,6 @@ export default {
11191119
const declaredDependenciesNode = node.arguments[callbackIndex + 1];
11201120
const isEffect = /Effect($|[^a-z])/g.test(reactiveHookName);
11211121

1122-
// Check whether a callback is supplied. If there is no callback supplied
1123-
// then the hook will not work and React will throw a TypeError.
1124-
// So no need to check for dependency inclusion.
1125-
if (!callback) {
1126-
reportProblem({
1127-
node: reactiveHook,
1128-
message:
1129-
`React Hook ${reactiveHookName} requires an effect callback. ` +
1130-
`Did you forget to pass a callback to the hook?`,
1131-
});
1132-
return;
1133-
}
1134-
11351122
// Check the declared dependencies for this reactive hook. If there is no
11361123
// second argument then the reactive callback will re-run on every render.
11371124
// So no need to check for dependency inclusion.

packages/react-debug-tools/src/ReactDebugHooks.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ function getPrimitiveStackCache(): Map<string, Array<any>> {
7373
Dispatcher.useState(null);
7474
Dispatcher.useReducer((s, a) => s, null);
7575
Dispatcher.useRef(null);
76-
if (typeof Dispatcher.useCacheRefresh === 'function') {
77-
// This type check is for Flow only.
78-
Dispatcher.useCacheRefresh();
79-
}
8076
Dispatcher.useLayoutEffect(() => {});
8177
Dispatcher.useEffect(() => {});
8278
Dispatcher.useImperativeHandle(undefined, () => null);
@@ -175,16 +171,6 @@ function useRef<T>(initialValue: T): {|current: T|} {
175171
return ref;
176172
}
177173

178-
function useCacheRefresh(): () => void {
179-
const hook = nextHook();
180-
hookLog.push({
181-
primitive: 'CacheRefresh',
182-
stackError: new Error(),
183-
value: hook !== null ? hook.memoizedState : function refresh() {},
184-
});
185-
return () => {};
186-
}
187-
188174
function useLayoutEffect(
189175
create: () => (() => void) | void,
190176
inputs: Array<mixed> | void | null,
@@ -319,7 +305,6 @@ function useOpaqueIdentifier(): OpaqueIDType | void {
319305
const Dispatcher: DispatcherType = {
320306
getCacheForType,
321307
readContext,
322-
useCacheRefresh,
323308
useCallback,
324309
useContext,
325310
useEffect,

packages/react-devtools-core/src/standalone.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
getAppendComponentStack,
2121
getBreakOnConsoleErrors,
2222
getSavedComponentFilters,
23-
getShowInlineWarningsAndErrors,
2423
} from 'react-devtools-shared/src/utils';
2524
import {Server} from 'ws';
2625
import {join} from 'path';
@@ -304,9 +303,6 @@ function startServer(
304303
)};
305304
window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = ${JSON.stringify(
306305
getSavedComponentFilters(),
307-
)};
308-
window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = ${JSON.stringify(
309-
getShowInlineWarningsAndErrors(),
310306
)};`;
311307

312308
response.end(

packages/react-devtools-extensions/src/main.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
getAppendComponentStack,
1111
getBreakOnConsoleErrors,
1212
getSavedComponentFilters,
13-
getShowInlineWarningsAndErrors,
1413
} from 'react-devtools-shared/src/utils';
1514
import {
1615
localStorageGetItem,
@@ -30,18 +29,18 @@ let panelCreated = false;
3029
// because they are stored in localStorage within the context of the extension.
3130
// Instead it relies on the extension to pass filters through.
3231
function syncSavedPreferences() {
32+
const appendComponentStack = getAppendComponentStack();
33+
const breakOnConsoleErrors = getBreakOnConsoleErrors();
34+
const componentFilters = getSavedComponentFilters();
3335
chrome.devtools.inspectedWindow.eval(
3436
`window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = ${JSON.stringify(
35-
getAppendComponentStack(),
37+
appendComponentStack,
3638
)};
3739
window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = ${JSON.stringify(
38-
getBreakOnConsoleErrors(),
40+
breakOnConsoleErrors,
3941
)};
4042
window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = ${JSON.stringify(
41-
getSavedComponentFilters(),
42-
)};
43-
window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = ${JSON.stringify(
44-
getShowInlineWarningsAndErrors(),
43+
componentFilters,
4544
)};`,
4645
);
4746
}

packages/react-devtools-inline/src/backend.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ function startActivation(contentWindow: window) {
2424
appendComponentStack,
2525
breakOnConsoleErrors,
2626
componentFilters,
27-
showInlineWarningsAndErrors,
2827
} = data;
2928

3029
contentWindow.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = appendComponentStack;
3130
contentWindow.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = breakOnConsoleErrors;
3231
contentWindow.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters;
33-
contentWindow.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = showInlineWarningsAndErrors;
3432

3533
// TRICKY
3634
// The backend entry point may be required in the context of an iframe or the parent window.
@@ -42,7 +40,6 @@ function startActivation(contentWindow: window) {
4240
window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = appendComponentStack;
4341
window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = breakOnConsoleErrors;
4442
window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters;
45-
window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = showInlineWarningsAndErrors;
4643
}
4744

4845
finishActivation(contentWindow);

packages/react-devtools-inline/src/frontend.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
getAppendComponentStack,
1010
getBreakOnConsoleErrors,
1111
getSavedComponentFilters,
12-
getShowInlineWarningsAndErrors,
1312
} from 'react-devtools-shared/src/utils';
1413
import {
1514
MESSAGE_TYPE_GET_SAVED_PREFERENCES,
@@ -42,7 +41,6 @@ export function initialize(
4241
appendComponentStack: getAppendComponentStack(),
4342
breakOnConsoleErrors: getBreakOnConsoleErrors(),
4443
componentFilters: getSavedComponentFilters(),
45-
showInlineWarningsAndErrors: getShowInlineWarningsAndErrors(),
4644
},
4745
'*',
4846
);

packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ Array [
1212
Object {
1313
"displayName": "Grandparent",
1414
"hocDisplayNames": null,
15-
"id": 2,
15+
"id": 7,
1616
"type": 5,
1717
},
1818
Object {
1919
"displayName": "Parent",
2020
"hocDisplayNames": null,
21-
"id": 3,
21+
"id": 9,
2222
"type": 5,
2323
},
2424
Object {
2525
"displayName": "Child",
2626
"hocDisplayNames": null,
27-
"id": 4,
27+
"id": 8,
2828
"type": 5,
2929
},
3030
]
@@ -115,7 +115,7 @@ Array [
115115
Object {
116116
"displayName": "Grandparent",
117117
"hocDisplayNames": null,
118-
"id": 2,
118+
"id": 5,
119119
"type": 5,
120120
},
121121
]

packages/react-devtools-shared/src/__tests__/__snapshots__/store-test.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,5 +685,4 @@ exports[`Store should show the right display names for special component types 1
685685
<Baz> [withFoo][withBar]
686686
<Baz> [Memo][withFoo][withBar]
687687
<Baz> [ForwardRef][withFoo][withBar]
688-
<Cache>
689688
`;
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Store component filters should filter HOCs: 1: mount 1`] = `
4+
[root]
5+
▾ <Component> [Bar][Foo]
6+
▾ <Component> [Foo]
7+
▾ <Component>
8+
<div>
9+
`;
10+
11+
exports[`Store component filters should filter HOCs: 2: hide all HOCs 1`] = `
12+
[root]
13+
▾ <Component>
14+
<div>
15+
`;
16+
17+
exports[`Store component filters should filter HOCs: 3: disable HOC filter 1`] = `
18+
[root]
19+
▾ <Component> [Bar][Foo]
20+
▾ <Component> [Foo]
21+
▾ <Component>
22+
<div>
23+
`;
24+
25+
exports[`Store component filters should filter by display name: 1: mount 1`] = `
26+
[root]
27+
▾ <Foo>
28+
<Text>
29+
▾ <Bar>
30+
<Text>
31+
▾ <Baz>
32+
<Text>
33+
`;
34+
35+
exports[`Store component filters should filter by display name: 2: filter "Foo" 1`] = `
36+
[root]
37+
<Text>
38+
▾ <Bar>
39+
<Text>
40+
▾ <Baz>
41+
<Text>
42+
`;
43+
44+
exports[`Store component filters should filter by display name: 3: filter "Ba" 1`] = `
45+
[root]
46+
▾ <Foo>
47+
<Text>
48+
<Text>
49+
<Text>
50+
`;
51+
52+
exports[`Store component filters should filter by display name: 4: filter "B.z" 1`] = `
53+
[root]
54+
▾ <Foo>
55+
<Text>
56+
▾ <Bar>
57+
<Text>
58+
<Text>
59+
`;
60+
61+
exports[`Store component filters should filter by path: 1: mount 1`] = `
62+
[root]
63+
▾ <Component>
64+
<div>
65+
`;
66+
67+
exports[`Store component filters should filter by path: 2: hide all components declared within this test filed 1`] = `[root]`;
68+
69+
exports[`Store component filters should filter by path: 3: hide components in a made up fake path 1`] = `
70+
[root]
71+
▾ <Component>
72+
<div>
73+
`;
74+
75+
exports[`Store component filters should ignore invalid ElementTypeRoot filter: 1: mount 1`] = `
76+
[root]
77+
▾ <Root>
78+
<div>
79+
`;
80+
81+
exports[`Store component filters should ignore invalid ElementTypeRoot filter: 2: add invalid filter 1`] = `
82+
[root]
83+
▾ <Root>
84+
<div>
85+
`;
86+
87+
exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 1: suspended 1`] = `
88+
[root]
89+
▾ <Wrapper>
90+
▾ <Loading>
91+
<div>
92+
`;
93+
94+
exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 2: resolved 1`] = `
95+
[root]
96+
▾ <Wrapper>
97+
<Component>
98+
`;
99+
100+
exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 3: suspended 1`] = `
101+
[root]
102+
▾ <Wrapper>
103+
▾ <Loading>
104+
<div>
105+
`;
106+
107+
exports[`Store component filters should support filtering by element type: 1: mount 1`] = `
108+
[root]
109+
▾ <Root>
110+
▾ <div>
111+
▾ <Component>
112+
<div>
113+
`;
114+
115+
exports[`Store component filters should support filtering by element type: 2: hide host components 1`] = `
116+
[root]
117+
▾ <Root>
118+
<Component>
119+
`;
120+
121+
exports[`Store component filters should support filtering by element type: 3: hide class components 1`] = `
122+
[root]
123+
▾ <div>
124+
▾ <Component>
125+
<div>
126+
`;
127+
128+
exports[`Store component filters should support filtering by element type: 4: hide class and function components 1`] = `
129+
[root]
130+
▾ <div>
131+
<div>
132+
`;
133+
134+
exports[`Store component filters should support filtering by element type: 5: disable all filters 1`] = `
135+
[root]
136+
▾ <Root>
137+
▾ <div>
138+
▾ <Component>
139+
<div>
140+
`;

0 commit comments

Comments
 (0)