@sveltejs/kit 1.0.0-next.181 → 1.0.0-next.185

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.
@@ -156,10 +156,12 @@ class Router {
156
156
 
157
157
  const i1 = url_string.indexOf('#');
158
158
  const i2 = location.href.indexOf('#');
159
- if (i1 > 0 && i2 > 0 && url_string.substring(0, i1) === location.href.substring(0, i2)) {
159
+ const u1 = i1 >= 0 ? url_string.substring(0, i1) : url_string;
160
+ const u2 = i2 >= 0 ? location.href.substring(0, i2) : location.href;
161
+ history.pushState({}, '', url.href);
162
+ if (u1 === u2) {
160
163
  window.dispatchEvent(new HashChangeEvent('hashchange'));
161
164
  }
162
- history.pushState({}, '', url.href);
163
165
  this._navigate(url, noscroll ? scroll_state() : null, false, [], url.hash);
164
166
  event.preventDefault();
165
167
  });
@@ -582,7 +582,7 @@ async function build_client({
582
582
  input[name] = resolved;
583
583
  });
584
584
 
585
- /** @type {any} */
585
+ /** @type {import('vite').UserConfig} */
586
586
  const vite_config = config.kit.vite();
587
587
 
588
588
  const default_config = {
@@ -893,6 +893,9 @@ async function build_server(
893
893
  const vite_config = config.kit.vite();
894
894
 
895
895
  const default_config = {
896
+ build: {
897
+ target: 'es2020'
898
+ },
896
899
  server: {
897
900
  fs: {
898
901
  strict: true
@@ -909,7 +912,6 @@ async function build_server(
909
912
  root: cwd,
910
913
  base: assets_base,
911
914
  build: {
912
- target: 'es2018',
913
915
  ssr: true,
914
916
  outDir: `${output_dir}/server`,
915
917
  polyfillDynamicImport: false,
@@ -998,7 +1000,7 @@ async function build_service_worker(
998
1000
  .trim()
999
1001
  );
1000
1002
 
1001
- /** @type {any} */
1003
+ /** @type {import('vite').UserConfig} */
1002
1004
  const vite_config = config.kit.vite();
1003
1005
 
1004
1006
  const default_config = {
package/dist/cli.js CHANGED
@@ -817,7 +817,7 @@ async function launch(port, https) {
817
817
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
818
818
  }
819
819
 
820
- const prog = sade('svelte-kit').version('1.0.0-next.181');
820
+ const prog = sade('svelte-kit').version('1.0.0-next.185');
821
821
 
822
822
  prog
823
823
  .command('dev')
@@ -966,7 +966,7 @@ async function check_port(port) {
966
966
  function welcome({ port, host, https, open }) {
967
967
  if (open) launch(port, https);
968
968
 
969
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.181'}\n`));
969
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.185'}\n`));
970
970
 
971
971
  const protocol = https ? 'https:' : 'http:';
972
972
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
package/dist/ssr.js CHANGED
@@ -611,9 +611,13 @@ async function render_response({
611
611
  ],
612
612
  page: {
613
613
  host: ${page && page.host ? s$1(page.host) : 'location.host'}, // TODO this is redundant
614
- path: ${s$1(page && page.path)},
615
- query: new URLSearchParams(${page ? s$1(page.query.toString()) : ''}),
616
- params: ${page && s$1(page.params)}
614
+ path: ${page && page.path ? try_serialize(page.path, error => {
615
+ throw new Error(`Failed to serialize page.path: ${error.message}`);
616
+ }) : null},
617
+ query: new URLSearchParams(${page && page.query ? s$1(page.query.toString()) : ''}),
618
+ params: ${page && page.params ? try_serialize(page.params, error => {
619
+ throw new Error(`Failed to serialize page.params: ${error.message}`);
620
+ }) : null}
617
621
  }
618
622
  }` : 'null'}
619
623
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.181",
3
+ "version": "1.0.0-next.185",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -9,7 +9,7 @@
9
9
  "homepage": "https://kit.svelte.dev",
10
10
  "type": "module",
11
11
  "dependencies": {
12
- "@sveltejs/vite-plugin-svelte": "^1.0.0-next.27",
12
+ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
13
13
  "cheap-watch": "^1.0.4",
14
14
  "sade": "^1.7.4",
15
15
  "vite": "^2.6.7"
@@ -37,14 +37,14 @@
37
37
  "rollup": "^2.58.0",
38
38
  "selfsigned": "^1.10.11",
39
39
  "sirv": "^1.0.17",
40
- "svelte": "^3.43.1",
40
+ "svelte": "^3.44.0",
41
41
  "svelte-check": "^2.2.7",
42
42
  "svelte2tsx": "~0.4.7",
43
43
  "tiny-glob": "^0.2.9",
44
44
  "uvu": "^0.5.2"
45
45
  },
46
46
  "peerDependencies": {
47
- "svelte": "^3.43.0"
47
+ "svelte": "^3.44.0"
48
48
  },
49
49
  "bin": {
50
50
  "svelte-kit": "svelte-kit.js"
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "types": "types/index.d.ts",
75
75
  "engines": {
76
- "node": "^12.20 || >=14.13"
76
+ "node": ">=14.13"
77
77
  },
78
78
  "scripts": {
79
79
  "build": "rollup -c",