@quilted/quilt 0.5.64 → 0.5.65

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @quilted/quilt
2
2
 
3
+ ## 0.5.65
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c58ca94`](https://github.com/lemonmade/quilt/commit/c58ca9468f24c1cc193d67f56692e07e71e918ab) Thanks [@lemonmade](https://github.com/lemonmade)! - Add `Serialize` component
8
+
9
+ * [`f75a035`](https://github.com/lemonmade/quilt/commit/f75a035e5a6ec857497f28da9f0f0ba2d5d6112a) Thanks [@lemonmade](https://github.com/lemonmade)! - Add props customization to Quilt server handler
10
+
3
11
  ## 0.5.64
4
12
 
5
13
  ### Patch Changes
@@ -38,6 +38,10 @@ Object.defineProperty(exports, 'SearchRobots', {
38
38
  enumerable: true,
39
39
  get: function () { return reactHtml.SearchRobots; }
40
40
  });
41
+ Object.defineProperty(exports, 'Serialize', {
42
+ enumerable: true,
43
+ get: function () { return reactHtml.Serialize; }
44
+ });
41
45
  Object.defineProperty(exports, 'ThemeColor', {
42
46
  enumerable: true,
43
47
  get: function () { return reactHtml.ThemeColor; }
@@ -8,7 +8,8 @@ var render = require('./render.cjs');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
 
10
10
  function createServerRenderingRequestHandler(App, {
11
- assets
11
+ assets,
12
+ renderProps = () => ({})
12
13
  }) {
13
14
  return async request => {
14
15
  const accepts = request.headers.get('Accept');
@@ -18,7 +19,10 @@ function createServerRenderingRequestHandler(App, {
18
19
  http,
19
20
  markup,
20
21
  asyncAssets
21
- } = await render.renderApp( /*#__PURE__*/jsxRuntime.jsx(App, {}), {
22
+ } = await render.renderApp( /*#__PURE__*/jsxRuntime.jsx(App, { ...renderProps?.({
23
+ request
24
+ })
25
+ }), {
22
26
  url: request.url,
23
27
  headers: request.headers
24
28
  });
@@ -67,12 +71,14 @@ function createServerRenderingRequestHandler(App, {
67
71
  function createServerRenderingHttpHandler(App, {
68
72
  assets,
69
73
  before,
74
+ renderProps,
70
75
  handler = httpHandlers.createHttpHandler({
71
76
  before
72
77
  })
73
78
  }) {
74
79
  handler.get(createServerRenderingRequestHandler(App, {
75
- assets
80
+ assets,
81
+ renderProps
76
82
  }));
77
83
  return handler;
78
84
  }
@@ -1 +1 @@
1
- export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
1
+ export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, Serialize, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
@@ -4,7 +4,8 @@ import { renderApp } from './render.mjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  function createServerRenderingRequestHandler(App, {
7
- assets
7
+ assets,
8
+ renderProps = () => ({})
8
9
  }) {
9
10
  return async request => {
10
11
  const accepts = request.headers.get('Accept');
@@ -14,7 +15,10 @@ function createServerRenderingRequestHandler(App, {
14
15
  http,
15
16
  markup,
16
17
  asyncAssets
17
- } = await renderApp( /*#__PURE__*/jsx(App, {}), {
18
+ } = await renderApp( /*#__PURE__*/jsx(App, { ...renderProps?.({
19
+ request
20
+ })
21
+ }), {
18
22
  url: request.url,
19
23
  headers: request.headers
20
24
  });
@@ -63,12 +67,14 @@ function createServerRenderingRequestHandler(App, {
63
67
  function createServerRenderingHttpHandler(App, {
64
68
  assets,
65
69
  before,
70
+ renderProps,
66
71
  handler = createHttpHandler({
67
72
  before
68
73
  })
69
74
  }) {
70
75
  handler.get(createServerRenderingRequestHandler(App, {
71
- assets
76
+ assets,
77
+ renderProps
72
78
  }));
73
79
  return handler;
74
80
  }
@@ -1 +1 @@
1
- export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
1
+ export { Alternate, BodyAttributes, Favicon, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, Serialize, ThemeColor, Title, Viewport, getSerialized, useAlternateUrl, useBodyAttributes, useFavicon, useHtmlAttributes, useHtmlUpdater, useLink, useLocale, useMeta, useSearchRobots, useSerialized, useThemeColor, useTitle, useViewport } from '@quilted/react-html';
@@ -4,7 +4,8 @@ import { renderApp } from './render.esnext';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  function createServerRenderingRequestHandler(App, {
7
- assets
7
+ assets,
8
+ renderProps = () => ({})
8
9
  }) {
9
10
  return async request => {
10
11
  const accepts = request.headers.get('Accept');
@@ -14,7 +15,10 @@ function createServerRenderingRequestHandler(App, {
14
15
  http,
15
16
  markup,
16
17
  asyncAssets
17
- } = await renderApp( /*#__PURE__*/jsx(App, {}), {
18
+ } = await renderApp( /*#__PURE__*/jsx(App, { ...renderProps?.({
19
+ request
20
+ })
21
+ }), {
18
22
  url: request.url,
19
23
  headers: request.headers
20
24
  });
@@ -63,12 +67,14 @@ function createServerRenderingRequestHandler(App, {
63
67
  function createServerRenderingHttpHandler(App, {
64
68
  assets,
65
69
  before,
70
+ renderProps,
66
71
  handler = createHttpHandler({
67
72
  before
68
73
  })
69
74
  }) {
70
75
  handler.get(createServerRenderingRequestHandler(App, {
71
- assets
76
+ assets,
77
+ renderProps
72
78
  }));
73
79
  return handler;
74
80
  }
@@ -1361,6 +1361,11 @@
1361
1361
  "signature": "7b8258cea764d31f57a226f22cf1345dfe51ae36ff98004ccca31a624c713c51",
1362
1362
  "affectsGlobalScope": false
1363
1363
  },
1364
+ "../../react-html/build/typescript/components/Serialize.d.ts": {
1365
+ "version": "d6049d5d26a6b1bf6ec762c61bd66f5fcfb653563686aec9bcc966e8f2df77f4",
1366
+ "signature": "d6049d5d26a6b1bf6ec762c61bd66f5fcfb653563686aec9bcc966e8f2df77f4",
1367
+ "affectsGlobalScope": false
1368
+ },
1364
1369
  "../../react-html/build/typescript/components/Viewport.d.ts": {
1365
1370
  "version": "27255bfeac3fa4d1bdd926f4fab4e338b6d61bcbd22c96aa336d731a26613d06",
1366
1371
  "signature": "27255bfeac3fa4d1bdd926f4fab4e338b6d61bcbd22c96aa336d731a26613d06",
@@ -1372,8 +1377,8 @@
1372
1377
  "affectsGlobalScope": false
1373
1378
  },
1374
1379
  "../../react-html/build/typescript/components/index.d.ts": {
1375
- "version": "95d2acee9f62e1e687f440403a7fb05da252bb1885757d474354035eeb210fb7",
1376
- "signature": "95d2acee9f62e1e687f440403a7fb05da252bb1885757d474354035eeb210fb7",
1380
+ "version": "d190c435d53105b4ce7dbce59f601a189406c0c81f0bb52b9ce004af15935e86",
1381
+ "signature": "d190c435d53105b4ce7dbce59f601a189406c0c81f0bb52b9ce004af15935e86",
1377
1382
  "affectsGlobalScope": false
1378
1383
  },
1379
1384
  "../../react-html/build/typescript/utilities/serialization.d.ts": {
@@ -1382,8 +1387,8 @@
1382
1387
  "affectsGlobalScope": false
1383
1388
  },
1384
1389
  "../../react-html/build/typescript/index.d.ts": {
1385
- "version": "b399b06684a2a236942417d5a9141813176f4a0480a624ffdfb2d3613b060c8f",
1386
- "signature": "b399b06684a2a236942417d5a9141813176f4a0480a624ffdfb2d3613b060c8f",
1390
+ "version": "8eaf869e9c549f227564c10e6fee84e6ce556ef8114a1f9e4effe7876fd98e71",
1391
+ "signature": "8eaf869e9c549f227564c10e6fee84e6ce556ef8114a1f9e4effe7876fd98e71",
1387
1392
  "affectsGlobalScope": false
1388
1393
  },
1389
1394
  "../../performance/build/typescript/performance.d.ts": {
@@ -1492,8 +1497,8 @@
1492
1497
  "affectsGlobalScope": false
1493
1498
  },
1494
1499
  "../src/html.ts": {
1495
- "version": "fb61b875f2a13f2c58a97c7936cab35f577e755b9433b857fb3979ccd20a67f1",
1496
- "signature": "89ab0443c3e43427e656c2bdb419f6a867c318300230a79b1536e6319dad36f9",
1500
+ "version": "c6d2a718b84ba4d7a197fe5b4d61e497f3a16b595e70953744bc48ee7f69dab3",
1501
+ "signature": "f9bb17591c90b2210739887097d1fe22047d6514fc7a754c0f57e6d3b8e2cd3c",
1497
1502
  "affectsGlobalScope": false
1498
1503
  },
1499
1504
  "../src/http.ts": {
@@ -2172,8 +2177,8 @@
2172
2177
  "affectsGlobalScope": false
2173
2178
  },
2174
2179
  "../src/server/http-handler.tsx": {
2175
- "version": "c70f0b72782746792c879cd1e753e4013192484f48e163c3159fc09eeda80b88",
2176
- "signature": "dc5c88d8037a2a5a5f369f71f96ccd9d8fcdcddb3a10df8b942991d478b59d41",
2180
+ "version": "e981253318a3070aa1edfe5ca96180d2bb115925392f1c86173a8182ef60ec2d",
2181
+ "signature": "8541742151f2bce9401a39acb03ce2d1d4a7026556f03916cf6eb4e80f7080af",
2177
2182
  "affectsGlobalScope": false
2178
2183
  },
2179
2184
  "../../react-email/build/typescript/server.d.ts": {
@@ -4498,6 +4503,9 @@
4498
4503
  "../../react-html/build/typescript/components/SearchRobots.d.ts": [
4499
4504
  "../../react-html/build/typescript/hooks/index.d.ts"
4500
4505
  ],
4506
+ "../../react-html/build/typescript/components/Serialize.d.ts": [
4507
+ "../../react-html/build/typescript/types.d.ts"
4508
+ ],
4501
4509
  "../../react-html/build/typescript/components/ThemeColor.d.ts": [
4502
4510
  "../../react-html/build/typescript/hooks/index.d.ts"
4503
4511
  ],
@@ -4513,6 +4521,7 @@
4513
4521
  "../../react-html/build/typescript/components/Link.d.ts",
4514
4522
  "../../react-html/build/typescript/components/Meta.d.ts",
4515
4523
  "../../react-html/build/typescript/components/SearchRobots.d.ts",
4524
+ "../../react-html/build/typescript/components/Serialize.d.ts",
4516
4525
  "../../react-html/build/typescript/components/ThemeColor.d.ts",
4517
4526
  "../../react-html/build/typescript/components/Title.d.ts",
4518
4527
  "../../react-html/build/typescript/components/Viewport.d.ts"
@@ -6309,7 +6318,7 @@
6309
6318
  "../../react-http/build/typescript/server.d.ts"
6310
6319
  ],
6311
6320
  "../src/server/http-handler.tsx": [
6312
- "../../../node_modules/@types/react/index.d.ts",
6321
+ "../../../node_modules/.pnpm/@types+react@17.0.13/node_modules/@types/react/index.d.ts",
6313
6322
  "../../async/build/typescript/server.d.ts",
6314
6323
  "../../http-handlers/build/typescript/index.d.ts"
6315
6324
  ],
@@ -6496,6 +6505,9 @@
6496
6505
  "../../react-html/build/typescript/components/SearchRobots.d.ts": [
6497
6506
  "../../react-html/build/typescript/hooks/index.d.ts"
6498
6507
  ],
6508
+ "../../react-html/build/typescript/components/Serialize.d.ts": [
6509
+ "../../react-html/build/typescript/types.d.ts"
6510
+ ],
6499
6511
  "../../react-html/build/typescript/components/ThemeColor.d.ts": [
6500
6512
  "../../react-html/build/typescript/hooks/index.d.ts"
6501
6513
  ],
@@ -6511,6 +6523,7 @@
6511
6523
  "../../react-html/build/typescript/components/Link.d.ts",
6512
6524
  "../../react-html/build/typescript/components/Meta.d.ts",
6513
6525
  "../../react-html/build/typescript/components/SearchRobots.d.ts",
6526
+ "../../react-html/build/typescript/components/Serialize.d.ts",
6514
6527
  "../../react-html/build/typescript/components/ThemeColor.d.ts",
6515
6528
  "../../react-html/build/typescript/components/Title.d.ts",
6516
6529
  "../../react-html/build/typescript/components/Viewport.d.ts"
@@ -7370,6 +7383,7 @@
7370
7383
  "../../react-html/build/typescript/components/Link.d.ts",
7371
7384
  "../../react-html/build/typescript/components/Meta.d.ts",
7372
7385
  "../../react-html/build/typescript/components/SearchRobots.d.ts",
7386
+ "../../react-html/build/typescript/components/Serialize.d.ts",
7373
7387
  "../../react-html/build/typescript/components/ThemeColor.d.ts",
7374
7388
  "../../react-html/build/typescript/components/Title.d.ts",
7375
7389
  "../../react-html/build/typescript/components/Viewport.d.ts",
@@ -1,2 +1,3 @@
1
- export { Alternate, BodyAttributes, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, ThemeColor, Title, Viewport, Favicon, useAlternateUrl, useSerialized, useBodyAttributes, useHtmlAttributes, useFavicon, useLink, useLocale, useMeta, useSearchRobots, useThemeColor, useTitle, useViewport, useHtmlUpdater, getSerialized, } from '@quilted/react-html';
1
+ export { Alternate, BodyAttributes, HtmlAttributes, Hydrator, Link, Meta, SearchRobots, Serialize, ThemeColor, Title, Viewport, Favicon, useAlternateUrl, useSerialized, useBodyAttributes, useHtmlAttributes, useFavicon, useLink, useLocale, useMeta, useSearchRobots, useThemeColor, useTitle, useViewport, useHtmlUpdater, getSerialized, } from '@quilted/react-html';
2
+ export type { Serializable } from '@quilted/react-html';
2
3
  //# sourceMappingURL=html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/html.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,eAAe,EACf,aAAa,EACb,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/html.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,eAAe,EACf,aAAa,EACb,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC"}
@@ -1,10 +1,13 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { AssetLoader } from '@quilted/async/server';
3
- import type { HttpHandler, RequestHandler, HttpHandlerOptions } from '@quilted/http-handlers';
4
- export interface Options extends Pick<HttpHandlerOptions, 'before'> {
3
+ import type { Request, HttpHandler, RequestHandler, HttpHandlerOptions } from '@quilted/http-handlers';
4
+ export interface Options<Props = Record<string, never>> extends Pick<HttpHandlerOptions, 'before'> {
5
5
  assets: AssetLoader<unknown>;
6
6
  handler?: HttpHandler;
7
+ renderProps?(options: {
8
+ request: Request;
9
+ }): Props;
7
10
  }
8
- export declare function createServerRenderingRequestHandler(App: ComponentType<any>, { assets }: Pick<Options, 'assets'>): RequestHandler;
9
- export declare function createServerRenderingHttpHandler(App: ComponentType<any>, { assets, before, handler }: Options): HttpHandler;
11
+ export declare function createServerRenderingRequestHandler<Props>(App: ComponentType<Props>, { assets, renderProps, }: Pick<Options<Props>, 'assets' | 'renderProps'>): RequestHandler;
12
+ export declare function createServerRenderingHttpHandler<Props>(App: ComponentType<Props>, { assets, before, renderProps, handler, }: Options<Props>): HttpHandler;
10
13
  //# sourceMappingURL=http-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../../src/server/http-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAIvD,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,OAAQ,SAAQ,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IACjE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,wBAAgB,mCAAmC,CACjD,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EACvB,EAAC,MAAM,EAAC,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,GAChC,cAAc,CAqDhB;AAED,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EACvB,EAAC,MAAM,EAAE,MAAM,EAAE,OAAqC,EAAC,EAAE,OAAO,eAIjE"}
1
+ {"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../../src/server/http-handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAIvD,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,cAAc,EACd,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CACpD,SAAQ,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC1C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,WAAW,CAAC,CAAC,OAAO,EAAE;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,GAAG,KAAK,CAAC;CAClD;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EACvD,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EACzB,EACE,MAAM,EACN,WAA+B,GAChC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,GAChD,cAAc,CAqDhB;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EACpD,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EACzB,EACE,MAAM,EACN,MAAM,EACN,WAAW,EACX,OAAqC,GACtC,EAAE,OAAO,CAAC,KAAK,CAAC,eAIlB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quilted/quilt",
3
3
  "type": "module",
4
- "version": "0.5.64",
4
+ "version": "0.5.65",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/lemonmade/quilt.git",
package/src/html.ts CHANGED
@@ -6,6 +6,7 @@ export {
6
6
  Link,
7
7
  Meta,
8
8
  SearchRobots,
9
+ Serialize,
9
10
  ThemeColor,
10
11
  Title,
11
12
  Viewport,
@@ -25,3 +26,4 @@ export {
25
26
  useHtmlUpdater,
26
27
  getSerialized,
27
28
  } from '@quilted/react-html';
29
+ export type {Serializable} from '@quilted/react-html';
@@ -1,10 +1,11 @@
1
1
  import type {ComponentType} from 'react';
2
2
 
3
3
  import type {AssetLoader} from '@quilted/async/server';
4
- import {render, Html} from '@quilted/react-html/server';
4
+ import {render as renderToString, Html} from '@quilted/react-html/server';
5
5
 
6
6
  import {createHttpHandler, html, redirect} from '@quilted/http-handlers';
7
7
  import type {
8
+ Request,
8
9
  HttpHandler,
9
10
  RequestHandler,
10
11
  HttpHandlerOptions,
@@ -12,14 +13,19 @@ import type {
12
13
 
13
14
  import {renderApp} from './render';
14
15
 
15
- export interface Options extends Pick<HttpHandlerOptions, 'before'> {
16
+ export interface Options<Props = Record<string, never>>
17
+ extends Pick<HttpHandlerOptions, 'before'> {
16
18
  assets: AssetLoader<unknown>;
17
19
  handler?: HttpHandler;
20
+ renderProps?(options: {request: Request}): Props;
18
21
  }
19
22
 
20
- export function createServerRenderingRequestHandler(
21
- App: ComponentType<any>,
22
- {assets}: Pick<Options, 'assets'>,
23
+ export function createServerRenderingRequestHandler<Props>(
24
+ App: ComponentType<Props>,
25
+ {
26
+ assets,
27
+ renderProps = () => ({} as any),
28
+ }: Pick<Options<Props>, 'assets' | 'renderProps'>,
23
29
  ): RequestHandler {
24
30
  return async (request) => {
25
31
  const accepts = request.headers.get('Accept');
@@ -31,7 +37,7 @@ export function createServerRenderingRequestHandler(
31
37
  http,
32
38
  markup,
33
39
  asyncAssets,
34
- } = await renderApp(<App />, {
40
+ } = await renderApp(<App {...renderProps?.({request})} />, {
35
41
  url: request.url,
36
42
  headers: request.headers,
37
43
  });
@@ -57,7 +63,7 @@ export function createServerRenderingRequestHandler(
57
63
  ]);
58
64
 
59
65
  return html(
60
- render(
66
+ renderToString(
61
67
  <Html
62
68
  manager={htmlManager}
63
69
  styles={styles}
@@ -75,10 +81,15 @@ export function createServerRenderingRequestHandler(
75
81
  };
76
82
  }
77
83
 
78
- export function createServerRenderingHttpHandler(
79
- App: ComponentType<any>,
80
- {assets, before, handler = createHttpHandler({before})}: Options,
84
+ export function createServerRenderingHttpHandler<Props>(
85
+ App: ComponentType<Props>,
86
+ {
87
+ assets,
88
+ before,
89
+ renderProps,
90
+ handler = createHttpHandler({before}),
91
+ }: Options<Props>,
81
92
  ) {
82
- handler.get(createServerRenderingRequestHandler(App, {assets}));
93
+ handler.get(createServerRenderingRequestHandler(App, {assets, renderProps}));
83
94
  return handler;
84
95
  }