@sveltejs/kit 1.0.0-next.388 → 1.0.0-next.389

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -690,6 +690,10 @@ function create_client({ target, session, base, trailing_slash }) {
690
690
  return false; // unnecessary, but TypeScript prefers it this way
691
691
  }
692
692
 
693
+ // if this is an internal navigation intent, use the normalized
694
+ // URL for the rest of the function
695
+ url = intent?.url || url;
696
+
693
697
  // abort if user navigated during update
694
698
  if (token !== current_token) return false;
695
699
 
@@ -1343,9 +1347,12 @@ function create_client({ target, session, base, trailing_slash }) {
1343
1347
  const params = route.exec(path);
1344
1348
 
1345
1349
  if (params) {
1346
- const id = normalize_path(url.pathname, trailing_slash) + url.search;
1350
+ const normalized = new URL(
1351
+ url.origin + normalize_path(url.pathname, trailing_slash) + url.search + url.hash
1352
+ );
1353
+ const id = normalized.pathname + normalized.search;
1347
1354
  /** @type {import('./types').NavigationIntent} */
1348
- const intent = { id, route, params: decode_params(params), url };
1355
+ const intent = { id, route, params: decode_params(params), url: normalized };
1349
1356
  return intent;
1350
1357
  }
1351
1358
  }
@@ -1382,9 +1389,6 @@ function create_client({ target, session, base, trailing_slash }) {
1382
1389
  return;
1383
1390
  }
1384
1391
 
1385
- const pathname = normalize_path(url.pathname, trailing_slash);
1386
- const normalized = new URL(url.origin + pathname + url.search + url.hash);
1387
-
1388
1392
  update_scroll_positions(current_history_index);
1389
1393
 
1390
1394
  accepted();
@@ -1392,12 +1396,12 @@ function create_client({ target, session, base, trailing_slash }) {
1392
1396
  if (started) {
1393
1397
  stores.navigating.set({
1394
1398
  from: current.url,
1395
- to: normalized
1399
+ to: url
1396
1400
  });
1397
1401
  }
1398
1402
 
1399
1403
  await update(
1400
- normalized,
1404
+ url,
1401
1405
  redirect_chain,
1402
1406
  false,
1403
1407
  {
@@ -1406,7 +1410,7 @@ function create_client({ target, session, base, trailing_slash }) {
1406
1410
  details
1407
1411
  },
1408
1412
  () => {
1409
- const navigation = { from, to: normalized };
1413
+ const navigation = { from, to: url };
1410
1414
  callbacks.after_navigate.forEach((fn) => fn(navigation));
1411
1415
 
1412
1416
  stores.navigating.set(null);
package/dist/cli.js CHANGED
@@ -18,7 +18,7 @@ function handle_error(e) {
18
18
  process.exit(1);
19
19
  }
20
20
 
21
- const prog = sade('svelte-kit').version('1.0.0-next.388');
21
+ const prog = sade('svelte-kit').version('1.0.0-next.389');
22
22
 
23
23
  prog
24
24
  .command('package')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.388",
3
+ "version": "1.0.0-next.389",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",