@sveltejs/kit 1.0.0-next.344 → 1.0.0-next.345

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.
@@ -1668,7 +1668,7 @@ function create_client({ target, session, base, trailing_slash }) {
1668
1668
  }
1669
1669
 
1670
1670
  const node = await load_node({
1671
- module: await nodes[i],
1671
+ module: await components[nodes[i]](),
1672
1672
  url,
1673
1673
  params,
1674
1674
  stuff,
@@ -1750,7 +1750,7 @@ function create_client({ target, session, base, trailing_slash }) {
1750
1750
  * hydrate: {
1751
1751
  * status: number;
1752
1752
  * error: Error;
1753
- * nodes: Array<Promise<import('types').CSRComponent>>;
1753
+ * nodes: number[];
1754
1754
  * params: Record<string, string>;
1755
1755
  * routeId: string | null;
1756
1756
  * };
@@ -1231,11 +1231,7 @@ async function render_response({
1231
1231
  hydrate: ${resolve_opts.ssr && page_config.hydrate ? `{
1232
1232
  status: ${status},
1233
1233
  error: ${serialize_error(error)},
1234
- nodes: [
1235
- ${(branch || [])
1236
- .map(({ node }) => `import(${s(options.prefix + node.entry)})`)
1237
- .join(',\n\t\t\t\t\t\t')}
1238
- ],
1234
+ nodes: [${branch.map(({ node }) => node.index).join(', ')}],
1239
1235
  params: ${devalue(event.params)},
1240
1236
  routeId: ${s(event.routeId)}
1241
1237
  }` : 'null'}
@@ -69,7 +69,7 @@ async function create_plugin(config) {
69
69
  css: [],
70
70
  js: []
71
71
  },
72
- nodes: manifest_data.components.map((id) => {
72
+ nodes: manifest_data.components.map((id, index) => {
73
73
  return async () => {
74
74
  const url = id.startsWith('..') ? `/@fs${path__default.posix.resolve(id)}` : `/${id}`;
75
75
 
@@ -107,6 +107,7 @@ async function create_plugin(config) {
107
107
 
108
108
  return {
109
109
  module,
110
+ index,
110
111
  entry: url.endsWith('.svelte') ? url : url + '?import',
111
112
  css: [],
112
113
  js: [],
@@ -177,8 +178,13 @@ async function create_plugin(config) {
177
178
 
178
179
  update_manifest();
179
180
 
180
- vite.watcher.on('add', update_manifest);
181
- vite.watcher.on('unlink', update_manifest);
181
+ for (const event of ['add', 'unlink']) {
182
+ vite.watcher.on(event, (file) => {
183
+ if (file.startsWith(config.kit.files.routes + path__default.sep)) {
184
+ update_manifest();
185
+ }
186
+ });
187
+ }
182
188
 
183
189
  const assets = config.kit.paths.assets ? SVELTE_KIT_ASSETS : config.kit.paths.base;
184
190
  const asset_server = sirv(config.kit.files.assets, {
@@ -600,6 +600,7 @@ async function build_server(
600
600
 
601
601
  const exports = [
602
602
  'export { module };',
603
+ `export const index = ${i};`,
603
604
  `export const entry = '${client.vite_manifest[component].file}';`,
604
605
  `export const js = ${s(Array.from(js))};`,
605
606
  `export const css = ${s(Array.from(css))};`
package/dist/cli.js CHANGED
@@ -904,7 +904,7 @@ async function launch(port, https, base) {
904
904
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}${base}`);
905
905
  }
906
906
 
907
- const prog = sade('svelte-kit').version('1.0.0-next.344');
907
+ const prog = sade('svelte-kit').version('1.0.0-next.345');
908
908
 
909
909
  prog
910
910
  .command('dev')
@@ -1123,7 +1123,7 @@ async function check_port(port) {
1123
1123
  function welcome({ port, host, https, open, base, loose, allow, cwd }) {
1124
1124
  if (open) launch(port, https, base);
1125
1125
 
1126
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.344'}\n`));
1126
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.345'}\n`));
1127
1127
 
1128
1128
  const protocol = https ? 'https:' : 'http:';
1129
1129
  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.344",
3
+ "version": "1.0.0-next.345",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -226,6 +226,8 @@ export interface SSREndpoint {
226
226
 
227
227
  export interface SSRNode {
228
228
  module: SSRComponent;
229
+ /** index into the `components` array in client-manifest.js */
230
+ index: number;
229
231
  /** client-side module URL for this component */
230
232
  entry: string;
231
233
  /** external CSS files */