@sveltejs/kit 1.0.0-next.284 → 1.0.0-next.285
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.
- package/assets/client/start.js +14 -15
- package/assets/server/index.js +0 -2
- package/dist/cli.js +2 -2
- package/package.json +1 -1
package/assets/client/start.js
CHANGED
|
@@ -445,20 +445,13 @@ class Router {
|
|
|
445
445
|
|
|
446
446
|
accepted();
|
|
447
447
|
|
|
448
|
-
if (!this.navigating) {
|
|
449
|
-
dispatchEvent(new CustomEvent('sveltekit:navigation-start'));
|
|
450
|
-
}
|
|
451
448
|
this.navigating++;
|
|
452
449
|
|
|
453
450
|
const pathname = normalize_path(url.pathname, this.trailing_slash);
|
|
454
451
|
|
|
455
452
|
info.url = new URL(url.origin + pathname + url.search + url.hash);
|
|
456
453
|
|
|
457
|
-
|
|
458
|
-
const change = details.replaceState ? 0 : 1;
|
|
459
|
-
details.state['sveltekit:index'] = this.current_history_index += change;
|
|
460
|
-
history[details.replaceState ? 'replaceState' : 'pushState'](details.state, '', info.url);
|
|
461
|
-
}
|
|
454
|
+
const token = (this.navigating_token = {});
|
|
462
455
|
|
|
463
456
|
await this.renderer.handle_navigation(info, chain, false, {
|
|
464
457
|
scroll,
|
|
@@ -466,12 +459,19 @@ class Router {
|
|
|
466
459
|
});
|
|
467
460
|
|
|
468
461
|
this.navigating--;
|
|
469
|
-
if (!this.navigating) {
|
|
470
|
-
dispatchEvent(new CustomEvent('sveltekit:navigation-end'));
|
|
471
462
|
|
|
463
|
+
// navigation was aborted
|
|
464
|
+
if (this.navigating_token !== token) return;
|
|
465
|
+
if (!this.navigating) {
|
|
472
466
|
const navigation = { from, to: url };
|
|
473
467
|
this.callbacks.after_navigate.forEach((fn) => fn(navigation));
|
|
474
468
|
}
|
|
469
|
+
|
|
470
|
+
if (details) {
|
|
471
|
+
const change = details.replaceState ? 0 : 1;
|
|
472
|
+
details.state['sveltekit:index'] = this.current_history_index += change;
|
|
473
|
+
history[details.replaceState ? 'replaceState' : 'pushState'](details.state, '', info.url);
|
|
474
|
+
}
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
|
|
@@ -898,11 +898,10 @@ class Renderer {
|
|
|
898
898
|
});
|
|
899
899
|
} else {
|
|
900
900
|
if (this.router) {
|
|
901
|
-
this.router.goto(
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
);
|
|
901
|
+
this.router.goto(new URL(navigation_result.redirect, info.url).href, {}, [
|
|
902
|
+
...chain,
|
|
903
|
+
info.url.pathname
|
|
904
|
+
]);
|
|
906
905
|
} else {
|
|
907
906
|
location.href = new URL(navigation_result.redirect, location.href).href;
|
|
908
907
|
}
|
package/assets/server/index.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -998,7 +998,7 @@ async function launch(port, https) {
|
|
|
998
998
|
exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
const prog = sade('svelte-kit').version('1.0.0-next.
|
|
1001
|
+
const prog = sade('svelte-kit').version('1.0.0-next.285');
|
|
1002
1002
|
|
|
1003
1003
|
prog
|
|
1004
1004
|
.command('dev')
|
|
@@ -1156,7 +1156,7 @@ async function check_port(port) {
|
|
|
1156
1156
|
function welcome({ port, host, https, open, loose, allow, cwd }) {
|
|
1157
1157
|
if (open) launch(port, https);
|
|
1158
1158
|
|
|
1159
|
-
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.
|
|
1159
|
+
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.285'}\n`));
|
|
1160
1160
|
|
|
1161
1161
|
const protocol = https ? 'https:' : 'http:';
|
|
1162
1162
|
const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
|