Skip to content

Commit ff8b4bb

Browse files
committed
remove config since will be on the 2.0 milestone
1 parent d72cac9 commit ff8b4bb

File tree

11 files changed

+9
-34
lines changed

11 files changed

+9
-34
lines changed

documentation/docs/20-core-concepts/20-load.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ A `load` function that calls `await parent()` will also rerun if a parent `load`
548548

549549
Dependency tracking does not apply _after_ the `load` function has returned — for example, accessing `params.x` inside a nested [promise](#streaming-with-promises) will not cause the function to rerun when `params.x` changes. (Don't worry, you'll get a warning in development if you accidentally do this.) Instead, access the parameter in the main body of your `load` function.
550550

551-
When setting the `kit.fineGrainedSearchParamsInvalidation` option in your `svelte.config.js` to `true`, accessing a query parameter is tracked independently from the rest of the url. For example, accessing `event.url.searchParams.get("query")` inside a `load` function will make that `load` function rerun only when the `query` search param changes: Navigating from `/search?query=svelte&page=1` to `/search?query=svelte&page=2` will not rerun the load function.
551+
Accessing a query parameter is tracked independently from the rest of the url. For example, accessing `event.url.searchParams.get("query")` inside a `load` function will make that `load` function rerun only when the `query` search param changes: Navigating from `/search?query=svelte&page=1` to `/search?query=svelte&page=2` will not rerun the load function.
552552

553553
### Manual invalidation
554554

@@ -599,7 +599,7 @@ To summarize, a `load` function will rerun in the following situations:
599599

600600
- It references a property of `params` whose value has changed
601601
- It references a property of `url` (such as `url.pathname` or `url.search`) whose value has changed. Properties in `request.url` are _not_ tracked
602-
- It calls `url.searchParams.get`, `url.searchParams.getAll` or `url.searchParams.has` and the specific search param passed to those functions changes. Accessing other properties of searchParams will have the same effect as accessing `url.search`. When `fineGrainedSearchParamsInvalidation` is `false`, accessing _any_ search param will cause the load function to rerun.
602+
- It calls `url.searchParams.get`, `url.searchParams.getAll` or `url.searchParams.has` and the specific search param passed to those functions changes. Accessing other properties of searchParams will have the same effect as accessing `url.search`.
603603
- It calls `await parent()` and a parent `load` function reran
604604
- It declared a dependency on a specific URL via [`fetch`](#making-fetch-requests) (universal load only) or [`depends`](types#public-types-loadevent), and that URL was marked invalid with [`invalidate(url)`](modules#$app-navigation-invalidate)
605605
- All active `load` functions were forcibly rerun with [`invalidateAll()`](modules#$app-navigation-invalidateall)

packages/kit/src/core/config/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ const get_defaults = (prefix = '') => ({
113113
version: {
114114
name: Date.now().toString(),
115115
pollInterval: 0
116-
},
117-
fineGrainedSearchParamsInvalidation: false
116+
}
118117
}
119118
});
120119

packages/kit/src/core/config/options.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,7 @@ const options = object(
280280
version: object({
281281
name: string(Date.now().toString()),
282282
pollInterval: number(0)
283-
}),
284-
// TODO v2: remove this option (always true)
285-
fineGrainedSearchParamsInvalidation: boolean(false)
283+
})
286284
})
287285
},
288286
true

packages/kit/src/core/sync/write_server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { set_private_env, set_public_env } from '${runtime_directory}/shared-ser
3434
export const options = {
3535
app_template_contains_nonce: ${template.includes('%sveltekit.nonce%')},
3636
csp: ${s(config.kit.csp)},
37-
fine_grained_search_params_invalidation: ${config.kit.fineGrainedSearchParamsInvalidation},
3837
csrf_check_origin: ${s(config.kit.csrf.checkOrigin)},
3938
track_server_fetches: ${s(config.kit.dangerZone.trackServerFetches)},
4039
embedded: ${config.kit.embedded},

packages/kit/src/exports/public.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,6 @@ export interface KitConfig {
628628
*/
629629
pollInterval?: number;
630630
};
631-
/**
632-
* When set to `true`, accessing `searchParams` on the `url` object tracks just that specific searchParam and not the whole URL, resulting in less load function reruns.
633-
* This option will be removed and always be `true` in SvelteKit version 2.
634-
* @default false
635-
*/
636-
fineGrainedSearchParamsInvalidation?: boolean;
637631
}
638632

