Skip to content

Commit d52b3e2

Browse files
authored
Merge branch 'main' into faster-search-filter
2 parents a4d4363 + 4985862 commit d52b3e2

File tree

82 files changed

+709
-410
lines changed

Some content is hidden

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

82 files changed

+709
-410
lines changed

eslint.config.mjs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,25 @@ export default [
140140
'no-else-return': 'error',
141141
'no-nested-ternary': 'error',
142142

143+
'@typescript-eslint/no-unused-vars': [
144+
'error',
145+
{
146+
args: 'all',
147+
argsIgnorePattern: '^_',
148+
caughtErrors: 'all',
149+
caughtErrorsIgnorePattern: '^_',
150+
destructuredArrayIgnorePattern: '^_',
151+
varsIgnorePattern: '^_',
152+
ignoreRestSiblings: true,
153+
},
154+
],
155+
143156
// Use `import type` everywhere we can.
144157
'@typescript-eslint/consistent-type-imports': 'error',
145158
// Allow `as any` escape hatches
146159
'@typescript-eslint/no-explicit-any': 'off',
147160
// Disable a rule that the TypeScript FAQ disapproves of
148161
'@typescript-eslint/no-empty-object-type': 'off',
149-
// Should enable this soon, mostly finds `catch (e)` with unused e
150-
'@typescript-eslint/no-unused-vars': 'off',
151162
// TypeScript imports react-jsx into .tsx files for us
152163
'react/react-in-jsx-scope': 'off',
153164
// Allow @ts-expect-error annotations with descriptions.
@@ -215,22 +226,6 @@ export default [
215226
// Allow require(), for example for importing JSON files.
216227
'@typescript-eslint/no-require-imports': 'off',
217228

218-
// Override the project-wide config to allow @ts-nocheck.
219-
// We really just need this for our mocks.
220-
'@typescript-eslint/ban-ts-comment': [
221-
'error',
222-
{
223-
// Allow @ts-expect-error and @ts-no-check annotations with descriptions.
224-
'ts-expect-error': 'allow-with-description',
225-
'ts-nocheck': 'allow-with-description',
226-
// Don't allow @ts-ignore because we want to be notified
227-
// when the error goes away so we can remove the annotation - use
228-
// @ts-expect-error instead
229-
'ts-ignore': true,
230-
'ts-check': false,
231-
},
232-
],
233-
234229
// Adding more errors now
235230
'testing-library/no-manual-cleanup': 'error',
236231
'testing-library/no-wait-for-snapshot': 'error',

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"escape-string-regexp": "^4.0.0",
8181
"gecko-profiler-demangle": "^0.3.3",
8282
"idb": "^8.0.3",
83+
"iongraph-web": "0.1.4",
8384
"jszip": "^3.10.1",
8485
"long": "^5.3.2",
8586
"memoize-immutable": "^3.0.0",
@@ -130,8 +131,8 @@
130131
"@types/react-transition-group": "^4.4.5",
131132
"@types/redux-logger": "^3.0.6",
132133
"@types/tgwf__co2": "^0.14.2",
133-
"@typescript-eslint/eslint-plugin": "^8.38.0",
134-
"@typescript-eslint/parser": "^8.38.0",
134+
"@typescript-eslint/eslint-plugin": "^8.41.0",
135+
"@typescript-eslint/parser": "^8.41.0",
135136
"alex": "^11.0.1",
136137
"autoprefixer": "^10.4.21",
137138
"babel-jest": "^30.0.5",
@@ -154,7 +155,7 @@
154155
"eslint-plugin-jest-dom": "^5.5.0",
155156
"eslint-plugin-jest-formatting": "^3.1.0",
156157
"eslint-plugin-react": "^7.37.5",
157-
"eslint-plugin-testing-library": "^7.6.3",
158+
"eslint-plugin-testing-library": "^7.6.6",
158159
"espree": "^10.4.0",
159160
"fake-indexeddb": "^6.1.0",
160161
"file-loader": "^6.2.0",
@@ -179,7 +180,7 @@
179180
"raw-loader": "^4.0.2",
180181
"rimraf": "^5.0.10",
181182
"style-loader": "^4.0.0",
182-
"stylelint": "^16.23.0",
183+
"stylelint": "^16.23.1",
183184
"stylelint-config-idiomatic-order": "^10.0.0",
184185
"stylelint-config-standard": "^39.0.0",
185186
"typescript": "^5.8.3",
@@ -206,7 +207,7 @@
206207
"tsx"
207208
],
208209
"transformIgnorePatterns": [
209-
"/node_modules/(?!(query-string|decode-uri-component|split-on-first|filter-obj|@fetch-mock/jest|fetch-mock)/)"
210+
"/node_modules/(?!(query-string|decode-uri-component|iongraph-web|split-on-first|filter-obj|@fetch-mock/jest|fetch-mock)/)"
210211
],
211212
"moduleNameMapper": {
212213
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ftl)$": "<rootDir>/src/test/fixtures/mocks/file-mock.ts",

profile-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const path = require('path');
88
module.exports = {
99
serveAndOpen(host, profilerUrl, profilePath, openOptions) {
1010
// Create a simple http server serving the profile file.
11-
const profileServer = http.createServer((req, res) => {
11+
const profileServer = http.createServer((_req, res) => {
1212
res.setHeader('Access-Control-Allow-Origin', profilerUrl);
1313
const fileStream = fs.createReadStream(profilePath);
1414
fileStream.pipe(res);

src/actions/profile-view.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,13 +1749,17 @@ export function changeShowJsTracerSummary(
17491749
}
17501750

17511751
export function updatePreviewSelection(
1752-
previewSelection: PreviewSelection
1752+
previewSelection: PreviewSelection | null
17531753
): ThunkAction<void> {
17541754
return (dispatch, getState) => {
1755+
// Only dispatch if the selection changes. This function can fire in a tight loop,
1756+
// and this check saves a dispatch.
17551757
const currentPreviewSelection = getPreviewSelection(getState());
1756-
if (!objectShallowEquals(currentPreviewSelection, previewSelection)) {
1757-
// Only dispatch if the selection changes. This function can fire in a tight loop,
1758-
// and this check saves a dispatch.
1758+
if (
1759+
!currentPreviewSelection ||
1760+
!previewSelection ||
1761+
!objectShallowEquals(currentPreviewSelection, previewSelection)
1762+
) {
17591763
dispatch({
17601764
type: 'UPDATE_PREVIEW_SELECTION',
17611765
previewSelection,

src/app-logic/create-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function initializeStore(): Store {
1818
if (process.env.NODE_ENV === 'development') {
1919
loggerMiddleware = createLogger({
2020
collapsed: true,
21-
titleFormatter: (action, time, duration) =>
21+
titleFormatter: (action, _time, duration) =>
2222
`[action] ${action.type} (in ${duration.toFixed(2)} ms)`,
2323
logErrors: false,
2424
duration: true,

src/components/app/AppLocalizationProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class AppLocalizationInit extends React.PureComponent<InitProps> {
137137
console.warn(
138138
`The stored locale information (${strPreviouslyRequestedLocales}) looks incorrect.`
139139
);
140-
} catch (e) {
140+
} catch (_e) {
141141
console.warn(
142142
`We got an error when trying to parse the previously stored locale information (${strPreviouslyRequestedLocales}).`
143143
);

src/components/app/BottomBox.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import classNames from 'classnames';
99
import { SourceView } from '../shared/SourceView';
1010
import { AssemblyView } from '../shared/AssemblyView';
1111
import { AssemblyViewToggleButton } from './AssemblyViewToggleButton';
12+
import { IonGraphView } from '../shared/IonGraphView';
1213
import { CodeLoadingOverlay } from './CodeLoadingOverlay';
1314
import { CodeErrorOverlay } from './CodeErrorOverlay';
1415
import {
@@ -28,7 +29,7 @@ import {
2829
getSourceViewCode,
2930
getAssemblyViewCode,
3031
} from 'firefox-profiler/selectors/code';
31-
import { getPreviewSelection } from 'firefox-profiler/selectors/profile';
32+
import { getPreviewSelectionIsBeingModified } from 'firefox-profiler/selectors/profile';
3233
import explicitConnect from 'firefox-profiler/utils/connect';
3334

3435
import type { ConnectedProps } from 'firefox-profiler/utils/connect';
@@ -177,6 +178,9 @@ class BottomBoxImpl extends React.PureComponent<Props> {
177178
assemblyViewCode && assemblyViewCode.type === 'AVAILABLE'
178179
? assemblyViewCode.instructions
179180
: [];
181+
const sourceIsIonGraph = path !== null && path.endsWith('iongraph.json');
182+
const displaySourceView = sourceViewFile !== null && !sourceIsIonGraph;
183+
const displayIonGraph = sourceViewFile !== null && sourceIsIonGraph;
180184

181185
// The bottom box has one or more side-by-side panes.
182186
// At the moment it always has either one or two panes:
@@ -211,7 +215,14 @@ class BottomBoxImpl extends React.PureComponent<Props> {
211215
{assemblyViewIsOpen ? null : trailingHeaderButtons}
212216
</div>
213217
<div className="bottom-sourceview-wrapper">
214-
{sourceViewFile !== null ? (
218+
{displayIonGraph ? (
219+
<IonGraphView
220+
timings={globalLineTimings}
221+
hotSpotTimings={selectedCallNodeLineTimings}
222+
sourceCode={sourceCode}
223+
/>
224+
) : null}
225+
{displaySourceView ? (
215226
<SourceView
216227
disableOverscan={disableOverscan}
217228
timings={globalLineTimings}
@@ -295,7 +306,7 @@ export const BottomBox = explicitConnect<{}, StateProps, DispatchProps>({
295306
selectedNodeSelectors.getAssemblyViewAddressTimings(state),
296307
assemblyViewScrollGeneration: getAssemblyViewScrollGeneration(state),
297308
assemblyViewIsOpen: getAssemblyViewIsOpen(state),
298-
disableOverscan: getPreviewSelection(state).isModifying,
309+
disableOverscan: getPreviewSelectionIsBeingModified(state),
299310
}),
300311
mapDispatchToProps: {
301312
closeBottomBox,

src/components/app/CodeLoadingOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function CodeLoadingOverlay({ source }: CodeLoadingOverlayProps) {
1717
let host;
1818
try {
1919
host = new URL(url).host;
20-
} catch (e) {
20+
} catch (_e) {
2121
host = url;
2222
}
2323
return (

src/components/app/ProfileFilterNavigator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const ProfileFilterNavigator = explicitConnect<
187187
const items = getCommittedRangeLabels(state);
188188
const previewSelection = getPreviewSelection(state);
189189
const profileTimelineUnit = getProfileTimelineUnit(state);
190-
const uncommittedItem = previewSelection.hasSelection
190+
const uncommittedItem = previewSelection
191191
? getFormattedTimelineValue(
192192
previewSelection.selectionEnd - previewSelection.selectionStart,
193193
profileTimelineUnit

src/components/calltree/CallTree.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import {
1717
getScrollToSelectionGeneration,
1818
getFocusCallTreeGeneration,
19-
getPreviewSelection,
19+
getPreviewSelectionIsBeingModified,
2020
getCategories,
2121
getCurrentTableViewOptions,
2222
} from 'firefox-profiler/selectors/profile';
@@ -410,7 +410,7 @@ export const CallTree = explicitConnect<{}, StateProps, DispatchProps>({
410410
expandedCallNodeIndexes:
411411
selectedThreadSelectors.getExpandedCallNodeIndexes(state),
412412
searchStringsRegExp: getSearchStringsAsRegExp(state),
413-
disableOverscan: getPreviewSelection(state).isModifying,
413+
disableOverscan: getPreviewSelectionIsBeingModified(state),
414414
invertCallstack: getInvertCallstack(state),
415415
implementationFilter: getImplementationFilter(state),
416416
// Use the filtered call node max depth, rather than the preview filtered call node

0 commit comments

Comments
 (0)