@sveltejs/kit 1.0.0-next.489 → 1.0.0-next.490

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.489",
3
+ "version": "1.0.0-next.490",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -68,7 +68,7 @@ export async function write_types(config, manifest_data, file) {
68
68
  return;
69
69
  }
70
70
 
71
- const id = path.posix.relative(config.kit.files.routes, path.dirname(file));
71
+ const id = posixify(path.relative(config.kit.files.routes, path.dirname(file)));
72
72
 
73
73
  const route = manifest_data.routes.find((route) => route.id === id);
74
74
  if (!route) return; // this shouldn't ever happen
@@ -1546,7 +1546,8 @@ function add_url_properties(type, target) {
1546
1546
  throw new Error(
1547
1547
  `The navigation shape changed - ${type}.${prop} should now be ${type}.url.${prop}`
1548
1548
  );
1549
- }
1549
+ },
1550
+ enumerable: false
1550
1551
  });
1551
1552
  }
1552
1553
 
@@ -70,21 +70,18 @@ export function allowed_methods(mod) {
70
70
 
71
71
  /** @param {any} data */
72
72
  export function data_response(data) {
73
+ const headers = {
74
+ 'content-type': 'application/javascript',
75
+ 'cache-control': 'private, no-store'
76
+ };
77
+
73
78
  try {
74
- return new Response(`window.__sveltekit_data = ${devalue(data)}`, {
75
- headers: {
76
- 'content-type': 'application/javascript'
77
- }
78
- });
79
+ return new Response(`window.__sveltekit_data = ${devalue(data)}`, { headers });
79
80
  } catch (e) {
80
81
  const error = /** @type {any} */ (e);
81
82
  const match = /\[(\d+)\]\.data\.(.+)/.exec(error.path);
82
83
  const message = match ? `${error.message} (data.${match[2]})` : error.message;
83
- return new Response(`throw new Error(${JSON.stringify(message)})`, {
84
- headers: {
85
- 'content-type': 'application/javascript'
86
- }
87
- });
84
+ return new Response(`throw new Error(${JSON.stringify(message)})`, { headers });
88
85
  }
89
86
  }
90
87