639633
/**

packages/kit/src/exports/vite/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,7 @@ function kit({ svelte_config }) {
291291
__SVELTEKIT_APP_VERSION_FILE__: s(`${kit.appDir}/version.json`),
292292
__SVELTEKIT_APP_VERSION_POLL_INTERVAL__: s(kit.version.pollInterval),
293293
__SVELTEKIT_DEV__: 'false',
294-
__SVELTEKIT_EMBEDDED__: kit.embedded ? 'true' : 'false',
295-
__SVELTEKIT_ENABLE_FINE_GRAINED_PARAMS_INVALIDATION__:
296-
kit.fineGrainedSearchParamsInvalidation ? 'true' : 'false'
294+
__SVELTEKIT_EMBEDDED__: kit.embedded ? 'true' : 'false'
297295
};
298296

299297
if (!secondary_build_started) {
@@ -303,9 +301,7 @@ function kit({ svelte_config }) {
303301
new_config.define = {
304302
__SVELTEKIT_APP_VERSION_POLL_INTERVAL__: '0',
305303
__SVELTEKIT_DEV__: 'true',
306-
__SVELTEKIT_EMBEDDED__: kit.embedded ? 'true' : 'false',
307-
__SVELTEKIT_ENABLE_FINE_GRAINED_PARAMS_INVALIDATION__:
308-
kit.fineGrainedSearchParamsInvalidation ? 'true' : 'false'
304+
__SVELTEKIT_EMBEDDED__: kit.embedded ? 'true' : 'false'
309305
};
310306

311307
// These Kit dependencies are packaged as CommonJS, which means they must always be externalized.

packages/kit/src/runtime/client/client.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,7 @@ export function create_client(app, target) {
485485
uses.url = true;
486486
},
487487
(search_param) => {
488-
if (__SVELTEKIT_ENABLE_FINE_GRAINED_PARAMS_INVALIDATION__) {
489-
uses.search_params.add(search_param);
490-
} else {
491-
uses.url = true;
492-
}
488+
uses.search_params.add(search_param);
493489
}
494490
),
495491
async fetch(resource, init) {

packages/kit/src/runtime/server/page/load_data.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ export async function load_server_data({
5252
`${node.server_id}: Accessing URL properties in a promise handler after \`load(...)\` has returned will not cause the function to re-run when the URL changes`
5353
);
5454
}
55-
if (__SVELTEKIT_ENABLE_FINE_GRAINED_PARAMS_INVALIDATION__) {
56-
uses.search_params.add(search_params);
57-
} else {
58-
uses.url = true;
59-
}
55+
uses.search_params.add(search_params);
6056
}
6157
);
6258

packages/kit/src/types/ambient-private.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ declare global {
44
const __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: number;
55
const __SVELTEKIT_DEV__: boolean;
66
const __SVELTEKIT_EMBEDDED__: boolean;
7-
const __SVELTEKIT_ENABLE_FINE_GRAINED_PARAMS_INVALIDATION__: boolean;
87
var Bun: object;
98
var Deno: object;
109
}

packages/kit/src/types/internal.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ export type SSRNodeLoader = () => Promise<SSRNode>;
332332
export interface SSROptions {
333333
app_template_contains_nonce: boolean;
334334
csp: ValidatedConfig['kit']['csp'];
335-
fine_grained_search_params_invalidation?: boolean;
336335
csrf_check_origin: boolean;
337336
track_server_fetches: boolean;
338337
embedded: boolean;

packages/kit/test/apps/basics/svelte.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const config = {
77

88
version: {
99
name: 'TEST_VERSION'
10-
},
11-
fineGrainedSearchParamsInvalidation: true
10+
}
1211
}
1312
};
1413

0 commit comments

Comments
 (0)