Skip to content

Commit 499025b

Browse files
ui: Using nuqs default options to enforce history behaviour (#6374)
* Using nuqs default options to enforce history behaviour * [pre-commit.ci lite] apply automatic fixes * touch * [pre-commit.ci lite] apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent fb7962c commit 499025b

22 files changed

Lines changed: 2922 additions & 11769 deletions

File tree

ui/.eslintrc.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ plugins:
3030
- '@typescript-eslint'
3131
- react-hooks
3232
- typescript-enum
33-
- local-rules
3433

3534
settings:
3635
import/resolver:
@@ -76,13 +75,3 @@ rules:
7675
import/export: 2
7776

7877
promise/catch-or-return: [error, {allowFinally: true}]
79-
80-
# Profiler URL state must be back-button friendly: every writable nuqs param has
81-
# to declare its history mode explicitly (push for user actions, replace for
82-
# seeding/reset). Rule lives in eslint-local-rules/index.cjs.
83-
overrides:
84-
- files:
85-
- 'packages/shared/profile/**/*.ts'
86-
- 'packages/shared/profile/**/*.tsx'
87-
rules:
88-
local-rules/require-nuqs-history: error

ui/eslint-local-rules/index.cjs

Lines changed: 0 additions & 139 deletions
This file was deleted.

ui/eslint-local-rules/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"eslint-plugin-import": "2.32.0",
7979
"eslint-plugin-jest": "26.9.0",
8080
"eslint-plugin-jest-dom": "4.0.3",
81-
"eslint-plugin-local-rules": "^3.0.2",
8281
"eslint-plugin-n": "15.7.0",
8382
"eslint-plugin-prettier": "5.5.5",
8483
"eslint-plugin-promise": "6.6.0",

ui/packages/app/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"lodash.debounce": "4.0.8",
4747
"lodash.throttle": "^4.1.1",
4848
"moment": "2.30.1",
49-
"nuqs": "^2.4.1",
49+
"nuqs": "^2.9.0",
5050
"postcss": "8.5.10",
5151
"postcss-flexbugs-fixes": "5.0.2",
5252
"postcss-preset-env": "8.5.1",

ui/packages/app/web/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const App = () => {
6969
<Provider store={reduxStore}>
7070
<PersistGate loading={null} persistor={persistor}>
7171
<BrowserRouter basename={getBasename()}>
72-
<NuqsAdapter>
72+
<NuqsAdapter defaultOptions={{history: 'push'}}>
7373
<QueryClientProvider client={queryClient}>
7474
<ThemeProvider>
7575
<Header />

ui/packages/shared/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"graphviz-wasm": "3.0.2",
3838
"lodash": "^4.17.21",
3939
"moment-timezone": "^0.6.0",
40-
"nuqs": "^2.4.1",
40+
"nuqs": "^2.9.0",
4141
"react-datepicker": "6.9.0",
4242
"react-popper": "^2.3.0",
4343
"react-textarea-autosize": "^8.4.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Parca Profile Libraries
1+
## Parca Profile Libraries

ui/packages/shared/profile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"graphviz-wasm": "3.0.2",
4343
"lodash.throttle": "^4.1.1",
4444
"lz4js": "^0.2.0",
45-
"nuqs": "^2.4.1",
45+
"nuqs": "^2.9.0",
4646
"react": "18.3.1",
4747
"react-beautiful-dnd": "^13.1.1",
4848
"react-contexify": "^6.0.0",

ui/packages/shared/profile/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,11 @@ export const useGraphTooltipMetaInfo = ({table, row}: Props): GraphTooltipMetaIn
105105

106106
const {dashboardItems, setDashboardItems} = useDashboardItems();
107107

108-
const [_unusedBuildId, setSourceBuildId] = useQueryState(
109-
'source_buildid',
110-
stringParam.withOptions({history: 'push'})
111-
);
108+
const [_unusedBuildId, setSourceBuildId] = useQueryState('source_buildid', stringParam);
112109

113-
const [_unusedFilename, setSourceFilename] = useQueryState(
114-
'source_filename',
115-
stringParam.withOptions({history: 'push'})
116-
);
110+
const [_unusedFilename, setSourceFilename] = useQueryState('source_filename', stringParam);
117111

118-
const [_unusedLine, setSourceLine] = useQueryState(
119-
'source_line',
120-
stringParam.withOptions({history: 'push'})
121-
);
112+
const [_unusedLine, setSourceLine] = useQueryState('source_line', stringParam);
122113

123114
const openFile = (): void => {
124115
setDashboardItems([dashboardItems[0], 'source']);

0 commit comments

Comments
 (0)