@sveltejs/kit 1.27.3 → 1.27.4
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 +3 -3
- package/src/core/sync/utils.js +5 -0
- package/src/core/sync/write_client_manifest.js +2 -2
- package/src/core/sync/write_root.js +12 -1
- package/src/core/sync/write_server.js +2 -2
- package/src/exports/vite/index.js +2 -2
- package/src/runtime/client/types.d.ts +2 -1
- package/src/runtime/server/page/index.js +1 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.4",
|
|
4
4
|
"description": "The fastest way to build Svelte apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"homepage": "https://kit.svelte.dev",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@sveltejs/vite-plugin-svelte": "^2.
|
|
14
|
+
"@sveltejs/vite-plugin-svelte": "^2.5.0",
|
|
15
15
|
"@types/cookie": "^0.5.1",
|
|
16
16
|
"cookie": "^0.5.0",
|
|
17
17
|
"devalue": "^4.3.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vitest": "^0.34.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"svelte": "^3.54.0 || ^4.0.0-next.0",
|
|
44
|
+
"svelte": "^3.54.0 || ^4.0.0-next.0 || ^5.0.0-next.0",
|
|
45
45
|
"vite": "^4.0.0"
|
|
46
46
|
},
|
|
47
47
|
"bin": {
|
package/src/core/sync/utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { VERSION } from 'svelte/compiler';
|
|
3
4
|
import { mkdirp } from '../../utils/filesystem.js';
|
|
4
5
|
|
|
5
6
|
/** @type {Map<string, string>} */
|
|
@@ -68,3 +69,7 @@ export function dedent(strings, ...values) {
|
|
|
68
69
|
|
|
69
70
|
return str;
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
export function isSvelte5Plus() {
|
|
74
|
+
return Number(VERSION[0]) >= 5;
|
|
75
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { relative_path, resolve_entry } from '../../utils/filesystem.js';
|
|
3
3
|
import { s } from '../../utils/misc.js';
|
|
4
|
-
import { dedent, write_if_changed } from './utils.js';
|
|
4
|
+
import { dedent, isSvelte5Plus, write_if_changed } from './utils.js';
|
|
5
5
|
import colors from 'kleur';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -143,7 +143,7 @@ export function write_client_manifest(kit, manifest_data, output, metadata) {
|
|
|
143
143
|
}(({ error }) => { console.error(error) }),
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
export { default as root } from '../root
|
|
146
|
+
export { default as root } from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}';
|
|
147
147
|
`
|
|
148
148
|
);
|
|
149
149
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dedent, write_if_changed } from './utils.js';
|
|
1
|
+
import { dedent, isSvelte5Plus, write_if_changed } from './utils.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @param {import('types').ManifestData} manifest_data
|
|
@@ -89,4 +89,15 @@ export function write_root(manifest_data, output) {
|
|
|
89
89
|
{/if}
|
|
90
90
|
`
|
|
91
91
|
);
|
|
92
|
+
|
|
93
|
+
if (isSvelte5Plus()) {
|
|
94
|
+
write_if_changed(
|
|
95
|
+
`${output}/root.js`,
|
|
96
|
+
dedent`
|
|
97
|
+
import { asClassComponent } from 'svelte/legacy';
|
|
98
|
+
import Root from './root.svelte';
|
|
99
|
+
export default asClassComponent(Root);
|
|
100
|
+
`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
92
103
|
}
|
|
@@ -4,7 +4,7 @@ import { posixify, resolve_entry } from '../../utils/filesystem.js';
|
|
|
4
4
|
import { s } from '../../utils/misc.js';
|
|
5
5
|
import { load_error_page, load_template } from '../config/index.js';
|
|
6
6
|
import { runtime_directory } from '../utils.js';
|
|
7
|
-
import { write_if_changed } from './utils.js';
|
|
7
|
+
import { isSvelte5Plus, write_if_changed } from './utils.js';
|
|
8
8
|
import colors from 'kleur';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,7 +25,7 @@ const server_template = ({
|
|
|
25
25
|
template,
|
|
26
26
|
error_page
|
|
27
27
|
}) => `
|
|
28
|
-
import root from '../root
|
|
28
|
+
import root from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}';
|
|
29
29
|
import { set_building } from '__sveltekit/environment';
|
|
30
30
|
import { set_assets } from '__sveltekit/paths';
|
|
31
31
|
import { set_private_env, set_public_env } from '${runtime_directory}/shared-server.js';
|
|
@@ -24,7 +24,7 @@ import prerender from '../../core/postbuild/prerender.js';
|
|
|
24
24
|
import analyse from '../../core/postbuild/analyse.js';
|
|
25
25
|
import { s } from '../../utils/misc.js';
|
|
26
26
|
import { hash } from '../../runtime/hash.js';
|
|
27
|
-
import { dedent } from '../../core/sync/utils.js';
|
|
27
|
+
import { dedent, isSvelte5Plus } from '../../core/sync/utils.js';
|
|
28
28
|
|
|
29
29
|
export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
30
30
|
|
|
@@ -136,7 +136,7 @@ export async function sveltekit() {
|
|
|
136
136
|
onwarn: svelte_config.onwarn,
|
|
137
137
|
compilerOptions: {
|
|
138
138
|
// @ts-expect-error SvelteKit requires hydratable true by default
|
|
139
|
-
hydratable: true,
|
|
139
|
+
hydratable: isSvelte5Plus() ? undefined : true,
|
|
140
140
|
...svelte_config.compilerOptions
|
|
141
141
|
},
|
|
142
142
|
...svelte_config.vitePlugin
|
|
@@ -90,7 +90,8 @@ export type NavigationFinished = {
|
|
|
90
90
|
type: 'loaded';
|
|
91
91
|
state: NavigationState;
|
|
92
92
|
props: {
|
|
93
|
-
|
|
93
|
+
constructors: Array<typeof SvelteComponent>;
|
|
94
|
+
components?: Array<SvelteComponent>;
|
|
94
95
|
page?: Page;
|
|
95
96
|
form?: Record<string, any> | null;
|
|
96
97
|
[key: `data_${number}`]: Record<string, any>;
|
|
@@ -99,7 +99,7 @@ export async function render_page(event, page, options, manifest, state, resolve
|
|
|
99
99
|
/** @type {import('./types').Fetched[]} */
|
|
100
100
|
const fetched = [];
|
|
101
101
|
|
|
102
|
-
if (get_option(nodes, 'ssr') === false) {
|
|
102
|
+
if (get_option(nodes, 'ssr') === false && !state.prerendering) {
|
|
103
103
|
return await render_response({
|
|
104
104
|
branch: [],
|
|
105
105
|
fetched,
|
package/src/version.js
CHANGED