Skip to content

Commit 9c5bd58

Browse files
authored
core: deprecate preloadCode calls with multiple arguments (#11266)
related to #11259 and #10398
1 parent cacdae3 commit 9c5bd58

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/warm-impalas-thank.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
chore: deprecate `preloadCode` calls with multiple arguments

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ export function create_client(app, target) {
277277

278278
/** @param {...string} pathnames */
279279
async function preload_code(...pathnames) {
280+
if (DEV && pathnames.length > 1) {
281+
console.warn('Calling `preloadCode` with multiple arguments is deprecated');
282+
}
283+
280284
const matching = routes.filter((route) => pathnames.some((pathname) => route.exec(pathname)));
281285

282286
const promises = matching.map((r) => {

0 commit comments

Comments
 (0)