@sveltejs/kit 1.0.0-next.220 → 1.0.0-next.221

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/assets/kit.js CHANGED
@@ -112,13 +112,14 @@ async function render_endpoint(request, route, match) {
112
112
  const response = await handler(request);
113
113
  const preface = `Invalid response from route ${request.url.pathname}`;
114
114
 
115
- if (!response) {
116
- return;
117
- }
118
115
  if (typeof response !== 'object') {
119
116
  return error(`${preface}: expected an object, got ${typeof response}`);
120
117
  }
121
118
 
119
+ if (response.fallthrough) {
120
+ return;
121
+ }
122
+
122
123
  let { status = 200, body, headers = {} } = response;
123
124
 
124
125
  headers = lowercase_keys(headers);
@@ -548,6 +549,7 @@ const s = JSON.stringify;
548
549
  * error?: Error,
549
550
  * url: URL;
550
551
  * params: Record<string, string>
552
+ * stuff: Record<string, any>;
551
553
  * }} opts
552
554
  */
553
555
  async function render_response({
@@ -558,7 +560,8 @@ async function render_response({
558
560
  status,
559
561
  error,
560
562
  url,
561
- params
563
+ params,
564
+ stuff
562
565
  }) {
563
566
  const css = new Set(options.manifest._.entry.css);
564
567
  const js = new Set(options.manifest._.entry.js);
@@ -599,7 +602,7 @@ async function render_response({
599
602
  navigating: writable(null),
600
603
  session
601
604
  },
602
- page: { url, params, status, error },
605
+ page: { url, params, status, error, stuff },
603
606
  components: branch.map(({ node }) => node.module.default)
604
607
  };
605
608
 
@@ -904,7 +907,6 @@ function is_root_relative(path) {
904
907
  * $session: any;
905
908
  * stuff: Record<string, any>;
906
909
  * prerender_enabled: boolean;
907
- * is_leaf: boolean;
908
910
  * is_error: boolean;
909
911
  * status?: number;
910
912
  * error?: Error;
@@ -922,7 +924,6 @@ async function load_node({
922
924
  $session,
923
925
  stuff,
924
926
  prerender_enabled,
925
- is_leaf,
926
927
  is_error,
927
928
  status,
928
929
  error
@@ -1182,16 +1183,16 @@ async function load_node({
1182
1183
  }
1183
1184
 
1184
1185
  loaded = await module.load.call(null, load_input);
1186
+
1187
+ if (!loaded) {
1188
+ throw new Error(`load function must return a value${options.dev ? ` (${node.entry})` : ''}`);
1189
+ }
1185
1190
  } else {
1186
1191
  loaded = {};
1187
1192
  }
1188
1193
 
1189
- // if leaf node (i.e. page component) has a load function
1190
- // that returns nothing, we fall through to the next one
1191
- if (!loaded && is_leaf && !is_error) return;
1192
-
1193
- if (!loaded) {
1194
- throw new Error(`${node.entry} - load must return a value except for page fall through`);
1194
+ if (loaded.fallthrough && !is_error) {
1195
+ return;
1195
1196
  }
1196
1197
 
1197
1198
  return {
@@ -1229,8 +1230,7 @@ async function respond_with_error({ request, options, state, $session, status, e
1229
1230
  /** @type {Record<string, string>} */
1230
1231
  const params = {}; // error page has no params
1231
1232
 
1232
- // error pages don't fall through, so we know it's not undefined
1233
- const loaded = /** @type {Loaded} */ (
1233
+ const layout_loaded = /** @type {Loaded} */ (
1234
1234
  await load_node({
1235
1235
  request,
1236
1236
  options,
@@ -1242,32 +1242,27 @@ async function respond_with_error({ request, options, state, $session, status, e
1242
1242
  $session,
1243
1243
  stuff: {},
1244
1244
  prerender_enabled: is_prerender_enabled(options, default_error, state),
1245
- is_leaf: false,
1246
1245
  is_error: false
1247
1246
  })
1248
1247
  );
1249
1248
 
1250
- const branch = [
1251
- loaded,
1252
- /** @type {Loaded} */ (
1253
- await load_node({
1254
- request,
1255
- options,
1256
- state,
1257
- route: null,
1258
- url: request.url,
1259
- params,
1260
- node: default_error,
1261
- $session,
1262
- stuff: loaded ? loaded.stuff : {},
1263
- prerender_enabled: is_prerender_enabled(options, default_error, state),
1264
- is_leaf: false,
1265
- is_error: true,
1266
- status,
1267
- error
1268
- })
1269
- )
1270
- ];
1249
+ const error_loaded = /** @type {Loaded} */ (
1250
+ await load_node({
1251
+ request,
1252
+ options,
1253
+ state,
1254
+ route: null,
1255
+ url: request.url,
1256
+ params,
1257
+ node: default_error,
1258
+ $session,
1259
+ stuff: layout_loaded ? layout_loaded.stuff : {},
1260
+ prerender_enabled: is_prerender_enabled(options, default_error, state),
1261
+ is_error: true,
1262
+ status,
1263
+ error
1264
+ })
1265
+ );
1271
1266
 
1272
1267
  return await render_response({
1273
1268
  options,
@@ -1277,9 +1272,10 @@ async function respond_with_error({ request, options, state, $session, status, e
1277
1272
  router: options.router,
1278
1273
  ssr: options.ssr
1279
1274
  },
1275
+ stuff: error_loaded.stuff,
1280
1276
  status,
1281
1277
  error,
1282
- branch,
1278
+ branch: [layout_loaded, error_loaded],
1283
1279
  url: request.url,
1284
1280
  params
1285
1281
  });
@@ -1377,9 +1373,9 @@ async function respond$1(opts) {
1377
1373
  /** @type {string[]} */
1378
1374
  let set_cookie_headers = [];
1379
1375
 
1380
- ssr: if (page_config.ssr) {
1381
- let stuff = {};
1376
+ let stuff = {};
1382
1377
 
1378
+ ssr: if (page_config.ssr) {
1383
1379
  for (let i = 0; i < nodes.length; i += 1) {
1384
1380
  const node = nodes[i];
1385
1381
 
@@ -1394,7 +1390,6 @@ async function respond$1(opts) {
1394
1390
  node,
1395
1391
  stuff,
1396
1392
  prerender_enabled: is_prerender_enabled(options, node, state),
1397
- is_leaf: i === nodes.length - 1,
1398
1393
  is_error: false
1399
1394
  });
1400
1395
 
@@ -1451,7 +1446,6 @@ async function respond$1(opts) {
1451
1446
  node: error_node,
1452
1447
  stuff: node_loaded.stuff,
1453
1448
  prerender_enabled: is_prerender_enabled(options, error_node, state),
1454
- is_leaf: false,
1455
1449
  is_error: true,
1456
1450
  status,
1457
1451
  error
@@ -1464,6 +1458,7 @@ async function respond$1(opts) {
1464
1458
 
1465
1459
  page_config = get_page_config(error_node.module, options);
1466
1460
  branch = branch.slice(0, j + 1).concat(error_loaded);
1461
+ stuff = { ...node_loaded.stuff, ...error_loaded.stuff };
1467
1462
  break ssr;
1468
1463
  } catch (err) {
1469
1464
  const e = coalesce_to_error(err);
@@ -1505,6 +1500,7 @@ async function respond$1(opts) {
1505
1500
  return with_cookies(
1506
1501
  await render_response({
1507
1502
  ...opts,
1503
+ stuff,
1508
1504
  url: request.url,
1509
1505
  page_config,
1510
1506
  status,
@@ -1845,6 +1841,7 @@ async function respond(incoming, options, state = {}) {
1845
1841
  params: request.params,
1846
1842
  options,
1847
1843
  $session: await options.hooks.getSession(request),
1844
+ stuff: {},
1848
1845
  page_config: { ssr: false, router: true, hydrate: true },
1849
1846
  status: 200,
1850
1847
  branch: []
@@ -584,7 +584,14 @@ class Renderer {
584
584
 
585
585
  result = error_args
586
586
  ? await this._load_error(error_args)
587
- : await this._get_navigation_result_from_branch({ url, params, branch, status, error });
587
+ : await this._get_navigation_result_from_branch({
588
+ url,
589
+ params,
590
+ stuff,
591
+ branch,
592
+ status,
593
+ error
594
+ });
588
595
  } catch (e) {
589
596
  if (error) throw e;
590
597
 
@@ -808,12 +815,13 @@ class Renderer {
808
815
  * @param {{
809
816
  * url: URL;
810
817
  * params: Record<string, string>;
818
+ * stuff: Record<string, any>;
811
819
  * branch: Array<import('./types').BranchNode | undefined>;
812
820
  * status: number;
813
821
  * error?: Error;
814
822
  * }} opts
815
823
  */
816
- async _get_navigation_result_from_branch({ url, params, branch, status, error }) {
824
+ async _get_navigation_result_from_branch({ url, params, stuff, branch, status, error }) {
817
825
  const filtered = /** @type {import('./types').BranchNode[] } */ (branch.filter(Boolean));
818
826
  const redirect = filtered.find((f) => f.loaded && f.loaded.redirect);
819
827
 
@@ -837,7 +845,7 @@ class Renderer {
837
845
  }
838
846
 
839
847
  if (!this.current.url || url.href !== this.current.url.href) {
840
- result.props.page = { url, params, status, error };
848
+ result.props.page = { url, params, status, error, stuff };
841
849
 
842
850
  // TODO remove this for 1.0
843
851
  /**
@@ -970,8 +978,9 @@ class Renderer {
970
978
 
971
979
  const loaded = await module.load.call(null, load_input);
972
980
 
973
- // if the page component returns nothing from load, fall through
974
- if (!loaded) return;
981
+ if (!loaded) {
982
+ throw new Error('load function must return a value');
983
+ }
975
984
 
976
985
  node.loaded = normalize(loaded);
977
986
  if (node.loaded.stuff) node.stuff = node.loaded.stuff;
@@ -1048,9 +1057,10 @@ class Renderer {
1048
1057
  stuff
1049
1058
  });
1050
1059
 
1051
- const is_leaf = i === a.length - 1;
1052
-
1053
1060
  if (node && node.loaded) {
1061
+ if (node.loaded.fallthrough) {
1062
+ return;
1063
+ }
1054
1064
  if (node.loaded.error) {
1055
1065
  status = node.loaded.status;
1056
1066
  error = node.loaded.error;
@@ -1067,10 +1077,6 @@ class Renderer {
1067
1077
  if (node.loaded.stuff) {
1068
1078
  stuff_changed = true;
1069
1079
  }
1070
- } else if (is_leaf && module.load) {
1071
- // if the leaf node has a `load` function
1072
- // that returns nothing, fall through
1073
- return;
1074
1080
  }
1075
1081
  } else {
1076
1082
  node = previous;
@@ -1106,6 +1112,13 @@ class Renderer {
1106
1112
  continue;
1107
1113
  }
1108
1114
 
1115
+ if (error_loaded && error_loaded.loaded && error_loaded.loaded.stuff) {
1116
+ stuff = {
1117
+ ...stuff,
1118
+ ...error_loaded.loaded.stuff
1119
+ };
1120
+ }
1121
+
1109
1122
  branch = branch.slice(0, j + 1).concat(error_loaded);
1110
1123
  break load;
1111
1124
  } catch (e) {
@@ -1131,7 +1144,14 @@ class Renderer {
1131
1144
  }
1132
1145
  }
1133
1146
 
1134
- return await this._get_navigation_result_from_branch({ url, params, branch, status, error });
1147
+ return await this._get_navigation_result_from_branch({
1148
+ url,
1149
+ params,
1150
+ stuff,
1151
+ branch,
1152
+ status,
1153
+ error
1154
+ });
1135
1155
  }
1136
1156
 
1137
1157
  /**
@@ -1151,20 +1171,26 @@ class Renderer {
1151
1171
  params,
1152
1172
  stuff: {}
1153
1173
  });
1174
+ const error_node = await this._load_node({
1175
+ status,
1176
+ error,
1177
+ module: await this.fallback[1],
1178
+ url,
1179
+ params,
1180
+ stuff: (node && node.loaded && node.loaded.stuff) || {}
1181
+ });
1154
1182
 
1155
- const branch = [
1156
- node,
1157
- await this._load_node({
1158
- status,
1159
- error,
1160
- module: await this.fallback[1],
1161
- url,
1162
- params,
1163
- stuff: (node && node.loaded && node.loaded.stuff) || {}
1164
- })
1165
- ];
1183
+ const branch = [node, error_node];
1184
+ const stuff = { ...node?.loaded?.stuff, ...error_node?.loaded?.stuff };
1166
1185
 
1167
- return await this._get_navigation_result_from_branch({ url, params, branch, status, error });
1186
+ return await this._get_navigation_result_from_branch({
1187
+ url,
1188
+ params,
1189
+ stuff,
1190
+ branch,
1191
+ status,
1192
+ error
1193
+ });
1168
1194
  }
1169
1195
  }
1170
1196
 
package/dist/cli.js CHANGED
@@ -846,7 +846,7 @@ async function launch(port, https) {
846
846
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
847
847
  }
848
848
 
849
- const prog = sade('svelte-kit').version('1.0.0-next.220');
849
+ const prog = sade('svelte-kit').version('1.0.0-next.221');
850
850
 
851
851
  prog
852
852
  .command('dev')
@@ -998,7 +998,7 @@ async function check_port(port) {
998
998
  function welcome({ port, host, https, open, loose, allow, cwd }) {
999
999
  if (open) launch(port, https);
1000
1000
 
1001
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.220'}\n`));
1001
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.221'}\n`));
1002
1002
 
1003
1003
  const protocol = https ? 'https:' : 'http:';
1004
1004
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
package/dist/ssr.js CHANGED
@@ -94,13 +94,14 @@ async function render_endpoint(request, route, match) {
94
94
  const response = await handler(request);
95
95
  const preface = `Invalid response from route ${request.url.pathname}`;
96
96
 
97
- if (!response) {
98
- return;
99
- }
100
97
  if (typeof response !== 'object') {
101
98
  return error(`${preface}: expected an object, got ${typeof response}`);
102
99
  }
103
100
 
101
+ if (response.fallthrough) {
102
+ return;
103
+ }
104
+
104
105
  let { status = 200, body, headers = {} } = response;
105
106
 
106
107
  headers = lowercase_keys(headers);
@@ -517,6 +518,7 @@ function escape(str, dict, unicode_encoder) {
517
518
  * error?: Error,
518
519
  * url: URL;
519
520
  * params: Record<string, string>
521
+ * stuff: Record<string, any>;
520
522
  * }} opts
521
523
  */
522
524
  async function render_response({
@@ -527,7 +529,8 @@ async function render_response({
527
529
  status,
528
530
  error,
529
531
  url,
530
- params
532
+ params,
533
+ stuff
531
534
  }) {
532
535
  const css = new Set(options.manifest._.entry.css);
533
536
  const js = new Set(options.manifest._.entry.js);
@@ -568,7 +571,7 @@ async function render_response({
568
571
  navigating: writable(null),
569
572
  session
570
573
  },
571
- page: { url, params, status, error },
574
+ page: { url, params, status, error, stuff },
572
575
  components: branch.map(({ node }) => node.module.default)
573
576
  };
574
577
 
@@ -834,7 +837,6 @@ function normalize(loaded) {
834
837
  * $session: any;
835
838
  * stuff: Record<string, any>;
836
839
  * prerender_enabled: boolean;
837
- * is_leaf: boolean;
838
840
  * is_error: boolean;
839
841
  * status?: number;
840
842
  * error?: Error;
@@ -852,7 +854,6 @@ async function load_node({
852
854
  $session,
853
855
  stuff,
854
856
  prerender_enabled,
855
- is_leaf,
856
857
  is_error,
857
858
  status,
858
859
  error
@@ -1112,16 +1113,16 @@ async function load_node({
1112
1113
  }
1113
1114
 
1114
1115
  loaded = await module.load.call(null, load_input);
1116
+
1117
+ if (!loaded) {
1118
+ throw new Error(`load function must return a value${options.dev ? ` (${node.entry})` : ''}`);
1119
+ }
1115
1120
  } else {
1116
1121
  loaded = {};
1117
1122
  }
1118
1123
 
1119
- // if leaf node (i.e. page component) has a load function
1120
- // that returns nothing, we fall through to the next one
1121
- if (!loaded && is_leaf && !is_error) return;
1122
-
1123
- if (!loaded) {
1124
- throw new Error(`${node.entry} - load must return a value except for page fall through`);
1124
+ if (loaded.fallthrough && !is_error) {
1125
+ return;
1125
1126
  }
1126
1127
 
1127
1128
  return {
@@ -1159,8 +1160,7 @@ async function respond_with_error({ request, options, state, $session, status, e
1159
1160
  /** @type {Record<string, string>} */
1160
1161
  const params = {}; // error page has no params
1161
1162
 
1162
- // error pages don't fall through, so we know it's not undefined
1163
- const loaded = /** @type {Loaded} */ (
1163
+ const layout_loaded = /** @type {Loaded} */ (
1164
1164
  await load_node({
1165
1165
  request,
1166
1166
  options,
@@ -1172,32 +1172,27 @@ async function respond_with_error({ request, options, state, $session, status, e
1172
1172
  $session,
1173
1173
  stuff: {},
1174
1174
  prerender_enabled: is_prerender_enabled(options, default_error, state),
1175
- is_leaf: false,
1176
1175
  is_error: false
1177
1176
  })
1178
1177
  );
1179
1178
 
1180
- const branch = [
1181
- loaded,
1182
- /** @type {Loaded} */ (
1183
- await load_node({
1184
- request,
1185
- options,
1186
- state,
1187
- route: null,
1188
- url: request.url,
1189
- params,
1190
- node: default_error,
1191
- $session,
1192
- stuff: loaded ? loaded.stuff : {},
1193
- prerender_enabled: is_prerender_enabled(options, default_error, state),
1194
- is_leaf: false,
1195
- is_error: true,
1196
- status,
1197
- error
1198
- })
1199
- )
1200
- ];
1179
+ const error_loaded = /** @type {Loaded} */ (
1180
+ await load_node({
1181
+ request,
1182
+ options,
1183
+ state,
1184
+ route: null,
1185
+ url: request.url,
1186
+ params,
1187
+ node: default_error,
1188
+ $session,
1189
+ stuff: layout_loaded ? layout_loaded.stuff : {},
1190
+ prerender_enabled: is_prerender_enabled(options, default_error, state),
1191
+ is_error: true,
1192
+ status,
1193
+ error
1194
+ })
1195
+ );
1201
1196
 
1202
1197
  return await render_response({
1203
1198
  options,
@@ -1207,9 +1202,10 @@ async function respond_with_error({ request, options, state, $session, status, e
1207
1202
  router: options.router,
1208
1203
  ssr: options.ssr
1209
1204
  },
1205
+ stuff: error_loaded.stuff,
1210
1206
  status,
1211
1207
  error,
1212
- branch,
1208
+ branch: [layout_loaded, error_loaded],
1213
1209
  url: request.url,
1214
1210
  params
1215
1211
  });
@@ -1307,9 +1303,9 @@ async function respond$1(opts) {
1307
1303
  /** @type {string[]} */
1308
1304
  let set_cookie_headers = [];
1309
1305
 
1310
- ssr: if (page_config.ssr) {
1311
- let stuff = {};
1306
+ let stuff = {};
1312
1307
 
1308
+ ssr: if (page_config.ssr) {
1313
1309
  for (let i = 0; i < nodes.length; i += 1) {
1314
1310
  const node = nodes[i];
1315
1311
 
@@ -1324,7 +1320,6 @@ async function respond$1(opts) {
1324
1320
  node,
1325
1321
  stuff,
1326
1322
  prerender_enabled: is_prerender_enabled(options, node, state),
1327
- is_leaf: i === nodes.length - 1,
1328
1323
  is_error: false
1329
1324
  });
1330
1325
 
@@ -1381,7 +1376,6 @@ async function respond$1(opts) {
1381
1376
  node: error_node,
1382
1377
  stuff: node_loaded.stuff,
1383
1378
  prerender_enabled: is_prerender_enabled(options, error_node, state),
1384
- is_leaf: false,
1385
1379
  is_error: true,
1386
1380
  status,
1387
1381
  error
@@ -1394,6 +1388,7 @@ async function respond$1(opts) {
1394
1388
 
1395
1389
  page_config = get_page_config(error_node.module, options);
1396
1390
  branch = branch.slice(0, j + 1).concat(error_loaded);
1391
+ stuff = { ...node_loaded.stuff, ...error_loaded.stuff };
1397
1392
  break ssr;
1398
1393
  } catch (err) {
1399
1394
  const e = coalesce_to_error(err);
@@ -1435,6 +1430,7 @@ async function respond$1(opts) {
1435
1430
  return with_cookies(
1436
1431
  await render_response({
1437
1432
  ...opts,
1433
+ stuff,
1438
1434
  url: request.url,
1439
1435
  page_config,
1440
1436
  status,
@@ -1775,6 +1771,7 @@ async function respond(incoming, options, state = {}) {
1775
1771
  params: request.params,
1776
1772
  options,
1777
1773
  $session: await options.hooks.getSession(request),
1774
+ stuff: {},
1778
1775
  page_config: { ssr: false, router: true, hydrate: true },
1779
1776
  status: 200,
1780
1777
  branch: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.220",
3
+ "version": "1.0.0-next.221",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -110,6 +110,7 @@ declare module '$app/stores' {
110
110
  export const page: Readable<{
111
111
  url: URL;
112
112
  params: Record<string, string>;
113
+ stuff: Record<string, any>;
113
114
  status: number;
114
115
  error: Error | null;
115
116
  }>;
@@ -1,5 +1,5 @@
1
1
  import { ServerRequest } from './hooks';
2
- import { JSONString, MaybePromise, ResponseHeaders } from './helper';
2
+ import { JSONString, MaybePromise, ResponseHeaders, Either, Fallthrough } from './helper';
3
3
 
4
4
  type DefaultBody = JSONString | Uint8Array;
5
5
 
@@ -14,5 +14,7 @@ export interface RequestHandler<
14
14
  Input = unknown,
15
15
  Output extends DefaultBody = DefaultBody
16
16
  > {
17
- (request: ServerRequest<Locals, Input>): MaybePromise<void | EndpointOutput<Output>>;
17
+ (request: ServerRequest<Locals, Input>): MaybePromise<
18
+ Either<EndpointOutput<Output>, Fallthrough>
19
+ >;
18
20
  }
package/types/helper.d.ts CHANGED
@@ -39,3 +39,15 @@ export type RecursiveRequired<T> = {
39
39
  ? Extract<T[K], Function> // only take the Function type.
40
40
  : T[K]; // Use the exact type for everything else
41
41
  };
42
+
43
+ type Only<T, U> = {
44
+ [P in keyof T]: T[P];
45
+ } & {
46
+ [P in keyof U]?: never;
47
+ };
48
+
49
+ export type Either<T, U> = Only<T, U> | Only<U, T>;
50
+
51
+ export interface Fallthrough {
52
+ fallthrough: true;
53
+ }
@@ -10,6 +10,7 @@ import {
10
10
  ServerResponse
11
11
  } from './hooks';
12
12
  import { Load } from './page';
13
+ import { Either, Fallthrough } from './helper';
13
14
 
14
15
  type PageId = string;
15
16
 
@@ -219,13 +220,16 @@ export interface BuildData {
219
220
  entries: string[];
220
221
  }
221
222
 
222
- export interface NormalizedLoadOutput {
223
- status: number;
224
- error?: Error;
225
- redirect?: string;
226
- props?: Record<string, any> | Promise<Record<string, any>>;
227
- stuff?: Record<string, any>;
228
- maxage?: number;
229
- }
223
+ export type NormalizedLoadOutput = Either<
224
+ {
225
+ status: number;
226
+ error?: Error;
227
+ redirect?: string;
228
+ props?: Record<string, any> | Promise<Record<string, any>>;
229
+ stuff?: Record<string, any>;
230
+ maxage?: number;
231
+ },
232
+ Fallthrough
233
+ >;
230
234
 
231
235
  export type TrailingSlash = 'never' | 'always' | 'ignore';
package/types/page.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { InferValue, MaybePromise, Rec } from './helper';
1
+ import { InferValue, MaybePromise, Rec, Either, Fallthrough } from './helper';
2
2
 
3
3
  export interface LoadInput<
4
4
  PageParams extends Rec<string> = Rec<string>,
@@ -51,10 +51,12 @@ export interface Load<
51
51
  InferValue<Input, 'stuff', Rec>,
52
52
  InferValue<Input, 'session', any>
53
53
  >
54
- ): MaybePromise<void | LoadOutput<
55
- InferValue<Output, 'props', Rec>,
56
- InferValue<Output, 'stuff', Rec>
57
- >>;
54
+ ): MaybePromise<
55
+ Either<
56
+ LoadOutput<InferValue<Output, 'props', Rec>, InferValue<Output, 'stuff', Rec>>,
57
+ Fallthrough
58
+ >
59
+ >;
58
60
  }
59
61
 
60
62
  export interface ErrorLoad<