Skip to content

Commit

Permalink
core: deprecate preloadCode calls with multiple arguments (#11266)
Browse files Browse the repository at this point in the history
related to #11259 and #10398
  • Loading branch information
Rich-Harris committed Dec 12, 2023
1 parent cacdae3 commit 9c5bd58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-impalas-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

chore: deprecate `preloadCode` calls with multiple arguments
4 changes: 4 additions & 0 deletions packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ export function create_client(app, target) {

/** @param {...string} pathnames */
async function preload_code(...pathnames) {
if (DEV && pathnames.length > 1) {
console.warn('Calling `preloadCode` with multiple arguments is deprecated');
}

const matching = routes.filter((route) => pathnames.some((pathname) => route.exec(pathname)));

const promises = matching.map((r) => {
Expand Down

0 comments on commit 9c5bd58

Please sign in to comment.