Skip to content

Commit 4f003e3

Browse files
authored
Merge branch 'main' into remove-flow-expect-error
2 parents 3948d19 + 95bb62c commit 4f003e3

File tree

12 files changed

+526
-670
lines changed

12 files changed

+526
-670
lines changed

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
"@codemirror/lang-cpp": "^6.0.3",
6363
"@codemirror/lang-javascript": "^6.2.4",
6464
"@codemirror/lang-rust": "^6.0.2",
65-
"@codemirror/language": "^6.11.2",
65+
"@codemirror/language": "^6.11.3",
6666
"@codemirror/state": "^6.5.2",
6767
"@codemirror/view": "^6.38.1",
68-
"@firefox-devtools/react-contextmenu": "^5.2.2",
68+
"@firefox-devtools/react-contextmenu": "^5.2.3",
6969
"@fluent/bundle": "^0.19.1",
7070
"@fluent/langneg": "^0.7.0",
7171
"@fluent/react": "^0.15.2",
@@ -77,7 +77,7 @@
7777
"classnames": "^2.5.1",
7878
"common-tags": "^1.8.2",
7979
"copy-to-clipboard": "^3.3.3",
80-
"core-js": "^3.44.0",
80+
"core-js": "^3.45.0",
8181
"escape-string-regexp": "^4.0.0",
8282
"gecko-profiler-demangle": "^0.3.3",
8383
"idb": "^8.0.3",
@@ -89,7 +89,7 @@
8989
"mixedtuplemap": "^1.0.0",
9090
"namedtuplemap": "^1.0.0",
9191
"photon-colors": "^3.3.2",
92-
"protobufjs": "^7.5.3",
92+
"protobufjs": "^7.5.4",
9393
"query-string": "^9.2.2",
9494
"react": "^18.3.1",
9595
"react-dom": "^18.3.1",
@@ -106,24 +106,24 @@
106106
"workbox-window": "^7.3.0"
107107
},
108108
"devDependencies": {
109-
"@babel/cli": "^7.28.0",
110-
"@babel/core": "^7.28.0",
109+
"@babel/cli": "^7.28.3",
110+
"@babel/core": "^7.28.3",
111111
"@babel/eslint-parser": "^7.28.0",
112112
"@babel/eslint-plugin": "^7.27.1",
113113
"@babel/plugin-proposal-class-properties": "^7.18.6",
114-
"@babel/preset-env": "^7.28.0",
114+
"@babel/preset-env": "^7.28.3",
115115
"@babel/preset-react": "^7.27.1",
116116
"@babel/preset-typescript": "^7.27.1",
117117
"@fetch-mock/jest": "^0.2.16",
118-
"@testing-library/dom": "^10.4.0",
118+
"@testing-library/dom": "^10.4.1",
119119
"@testing-library/jest-dom": "^6.6.4",
120120
"@testing-library/react": "^16.3.0",
121121
"@types/clamp": "^1.0.3",
122122
"@types/common-tags": "^1.8.4",
123123
"@types/jest": "^30.0.0",
124124
"@types/minimist": "^1.2.5",
125125
"@types/query-string": "^6.3.0",
126-
"@types/react": "^18.3.1",
126+
"@types/react": "^18.3.24",
127127
"@types/react-dom": "^18.3.1",
128128
"@types/react-splitter-layout": "^4.0.0",
129129
"@types/react-transition-group": "^4.4.5",
@@ -133,14 +133,14 @@
133133
"@typescript-eslint/parser": "^8.38.0",
134134
"alex": "^11.0.1",
135135
"autoprefixer": "^10.4.21",
136-
"babel-jest": "^30.0.4",
136+
"babel-jest": "^30.0.5",
137137
"babel-loader": "^10.0.0",
138138
"babel-plugin-module-resolver": "^5.0.2",
139-
"browserslist": "^4.25.1",
140-
"caniuse-lite": "^1.0.30001727",
139+
"browserslist": "^4.25.2",
140+
"caniuse-lite": "^1.0.30001731",
141141
"circular-dependency-plugin": "^5.2.1",
142142
"codecov": "^3.8.3",
143-
"copy-webpack-plugin": "^13.0.0",
143+
"copy-webpack-plugin": "^13.0.1",
144144
"cross-env": "^10.0.0",
145145
"css-loader": "^7.1.2",
146146
"cssnano": "^7.1.0",
@@ -153,15 +153,15 @@
153153
"eslint-plugin-jest-dom": "^5.5.0",
154154
"eslint-plugin-jest-formatting": "^3.1.0",
155155
"eslint-plugin-react": "^7.37.5",
156-
"eslint-plugin-testing-library": "^7.6.0",
156+
"eslint-plugin-testing-library": "^7.6.3",
157157
"espree": "^10.4.0",
158-
"fake-indexeddb": "^6.0.1",
158+
"fake-indexeddb": "^6.1.0",
159159
"file-loader": "^6.2.0",
160160
"glob": "^11.0.3",
161-
"html-webpack-plugin": "^5.6.3",
161+
"html-webpack-plugin": "^5.6.4",
162162
"husky": "^4.3.8",
163-
"jest": "^30.0.4",
164-
"jest-environment-jsdom": "^30.0.4",
163+
"jest": "^30.0.5",
164+
"jest-environment-jsdom": "^30.0.5",
165165
"jest-extended": "^6.0.0",
166166
"json-loader": "^0.5.7",
167167
"local-web-server": "^5.4.0",
@@ -177,18 +177,18 @@
177177
"raw-loader": "^4.0.2",
178178
"rimraf": "^5.0.10",
179179
"style-loader": "^4.0.0",
180-
"stylelint": "^16.21.1",
180+
"stylelint": "^16.23.0",
181181
"stylelint-config-idiomatic-order": "^10.0.0",
182-
"stylelint-config-standard": "^38.0.0",
182+
"stylelint-config-standard": "^39.0.0",
183183
"typescript": "^5.8.3",
184-
"webpack": "^5.100.2",
184+
"webpack": "^5.101.3",
185185
"webpack-cli": "^6.0.1",
186186
"webpack-dev-server": "^5.2.2",
187187
"workbox-webpack-plugin": "^7.3.0",
188188
"yargs": "^18.0.0"
189189
},
190190
"resolutions": {
191-
"@types/react-splitter-layout/@types/react": "^18.3.1",
191+
"@types/react-splitter-layout/@types/react": "^18.3.24",
192192
"@types/trusted-types": "^2.0.7"
193193
},
194194
"jest": {

src/components/app/CompareHome.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
.compareHomeForm {
1818
display: grid;
1919
align-items: center;
20-
grid-gap: 1em;
20+
gap: 1em;
2121
grid-template-columns: auto 1fr;
2222
}
2323

src/components/app/KeyboardShortcut.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
.appKeyboardShortcutsContent {
6565
display: grid;
6666
margin: 40px;
67-
grid-gap: 80px;
67+
gap: 80px;
6868
grid-template-columns: 1fr 1fr;
6969
}
7070

src/components/flame-graph/Canvas.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
.flameGraphCanvasTooltip > .tooltipHeader {
2020
display: grid;
21-
grid-gap: 2px 0;
21+
gap: 2px 0;
2222
grid-template-columns: min-content auto;
2323
}
2424

src/components/shared/CodeView.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@
128128
.cm-content {
129129
font-family: ui-monospace, 'Roboto Mono', monospace;
130130
hyphens: none;
131+
overflow-wrap: normal;
131132
word-break: normal;
132133
word-spacing: normal;
133-
word-wrap: normal;
134134
}
135135

136136
/**

src/components/sidebar/sidebar.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
display: grid;
2222
align-content: start; /* the grid isn't vertically stretched */
2323
align-items: center;
24-
grid-gap: 2px 5px;
24+
gap: 2px 5px;
2525
grid-template-columns:
2626
/* Label */
2727
1fr
@@ -51,7 +51,7 @@
5151

5252
.sidebar-title-label {
5353
display: grid;
54-
grid-gap: 5px;
54+
gap: 5px;
5555
grid-template-columns: min-content 1fr;
5656
}
5757

src/components/tooltip/CallNode.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
align-items: center;
88
padding-bottom: 10px;
99
border-top: 1px solid var(--grey-40);
10-
grid-gap: 4px;
10+
gap: 4px;
1111
grid-template-columns: repeat(4, min-content);
1212
}
1313

