@sveltejs/kit 1.0.1 → 1.0.3
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.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sveltejs/kit",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@types/set-cookie-parser": "^2.4.2",
|
|
35
35
|
"marked": "^4.2.3",
|
|
36
36
|
"rollup": "^3.7.0",
|
|
37
|
-
"svelte": "^3.
|
|
37
|
+
"svelte": "^3.55.0",
|
|
38
38
|
"svelte-preprocess": "^5.0.0",
|
|
39
|
-
"typescript": "^4.9.
|
|
39
|
+
"typescript": "^4.9.4",
|
|
40
40
|
"uvu": "^0.5.6",
|
|
41
|
-
"vite": "^4.0.
|
|
41
|
+
"vite": "^4.0.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"svelte": "^3.54.0",
|
|
@@ -1461,21 +1461,28 @@ export function create_client({ target, base }) {
|
|
|
1461
1461
|
if (method !== 'get') return;
|
|
1462
1462
|
|
|
1463
1463
|
const url = new URL(
|
|
1464
|
-
(
|
|
1464
|
+
(submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action
|
|
1465
1465
|
);
|
|
1466
1466
|
|
|
1467
1467
|
if (is_external_url(url, base)) return;
|
|
1468
1468
|
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
);
|
|
1469
|
+
const event_form = /** @type {HTMLFormElement} */ (event.target);
|
|
1470
|
+
|
|
1471
|
+
const { noscroll, reload } = get_router_options(event_form);
|
|
1472
1472
|
if (reload) return;
|
|
1473
1473
|
|
|
1474
1474
|
event.preventDefault();
|
|
1475
1475
|
event.stopPropagation();
|
|
1476
1476
|
|
|
1477
|
+
const data = new FormData(event_form);
|
|
1478
|
+
|
|
1479
|
+
const submitter_name = submitter?.getAttribute('name');
|
|
1480
|
+
if (submitter_name) {
|
|
1481
|
+
data.append(submitter_name, submitter?.getAttribute('value') ?? '');
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1477
1484
|
// @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that
|
|
1478
|
-
url.search = new URLSearchParams(
|
|
1485
|
+
url.search = new URLSearchParams(data).toString();
|
|
1479
1486
|
|
|
1480
1487
|
navigate({
|
|
1481
1488
|
url,
|
|
@@ -62,7 +62,7 @@ export async function render_page(event, route, page, options, state, resolve_op
|
|
|
62
62
|
// (this also determines status code)
|
|
63
63
|
action_result = await handle_action_request(event, leaf_node.server);
|
|
64
64
|
if (action_result?.type === 'redirect') {
|
|
65
|
-
return redirect_response(
|
|
65
|
+
return redirect_response(action_result.status, action_result.location);
|
|
66
66
|
}
|
|
67
67
|
if (action_result?.type === 'error') {
|
|
68
68
|
const error = action_result.error;
|
|
@@ -211,7 +211,7 @@ export async function load_data({
|
|
|
211
211
|
const included = resolve_opts.filterSerializedResponseHeaders(lower, value);
|
|
212
212
|
if (!included) {
|
|
213
213
|
throw new Error(
|
|
214
|
-
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route})`
|
|
214
|
+
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route.id})`
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
}
|