Skip to content

Commit ebc4e9c

Browse files
authored
Merge 566be83 into ccfc5d4
2 parents ccfc5d4 + 566be83 commit ebc4e9c

23 files changed

Lines changed: 118 additions & 357 deletions

File tree

next.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { patchWebpackConfig } = require("next-global-css");
22
const { RetryChunkLoadPlugin } = require("webpack-retry-chunk-load-plugin");
3-
const { WebpackReactSourcemapsPlugin } = require("@acemarke/react-prod-sourcemaps");
43

54
const withBundleAnalyzer = require("@next/bundle-analyzer")({
65
enabled: process.env.ANALYZE === "true",
@@ -139,8 +138,6 @@ const baseNextConfig = {
139138
);
140139
}
141140

142-
config.plugins.push(WebpackReactSourcemapsPlugin({ debug: false }));
143-
144141
// Allow CSS imported from `node_modules`, to work around an error
145142
// from importing `<Editor>` from `@redux-devtools/ui`
146143
patchWebpackConfig(config, { isServer });
@@ -150,7 +147,7 @@ const baseNextConfig = {
150147
};
151148

152149
const sourceMapRegExp =
153-
/node_modules.+(immer|@reduxjs|react-resizable-panels|react-window|suspense|use-context-menu).+\.js$/;
150+
/node_modules.+(immer|@reduxjs|react-resizable-panels|react|react-dom|react-window|suspense|use-context-menu).+\.js$/;
154151

155152
config.module.rules.push({
156153
test: sourceMapRegExp,

package.json

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/e2e-tests/examples.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/e2e-tests/tests/logpoints-10_too_many_points_to_find.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import { verifyFocusModeVisible } from "../helpers/timeline";
1111
import test from "../testFixtureCloneRecording";
1212

1313
// We need > 10k hits
14+
// Line 150 has >20k hits
1415
const sourceUrl = "react-dom.production.js";
15-
const lineNumber = 149;
16+
const lineNumber = 150;
1617

1718
// trunk-ignore(gitleaks/generic-api-key)
1819
test.use({ exampleKey: "breakpoints-01" });

packages/e2e-tests/tests/logpoints-11_too_many_points_to_run_analysis.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { getFocusBeginTime, getFocusEndTime, setFocusRange } from "../helpers/ti
1111
import test, { expect } from "../testFixtureCloneRecording";
1212

1313
// We need 500...10k hits
14-
// Line 44 has 4.9k hits
14+
// Line 248 has 847 hits
1515
const sourceUrl = "react-dom.production.js";
16-
const lineNumber = 251;
16+
const lineNumber = 248;
1717

1818
// trunk-ignore(gitleaks/generic-api-key)
1919
test.use({ exampleKey: "breakpoints-01" });

packages/e2e-tests/tests/react_devtools-02-integrations.test.ts

Lines changed: 9 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -59,65 +59,9 @@ test("react_devtools-02: RDT integrations (Chromium)", async ({
5959
const componentNames = await getAllVisibleComponentNames(page);
6060

6161
/*
62-
In production, the first 20-ish component names normally look like this (flattened):
63-
[
64-
"ea",
65-
"J",
66-
"X",
67-
"z",
68-
"Context.Provider",
69-
"Context.Provider",
70-
"Anonymous",
71-
"Context.Provider",
72-
"Context.Provider",
73-
"Context.Provider",
74-
"Context.Provider",
75-
"n8",
76-
"O",
77-
"Anonymous",
78-
"Anonymous"
79-
"Auth0Provider",
80-
"iU",
81-
"Context.Provider",
82-
"Context.Consumer",
83-
"da",
84-
"dn"
85-
"Anonymous",
86-
"Anonymous"
87-
]
88-
89-
In development, however, they are (minus dev-only components):
90-
91-
[
92-
'Root',
93-
'Head',
94-
'AppContainer',
95-
'Container',
96-
'AppRouterContext.Provider',
97-
'SearchParamsContext.Provider',
98-
'PathnameContextProviderAdapter',
99-
'PathnameContext.Provider',
100-
'RouterContext.Provider',
101-
'HeadManagerContext.Provider',
102-
'ImageConfigContext.Provider',
103-
'App',
104-
'SystemProvider',
105-
'Head',
106-
'SideEffect',
107-
'Auth0Provider',
108-
'Auth0Provider', // twice? wut?
109-
'Context.Provider',
110-
'Context.Consumer',
111-
'SSRRecordingPage',
112-
'RecordingHead',
113-
'Head',
114-
'SideEffect'
115-
]
116-
117-
118-
In practice, the routine's name processing currently lose the specific context names,
119-
and a couple components aren't getting their names mapped.
120-
But, assuming the routine name mapping worked, we _should_ end up with this:
62+
The first 20-ish component names normally look like the list below (flattened)
63+
In practice, the routine's name processing currently lose the specific context names,
64+
but assuming the routine name mapping worked, we _should_ end up with this:
12165
*/
12266
const expectedComponentNames = [
12367
"Root",
@@ -136,7 +80,7 @@ test("react_devtools-02: RDT integrations (Chromium)", async ({
13680
"Head",
13781
"SideEffect",
13882
"Auth0Provider",
139-
"iN",
83+
"Auth0Provider",
14084
"Context.Provider",
14185
"Context.Consumer",
14286
"SSRRecordingPage",
@@ -240,18 +184,18 @@ test("react_devtools-02: RDT integrations (Chromium)", async ({
240184
// Re-select "App" just so we're back at the top
241185
await getReactComponents(page).first().click();
242186

243-
// Should render our `<LazyOffscreen>` components, but _not_ `<Offscreen>`,
187+
// Should render our `<LazyActivity>` components, but _not_ `<Activity>`,
244188
// because RDT already filters those out by default
245-
debugPrint(page, `Checking rendering of <Offscreen> components`);
189+
debugPrint(page, `Checking rendering of <Activity> components`);
246190

247-
await searchComponents(page, "Offscreen");
191+
await searchComponents(page, "Activity");
248192
await verifySearchResults(page, {
249193
currentNumber: 1,
250194
totalNumber: 6,
251195
});
252196

253197
const offscreenSearchComponentNames = await getAllVisibleComponentNames(page);
254198
expect(offscreenSearchComponentNames.length).toBeGreaterThan(0);
255-
expect(offscreenSearchComponentNames.includes("LazyOffscreen")).toBe(true);
256-
expect(offscreenSearchComponentNames.includes("Offscreen")).toBe(false);
199+
expect(offscreenSearchComponentNames.includes("LazyActivity")).toBe(true);
200+
expect(offscreenSearchComponentNames.includes("Activity")).toBe(false);
257201
});

packages/replay-next/components/Expandable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import React, {
1111
import { ExpandablesContext } from "replay-next/src/contexts/ExpandablesContext";
1212

1313
import Icon from "./Icon";
14-
import LazyOffscreen from "./LazyOffscreen";
14+
import LazyActivity from "./LazyActivity";
1515
import styles from "./Expandable.module.css";
1616

1717
export type RenderChildrenFunction = () => ReactNode;
@@ -117,14 +117,14 @@ export default function Expandable({
117117
{header}
118118
</span>
119119

120-
<LazyOffscreen mode={isOpen ? "visible" : "hidden"}>
120+
<LazyActivity mode={isOpen ? "visible" : "hidden"}>
121121
<span
122122
className={`${childrenClassName} ${styles.Children}`}
123123
data-test-name="ExpandableChildren"
124124
>
125125
{children}
126126
</span>
127-
</LazyOffscreen>
127+
</LazyActivity>
128128
</span>
129129
);
130130
}

packages/replay-next/components/LazyOffscreen.tsx renamed to packages/replay-next/components/LazyActivity.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { unstable_Offscreen as Offscreen, ReactNode, useEffect, useRef } from "react";
1+
import { unstable_Activity as Activity, ReactNode, useEffect, useRef } from "react";
22

3-
// Wrapper around the Offscreen API that defers rendering the Offscreen tree initially,
3+
// Wrapper around the Activity API that defers rendering the Activity tree initially,
44
// until it's been explicitly marked as "visible".
55
//
66
// This allows UIs that make heavy use of Suspense (such as the Object Inspector)
77
// to avoid sending a flood of protocol requests when initially mounted.
8-
export default function LazyOffscreen({
8+
export default function LazyActivity({
99
children,
1010
mode,
1111
}: {
@@ -25,5 +25,5 @@ export default function LazyOffscreen({
2525
return null;
2626
}
2727

28-
return <Offscreen children={children} mode={mode} />;
28+
return <Activity children={children} mode={mode} />;
2929
}

packages/replay-next/components/console/ConsoleRoot.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import classNames from "classnames";
22
import {
3+
unstable_Activity as Activity,
34
KeyboardEvent,
45
MouseEvent,
5-
unstable_Offscreen as Offscreen,
66
ReactNode,
77
RefObject,
88
Suspense,
@@ -93,7 +93,7 @@ function Console({
9393
// _If_ it's off initially, we want to completely skip rendering it, which
9494
// avoids making the "fetch events" calls during app startup to speed up loading.
9595
// But, if it's ever been shown and toggled off, continue rendering it
96-
// inside the `<Offscreen>` to preserve state.
96+
// inside the `<Activity>` to preserve state.
9797
const renderFilters = isMenuOpen || showFiltersByDefault || menuValueHasBeenToggled;
9898

9999
const onKeyDown = (event: KeyboardEvent) => {
@@ -156,7 +156,7 @@ function Console({
156156
onKeyDown={onKeyDown}
157157
>
158158
<PanelGroup autoSaveId="ConsoleRoot" direction="horizontal">
159-
<Offscreen mode={isMenuOpen ? "visible" : "hidden"}>
159+
<Activity mode={isMenuOpen ? "visible" : "hidden"}>
160160
<>
161161
<Panel
162162
className={styles.LeftPanel}
@@ -189,7 +189,7 @@ function Console({
189189
<PanelResizeHandle className={styles.PanelResizeHandle} />
190190
</div>
191191
</>
192-
</Offscreen>
192+
</Activity>
193193

194194
<Panel className={styles.RightPanel} defaultSize={75} id="console" minSize={50} order={2}>
195195
<div className={styles.RightColumnActionsRow}>

packages/replay-next/components/inspector/HTMLExpandable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ReactNode, Suspense, useContext, useState } from "react";
88
import { ExpandablesContext } from "replay-next/src/contexts/ExpandablesContext";
99

1010
import Icon from "../Icon";
11-
import LazyOffscreen from "../LazyOffscreen";
11+
import LazyActivity from "../LazyActivity";
1212
import Loader from "../Loader";
1313
import HTMLChildrenRenderer from "./HTMLChildrenRenderer";
1414
import HTMLElementRenderer from "./values/HTMLElementRenderer";
@@ -78,7 +78,7 @@ export default function HTMLExpandable({
7878
/>
7979
</span>
8080

81-
<LazyOffscreen mode={isOpen ? "visible" : "hidden"}>
81+
<LazyActivity mode={isOpen ? "visible" : "hidden"}>
8282
<span className={styles.Children} data-test-name="ExpandableChildren">
8383
<Suspense fallback={<Loader />}>
8484
<HTMLChildrenRenderer object={object} path={path} pauseId={pauseId} />
@@ -94,7 +94,7 @@ export default function HTMLExpandable({
9494
showOpeningTag={false}
9595
/>
9696
</span>
97-
</LazyOffscreen>
97+
</LazyActivity>
9898
</span>
9999
);
100100
}

0 commit comments

Comments
 (0)