@sveltejs/kit 1.0.0-next.229 → 1.0.0-next.232

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.
File without changes
@@ -1,4 +1,4 @@
1
- import { renderer, router as router$1 } from '../internal/singletons.js';
1
+ import { renderer, router as router$1 } from '../client/singletons.js';
2
2
  import { g as get_base_uri } from '../chunks/utils.js';
3
3
 
4
4
  const router = /** @type {import('../client/router').Router} */ (router$1);
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
- import Root from '../../generated/root.svelte';
2
- import { fallback, routes } from '../../generated/manifest.js';
1
+ import Root from '__GENERATED__/root.svelte';
2
+ import { fallback, routes } from '__GENERATED__/manifest.js';
3
3
  import { onMount, tick } from 'svelte';
4
4
  import { g as get_base_uri } from '../chunks/utils.js';
5
5
  import { writable } from 'svelte/store';
@@ -156,7 +156,7 @@ class Router {
156
156
  addEventListener('sveltekit:trigger_prefetch', trigger_prefetch);
157
157
 
158
158
  /** @param {MouseEvent} event */
159
- addEventListener('click', async (event) => {
159
+ addEventListener('click', (event) => {
160
160
  if (!this.enabled) return;
161
161
 
162
162
  // Adapted from https://github.com/visionmedia/page.js
@@ -1326,8 +1326,6 @@ class Renderer {
1326
1326
  }
1327
1327
  }
1328
1328
 
1329
- // @ts-expect-error - doesn't exist yet. generated by Rollup
1330
-
1331
1329
  /**
1332
1330
  * @param {{
1333
1331
  * paths: {
File without changes
File without changes
@@ -1896,7 +1896,12 @@ async function respond(incoming, options, state = {}) {
1896
1896
  });
1897
1897
  }
1898
1898
 
1899
- const decoded = decodeURI(request.url.pathname).replace(options.paths.base, '');
1899
+ let decoded = decodeURI(request.url.pathname);
1900
+
1901
+ if (options.paths.base) {
1902
+ if (!decoded.startsWith(options.paths.base)) return;
1903
+ decoded = decoded.slice(options.paths.base.length) || '/';
1904
+ }
1900
1905
 
1901
1906
  for (const route of options.manifest._.routes) {
1902
1907
  const match = route.pattern.exec(decoded);
@@ -1908,8 +1913,9 @@ async function respond(incoming, options, state = {}) {
1908
1913
  : await render_page(request, route, match, options, state, ssr);
1909
1914
 
1910
1915
  if (response) {
1911
- // inject ETags for 200 responses
1912
- if (response.status === 200) {
1916
+ // inject ETags for 200 responses, if the endpoint
1917
+ // doesn't have its own ETag handling
1918
+ if (response.status === 200 && !response.headers.etag) {
1913
1919
  const cache_control = get_single_valued_header(response.headers, 'cache-control');
1914
1920
  if (!cache_control || !/(no-store|immutable)/.test(cache_control)) {
1915
1921
  let if_none_match_value = request.headers['if-none-match'];