Skip to content

Commit

Permalink
deprecate preloadCode calls with multiple arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 11, 2023
1 parent cacdae3 commit 0cec51d
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
@@ -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
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 0cec51d

Please sign in to comment.