@sveltejs/kit 1.0.0-next.214 → 1.0.0-next.215

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.
@@ -162,16 +162,17 @@ class Router {
162
162
 
163
163
  if (!this.owns(url)) return;
164
164
 
165
- const noscroll = a.hasAttribute('sveltekit:noscroll');
165
+ // Check if new url only differs by hash
166
+ if (url.href.split('#')[0] === location.href.split('#')[0]) {
167
+ // Call `pushState` to add url to history so going back works.
168
+ // Also make a delay, otherwise the browser default behaviour would not kick in
169
+ setTimeout(() => history.pushState({}, '', url.href));
170
+ return;
171
+ }
166
172
 
167
- const i1 = url_string.indexOf('#');
168
- const i2 = location.href.indexOf('#');
169
- const u1 = i1 >= 0 ? url_string.substring(0, i1) : url_string;
170
- const u2 = i2 >= 0 ? location.href.substring(0, i2) : location.href;
171
173
  history.pushState({}, '', url.href);
172
- if (u1 === u2) {
173
- window.dispatchEvent(new HashChangeEvent('hashchange'));
174
- }
174
+
175
+ const noscroll = a.hasAttribute('sveltekit:noscroll');
175
176
  this._navigate(url, noscroll ? scroll_state() : null, false, [], url.hash);
176
177
  event.preventDefault();
177
178
  });
package/dist/cli.js CHANGED
@@ -887,7 +887,7 @@ async function launch(port, https) {
887
887
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
888
888
  }
889
889
 
890
- const prog = sade('svelte-kit').version('1.0.0-next.214');
890
+ const prog = sade('svelte-kit').version('1.0.0-next.215');
891
891
 
892
892
  prog
893
893
  .command('dev')
@@ -1039,7 +1039,7 @@ async function check_port(port) {
1039
1039
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1040
1040
  if (open) launch(port, https);
1041
1041
 
1042
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.214'}\n`));
1042
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.215'}\n`));
1043
1043
 
1044
1044
  const protocol = https ? 'https:' : 'http:';
1045
1045
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.214",
3
+ "version": "1.0.0-next.215",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -15,6 +15,7 @@
15
15
  "vite": "^2.7.2"
16
16
  },
17
17
  "devDependencies": {
18
+ "@playwright/test": "^1.17.1",
18
19
  "@rollup/plugin-replace": "^3.0.0",
19
20
  "@types/amphtml-validator": "^1.0.1",
20
21
  "@types/cookie": "^0.4.1",
@@ -24,6 +25,7 @@
24
25
  "@types/sade": "^1.7.3",
25
26
  "amphtml-validator": "^1.0.35",
26
27
  "cookie": "^0.4.1",
28
+ "cross-env": "^7.0.3",
27
29
  "devalue": "^2.0.1",
28
30
  "eslint": "^8.3.0",
29
31
  "kleur": "^4.1.4",
@@ -85,6 +87,10 @@
85
87
  "test": "npm run test:unit && npm run test:packaging && npm run test:integration",
86
88
  "test:unit": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\" -i packaging",
87
89
  "test:packaging": "uvu src/packaging \"(spec\\.js|test[\\\\/]index\\.js)\"",
88
- "test:integration": "uvu test test.js"
90
+ "test:integration": "pnpm test:integration:amp && pnpm test:integration:basics && pnpm test:integration:options && pnpm test:integration:options-2",
91
+ "test:integration:amp": "cd test/apps/amp && pnpm test",
92
+ "test:integration:basics": "cd test/apps/basics && pnpm test",
93
+ "test:integration:options": "cd test/apps/options && pnpm test",
94
+ "test:integration:options-2": "cd test/apps/options-2 && pnpm test"
89
95
  }
90
96
  }