Skip to content

Commit c475b13

Browse files
committed
ref: Better name for the option
We're not doing a page reload, but a full page navigation.
1 parent 699078c commit c475b13

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.github/workflows/ci-cd.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ jobs:
121121
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
122122

123123
e2e-react:
124-
name: E2E (react-reload-${{ matrix.reload-on-shallow-false }})
124+
name: E2E (react-fpn-${{ matrix.full-page-nav-on-shallow-false }})
125125
runs-on: ubuntu-22.04-arm
126126
needs: [ci-core]
127127
strategy:
128128
fail-fast: false
129129
matrix:
130-
reload-on-shallow-false: [false, true]
130+
full-page-nav-on-shallow-false: [false, true]
131131
steps:
132132
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
133133
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
@@ -143,19 +143,19 @@ jobs:
143143
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
144144
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
145145
E2E_NO_CACHE_ON_RERUN: ${{ github.run_attempt }}
146-
RELOAD_ON_SHALLOW_FALSE: ${{ matrix.reload-on-shallow-false }}
146+
FULL_PAGE_NAV_ON_SHALLOW_FALSE: ${{ matrix.full-page-nav-on-shallow-false }}
147147
- name: Save Cypress artifacts
148148
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
149149
if: failure()
150150
with:
151151
path: packages/e2e/react/cypress/screenshots
152-
name: ci-react-reload-${{ matrix.reload-on-shallow-false }}
152+
name: ci-react-fpn-${{ matrix.full-page-nav-on-shallow-false }}
153153
- uses: 47ng/actions-slack-notify@main
154154
name: Notify on Slack
155155
if: failure()
156156
with:
157157
status: ${{ job.status }}
158-
jobName: react-reload-${{ matrix.reload-on-shallow-false }}
158+
jobName: react-fpn-${{ matrix.full-page-nav-on-shallow-false }}
159159
env:
160160
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
161161

packages/docs/content/docs/adapters.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ updating query state configured with `shallow: false{:ts}`, to notify the web se
9494
that the URL state has changed, if it needs it for server-side rendering other
9595
parts of the application than the static React bundle:
9696

97-
```tsx title="src/main.tsx" /reloadPageOnShallowFalseUpdates/
97+
```tsx title="src/main.tsx" /fullPageNavigationOnShallowFalseUpdates/
9898
createRoot(document.getElementById('root')!).render(
99-
<NuqsAdapter reloadPageOnShallowFalseUpdates>
99+
<NuqsAdapter fullPageNavigationOnShallowFalseUpdates>
100100
<App />
101101
</NuqsAdapter>
102102
)

packages/e2e/react/src/main.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ enableHistorySync()
99
createRoot(document.getElementById('root')!).render(
1010
<StrictMode>
1111
<NuqsAdapter
12-
reloadPageOnShallowFalseUpdates={
13-
process.env.RELOAD_ON_SHALLOW_FALSE === 'true'
12+
fullPageNavigationOnShallowFalseUpdates={
13+
process.env.FULL_PAGE_NAV_ON_SHALLOW_FALSE === 'true'
1414
}
1515
>
1616
<RootLayout>

packages/e2e/react/vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default defineConfig(({ mode }) => {
1111
sourcemap: true
1212
},
1313
define: {
14-
'process.env.RELOAD_ON_SHALLOW_FALSE': JSON.stringify(
15-
env.RELOAD_ON_SHALLOW_FALSE
14+
'process.env.FULL_PAGE_NAV_ON_SHALLOW_FALSE': JSON.stringify(
15+
env.FULL_PAGE_NAV_ON_SHALLOW_FALSE
1616
)
1717
}
1818
}

packages/nuqs/src/adapters/react.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { patchHistory, type SearchParamsSyncEmitter } from './lib/patch-history'
1515

1616
const emitter: SearchParamsSyncEmitter = mitt()
1717

18-
function generateUpdateUrlFn(reloadPageOnShallowFalseUpdates: boolean) {
18+
function generateUpdateUrlFn(fullPageNavigationOnShallowFalseUpdates: boolean) {
1919
return function updateUrl(search: URLSearchParams, options: AdapterOptions) {
2020
const url = new URL(location.href)
2121
url.search = renderQueryString(search)
22-
if (reloadPageOnShallowFalseUpdates && options.shallow === false) {
22+
if (fullPageNavigationOnShallowFalseUpdates && options.shallow === false) {
2323
const method =
2424
options.history === 'push' ? location.assign : location.replace
2525
method.call(location, url)
@@ -36,11 +36,11 @@ function generateUpdateUrlFn(reloadPageOnShallowFalseUpdates: boolean) {
3636
}
3737

3838
const NuqsReactAdapterContext = createContext({
39-
reloadPageOnShallowFalseUpdates: false
39+
fullPageNavigationOnShallowFalseUpdates: false
4040
})
4141

4242
function useNuqsReactAdapter() {
43-
const { reloadPageOnShallowFalseUpdates } = useContext(
43+
const { fullPageNavigationOnShallowFalseUpdates } = useContext(
4444
NuqsReactAdapterContext
4545
)
4646
const [searchParams, setSearchParams] = useState(() => {
@@ -63,8 +63,8 @@ function useNuqsReactAdapter() {
6363
}
6464
}, [])
6565
const updateUrl = useMemo(
66-
() => generateUpdateUrlFn(reloadPageOnShallowFalseUpdates),
67-
[reloadPageOnShallowFalseUpdates]
66+
() => generateUpdateUrlFn(fullPageNavigationOnShallowFalseUpdates),
67+
[fullPageNavigationOnShallowFalseUpdates]
6868
)
6969
return {
7070
searchParams,
@@ -76,14 +76,14 @@ const NuqsReactAdapter = createAdapterProvider(useNuqsReactAdapter)
7676

7777
export function NuqsAdapter({
7878
children,
79-
reloadPageOnShallowFalseUpdates = false
79+
fullPageNavigationOnShallowFalseUpdates = false
8080
}: {
8181
children: ReactNode
82-
reloadPageOnShallowFalseUpdates?: boolean
82+
fullPageNavigationOnShallowFalseUpdates?: boolean
8383
}) {
8484
return createElement(
8585
NuqsReactAdapterContext.Provider,
86-
{ value: { reloadPageOnShallowFalseUpdates } },
86+
{ value: { fullPageNavigationOnShallowFalseUpdates } },
8787
createElement(NuqsReactAdapter, null, children)
8888
)
8989
}

turbo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"outputs": ["dist/**", "cypress/**"],
3636
"dependsOn": ["^build"],
3737
"env": [
38-
"RELOAD_ON_SHALLOW_FALSE",
38+
"FULL_PAGE_NAV_ON_SHALLOW_FALSE",
3939
"REACT_COMPILER",
4040
"E2E_NO_CACHE_ON_RERUN"
4141
]

0 commit comments

Comments
 (0)