src/components/tooltip/NetworkMarker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
padding-top: 4px;
1212
border-top: 1px solid var(--grey-40);
1313
margin-top: 4px;
14-
grid-gap: 2px 5px;
14+
gap: 2px 5px;
1515

1616
/* When changing the number of columns, don't forget to change the span values
1717
* in grid-column-start properties. */

src/components/tooltip/Tooltip.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
.tooltipDetails {
6868
display: grid;
69-
grid-gap: 2px 5px;
69+
gap: 2px 5px;
7070

7171
/* Make the right column "definitely" sized (ignore its intrinsic size) by setting a min-width of 0.
7272
* This stops long contents from overflowing the tooltip. */
@@ -129,7 +129,7 @@
129129
.sidebar .tooltipDetails {
130130
/* Force the details to the max-width, even if they have long pieces of text. */
131131
overflow: hidden;
132-
grid-gap: 2px 0;
132+
gap: 2px 0;
133133

134134
/* Don't let the width overflow for long pieces of text */
135135
grid-template-columns: minmax(0, 1fr);

src/test/fixtures/mocks/window-navigation.ts

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* This Source Code Form is subject to the terms of the Mozilla Public
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
// @ts-nocheck Complex window/history mock with extensive DOM API manipulation that requires intricate typing
54

65
/**
76
* jsdom leaves the history in place after every test, so the history will
@@ -41,10 +40,19 @@ import { coerceMatchingShape } from '../../../utils/types';
4140
// window.history can change the inner location directly.
4241
const internalLocationAssign = Symbol.for('internalLocationAssign');
4342

43+
type LocationMock = Location & {
44+
assign: (newUrl: string) => void;
45+
[internalLocationAssign]: (newUrl: string) => void;
46+
};
47+
4448
// This symbol will be used in the mock for window.history so that we can reset
4549
// it from tests.
4650
const internalHistoryReset = Symbol.for('internalHistoryReset');
4751

52+
type HistoryMock = History & {
53+
[internalHistoryReset]: () => void;
54+
};
55+
4856
/**
4957
* This mock creates a location API that allows for assigning to the location,
5058
* which we need to be able to do for certain tests.
@@ -59,15 +67,17 @@ function mockWindowLocation(location: string = 'http://localhost') {
5967
url = new URL(newUrl.toString(), url);
6068
}
6169

62-
const nativeLocation = Object.getOwnPropertyDescriptor(window, 'location');
70+
const nativeLocation = Object.getOwnPropertyDescriptor(window, 'location')!;
6371

6472
// It seems node v8 doesn't let us change the value unless we delete it before.
73+
// @ts-expect-error - property must be optional
6574
delete window.location;
6675

6776
const property = {
68-
get(): Partial<Location> {
77+
get(): LocationMock {
6978
return {
7079
toString: () => url.toString(),
80+
// @ts-expect-error - array is not a fully-featured DOMStringList
7181
ancestorOrigins: [],
7282
get href() {
7383
return url.toString();
@@ -134,7 +144,6 @@ function mockWindowLocation(location: string = 'http://localhost') {
134144
newUrl.hash = v;
135145
this.assign(newUrl.toString());
136146
},
137-
// $FlowExpectError Flow doesn't know about symbol properties sadly.
138147
[internalLocationAssign]: internalSetLocation,
139148
assign: (newUrl: string) => window.history.pushState(null, '', newUrl),
140149
reload: jest.fn(),
@@ -148,15 +157,14 @@ function mockWindowLocation(location: string = 'http://localhost') {
148157
},
149158
};
150159

151-
// $FlowExpectError because the value we pass isn't a proper Location object.
152160
Object.defineProperty(window, 'location', property);
153161

154162
// Return a function that resets the mock.
155163
return () => {
156164
// This "delete" call doesn't seem to be necessary, but better do it so that
157165
// we don't have surprises in the future.
166+
// @ts-expect-error - property not optional
158167
delete window.location;
159-
// $FlowExpectError because nativeLocation doesn't match the type expected by Flow.
160168
Object.defineProperty(window, 'location', nativeLocation);
161169
};
162170
}
@@ -165,9 +173,11 @@ function mockWindowLocation(location: string = 'http://localhost') {
165173
* This mock creates a history API that can be thrown away after every use.
166174
*/
167175
function mockWindowHistory() {
168-
const originalHistory = Object.getOwnPropertyDescriptor(window, 'history');
176+
const originalHistory = Object.getOwnPropertyDescriptor(window, 'history')!;
169177

170-
let states, urls, index;
178+
let states = [null];
179+
let urls = [window.location.href];
180+
let index = 0;
171181

172182
function reset() {
173183
states = [null];
@@ -181,7 +191,7 @@ function mockWindowHistory() {
181191
get length() {
182192
return states.length;
183193
},
184-
scrollRestoration: 'auto',
194+
scrollRestoration: 'auto' as const,
185195
get state() {
186196
return states[index] ?? null;
187197
},
@@ -190,8 +200,7 @@ function mockWindowHistory() {
190200
return;
191201
}
192202
index--;
193-
// $FlowExpectError Flow doesn't know about this internal property.
194-
window.location[internalLocationAssign](urls[index]);
203+
(window.location as LocationMock)[internalLocationAssign](urls[index]);
195204
window.dispatchEvent(new Event('popstate'));
196205
},
197206
forward() {
@@ -200,8 +209,7 @@ function mockWindowHistory() {
200209
}
201210
index++;
202211

203-
// $FlowExpectError Flow doesn't know about this internal property.
204-
window.location[internalLocationAssign](urls[index]);
212+
(window.location as LocationMock)[internalLocationAssign](urls[index]);
205213
window.dispatchEvent(new Event('popstate'));
206214
},
207215
go() {
@@ -212,8 +220,7 @@ function mockWindowHistory() {
212220
// Let's assign the URL to the window.location mock. This should also
213221
// make the URL correct if it's relative, we'll get an absolute URL when
214222
// retrieving later through window.location.href.
215-
// $FlowExpectError Flow doesn't know about this internal property.
216-
window.location[internalLocationAssign](url);
223+
(window.location as LocationMock)[internalLocationAssign](url);
217224
}
218225

219226
urls = urls.slice(0, index + 1);
@@ -226,19 +233,18 @@ function mockWindowHistory() {
226233
replaceState(newState: any, _title: string, url?: string) {
227234
if (url) {
228235
// Let's assign the URL to the window.location mock.
229-
// $FlowExpectError Flow doesn't know about this internal property.
230-
window.location[internalLocationAssign](url);
236+
(window.location as LocationMock)[internalLocationAssign](url);
231237
urls[index] = window.location.href;
232238
}
233239

234240
states[index] = newState;
235241
},
236-
// $FlowExpectError Flow doesn't know about symbol properties sadly.
237242
[internalHistoryReset]: reset,
238243
};
239244

240245
// This "delete" call doesn't seem to be necessary, but better do it so that
241246
// we don't have surprises in the future.
247+
// @ts-expect-error - property not optional
242248
delete window.history;
243249
Object.defineProperty(window, 'history', {
244250
value: coerceMatchingShape<History>(history),
@@ -250,8 +256,8 @@ function mockWindowHistory() {
250256
// For unknown reasons, we can't assign back the old descriptor without
251257
// deleting the current one first... Not deleting would keep the mock
252258
// without throwing any error.
259+
// @ts-expect-error - property not optional
253260
delete window.history;
254-
// $FlowExpectError - Flow can't handle getOwnPropertyDescriptor being used on defineProperty.
255261
Object.defineProperty(window, 'history', originalHistory);
256262
};
257263
}
@@ -274,7 +280,7 @@ export function mockFullNavigation({
274280
// window.history for each test. Take a look at the top of this file for more
275281
// information about how to use this.
276282
export function autoMockFullNavigation() {
277-
let cleanup;
283+
let cleanup: ReturnType<typeof mockFullNavigation> | null = null;
278284
beforeEach(() => {
279285
cleanup = mockFullNavigation();
280286
});
@@ -288,8 +294,6 @@ export function autoMockFullNavigation() {
288294
}
289295

290296
export function resetHistoryWithUrl(url: string = window.location.href) {
291-
// $FlowExpectError Flow doesn't know about this internal property.
292-
window.location[internalLocationAssign](url);
293-
// $FlowExpectError Flow doesn't know about this internal property.
294-
window.history[internalHistoryReset]();
297+
(window.location as LocationMock)[internalLocationAssign](url);
298+
(window.history as HistoryMock)[internalHistoryReset]();
295299
}

0 commit comments

Comments
 (0)