@quilted/quilt 0.5.62 → 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 +20 -0
- package/build/cjs/env.cjs +2 -0
- package/build/cjs/html.cjs +4 -0
- package/build/cjs/server/http-handler.cjs +9 -3
- package/build/cjs/static/index.cjs +1 -2
- package/build/esm/env.mjs +1 -0
- package/build/esm/html.mjs +1 -1
- package/build/esm/server/http-handler.mjs +9 -3
- package/build/esm/static/index.mjs +1 -2
- package/build/esnext/env.esnext +1 -0
- package/build/esnext/html.esnext +1 -1
- package/build/esnext/server/http-handler.esnext +9 -3
- package/build/esnext/static/index.esnext +1 -2
- package/build/tsconfig.tsbuildinfo +34 -24
- package/build/typescript/env.d.ts +5 -0
- package/build/typescript/env.d.ts.map +1 -0
- package/build/typescript/html.d.ts +2 -1
- package/build/typescript/html.d.ts.map +1 -1
- package/build/typescript/server/http-handler.d.ts +7 -4
- package/build/typescript/server/http-handler.d.ts.map +1 -1
- package/build/typescript/static/index.d.ts.map +1 -1
- package/package.json +40 -39
- package/sewing-kit.config.ts +1 -0
- package/src/env.ts +5 -0
- package/src/html.ts +2 -0
- package/src/server/http-handler.tsx +22 -11
- package/src/static/index.tsx +0 -2
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
11
|
+
## 0.5.64
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#190](https://github.com/lemonmade/quilt/pull/190) [`9bf454a`](https://github.com/lemonmade/quilt/commit/9bf454aaefc7ac6b85060fc5493b6b3ee4e2b526) Thanks [@lemonmade](https://github.com/lemonmade)! - Add easy environment variables
|
|
16
|
+
|
|
17
|
+
## 0.5.63
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#185](https://github.com/lemonmade/quilt/pull/185) [`3b9a758`](https://github.com/lemonmade/quilt/commit/3b9a758c5703aa63b93a736e33f88a3bfa393fb8) Thanks [@lemonmade](https://github.com/lemonmade)! - Improve package entry declarations
|
|
22
|
+
|
|
3
23
|
## 0.5.62
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/build/cjs/html.cjs
CHANGED
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/build/esm/html.mjs
CHANGED
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/build/esnext/html.esnext
CHANGED
|
@@ -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
|
}
|
|
@@ -1162,9 +1162,9 @@
|
|
|
1162
1162
|
"affectsGlobalScope": false
|
|
1163
1163
|
},
|
|
1164
1164
|
"../../async/build/typescript/global.d.ts": {
|
|
1165
|
-
"version": "
|
|
1166
|
-
"signature": "
|
|
1167
|
-
"affectsGlobalScope":
|
|
1165
|
+
"version": "9eaa5d7e95022f99f9c5d0a800e204645be8a771b772dc2a8969bd11fa6d9c3d",
|
|
1166
|
+
"signature": "9eaa5d7e95022f99f9c5d0a800e204645be8a771b772dc2a8969bd11fa6d9c3d",
|
|
1167
|
+
"affectsGlobalScope": false
|
|
1168
1168
|
},
|
|
1169
1169
|
"../../async/build/typescript/loader.d.ts": {
|
|
1170
1170
|
"version": "39af1ddd7a9fe9bea1b50adfa155fba2f7306fbd7c68647094c8265c1ae5d934",
|
|
@@ -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": "
|
|
1376
|
-
"signature": "
|
|
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": "
|
|
1386
|
-
"signature": "
|
|
1390
|
+
"version": "8eaf869e9c549f227564c10e6fee84e6ce556ef8114a1f9e4effe7876fd98e71",
|
|
1391
|
+
"signature": "8eaf869e9c549f227564c10e6fee84e6ce556ef8114a1f9e4effe7876fd98e71",
|
|
1387
1392
|
"affectsGlobalScope": false
|
|
1388
1393
|
},
|
|
1389
1394
|
"../../performance/build/typescript/performance.d.ts": {
|
|
@@ -1481,14 +1486,19 @@
|
|
|
1481
1486
|
"signature": "74db8898203d9d4aa49fd0eb4f2608aaf6d63d68c39c1df3b7a37129ca729532",
|
|
1482
1487
|
"affectsGlobalScope": false
|
|
1483
1488
|
},
|
|
1489
|
+
"../src/env.ts": {
|
|
1490
|
+
"version": "06689faf7538ac12ac05cf4af8bfe481795bedf6defda7ccb7932275b54d5d21",
|
|
1491
|
+
"signature": "2e1a31d471411b9be7152aa351dfd04772bd73b18c5a853a39f5c07b000f18ce",
|
|
1492
|
+
"affectsGlobalScope": false
|
|
1493
|
+
},
|
|
1484
1494
|
"../src/global.ts": {
|
|
1485
1495
|
"version": "4b6d57bd53bfd6ff76314c8fce64627953a03bfabccd96bf042f6de6ca797b67",
|
|
1486
1496
|
"signature": "26208398168ed2930b36a962dba389b8c40960cddd1b6e1260be106f56bef77f",
|
|
1487
1497
|
"affectsGlobalScope": false
|
|
1488
1498
|
},
|
|
1489
1499
|
"../src/html.ts": {
|
|
1490
|
-
"version": "
|
|
1491
|
-
"signature": "
|
|
1500
|
+
"version": "c6d2a718b84ba4d7a197fe5b4d61e497f3a16b595e70953744bc48ee7f69dab3",
|
|
1501
|
+
"signature": "f9bb17591c90b2210739887097d1fe22047d6514fc7a754c0f57e6d3b8e2cd3c",
|
|
1492
1502
|
"affectsGlobalScope": false
|
|
1493
1503
|
},
|
|
1494
1504
|
"../src/http.ts": {
|
|
@@ -2167,8 +2177,8 @@
|
|
|
2167
2177
|
"affectsGlobalScope": false
|
|
2168
2178
|
},
|
|
2169
2179
|
"../src/server/http-handler.tsx": {
|
|
2170
|
-
"version": "
|
|
2171
|
-
"signature": "
|
|
2180
|
+
"version": "e981253318a3070aa1edfe5ca96180d2bb115925392f1c86173a8182ef60ec2d",
|
|
2181
|
+
"signature": "8541742151f2bce9401a39acb03ce2d1d4a7026556f03916cf6eb4e80f7080af",
|
|
2172
2182
|
"affectsGlobalScope": false
|
|
2173
2183
|
},
|
|
2174
2184
|
"../../react-email/build/typescript/server.d.ts": {
|
|
@@ -2197,7 +2207,7 @@
|
|
|
2197
2207
|
"affectsGlobalScope": false
|
|
2198
2208
|
},
|
|
2199
2209
|
"../src/static/index.tsx": {
|
|
2200
|
-
"version": "
|
|
2210
|
+
"version": "484ef45460d69fee3a479cc925a55ee1c72b4b24baf4fb3789e1bac91e74f830",
|
|
2201
2211
|
"signature": "654cc8b3ee68d511afe7b400f351452de1a25ecff75191355113a8c186ad76c2",
|
|
2202
2212
|
"affectsGlobalScope": false
|
|
2203
2213
|
},
|
|
@@ -4449,9 +4459,6 @@
|
|
|
4449
4459
|
"../../graphql/build/typescript/index.d.ts",
|
|
4450
4460
|
"../../useful-types/build/typescript/index.d.ts"
|
|
4451
4461
|
],
|
|
4452
|
-
"../../react-graphql/build/typescript/hooks/useGraphQL.d.ts": [
|
|
4453
|
-
"../../graphql/build/typescript/index.d.ts"
|
|
4454
|
-
],
|
|
4455
4462
|
"../../react-graphql/build/typescript/hooks/useMutation.d.ts": [
|
|
4456
4463
|
"../../graphql/build/typescript/index.d.ts",
|
|
4457
4464
|
"../../useful-types/build/typescript/index.d.ts"
|
|
@@ -4496,6 +4503,9 @@
|
|
|
4496
4503
|
"../../react-html/build/typescript/components/SearchRobots.d.ts": [
|
|
4497
4504
|
"../../react-html/build/typescript/hooks/index.d.ts"
|
|
4498
4505
|
],
|
|
4506
|
+
"../../react-html/build/typescript/components/Serialize.d.ts": [
|
|
4507
|
+
"../../react-html/build/typescript/types.d.ts"
|
|
4508
|
+
],
|
|
4499
4509
|
"../../react-html/build/typescript/components/ThemeColor.d.ts": [
|
|
4500
4510
|
"../../react-html/build/typescript/hooks/index.d.ts"
|
|
4501
4511
|
],
|
|
@@ -4511,6 +4521,7 @@
|
|
|
4511
4521
|
"../../react-html/build/typescript/components/Link.d.ts",
|
|
4512
4522
|
"../../react-html/build/typescript/components/Meta.d.ts",
|
|
4513
4523
|
"../../react-html/build/typescript/components/SearchRobots.d.ts",
|
|
4524
|
+
"../../react-html/build/typescript/components/Serialize.d.ts",
|
|
4514
4525
|
"../../react-html/build/typescript/components/ThemeColor.d.ts",
|
|
4515
4526
|
"../../react-html/build/typescript/components/Title.d.ts",
|
|
4516
4527
|
"../../react-html/build/typescript/components/Viewport.d.ts"
|
|
@@ -4641,9 +4652,6 @@
|
|
|
4641
4652
|
"../../react-http/build/typescript/hooks/content-security-policy.d.ts": [
|
|
4642
4653
|
"../../http/build/typescript/index.d.ts"
|
|
4643
4654
|
],
|
|
4644
|
-
"../../react-http/build/typescript/hooks/cookie.d.ts": [
|
|
4645
|
-
"../../http/build/typescript/index.d.ts"
|
|
4646
|
-
],
|
|
4647
4655
|
"../../react-http/build/typescript/hooks/http-action.d.ts": [
|
|
4648
4656
|
"../../react-http/build/typescript/manager.d.ts"
|
|
4649
4657
|
],
|
|
@@ -4693,9 +4701,6 @@
|
|
|
4693
4701
|
"../../../node_modules/.pnpm/@types+react@17.0.13/node_modules/@types/react/index.d.ts",
|
|
4694
4702
|
"../../performance/build/typescript/index.d.ts"
|
|
4695
4703
|
],
|
|
4696
|
-
"../../react-performance/build/typescript/hooks.d.ts": [
|
|
4697
|
-
"../../performance/build/typescript/index.d.ts"
|
|
4698
|
-
],
|
|
4699
4704
|
"../../react-performance/build/typescript/index.d.ts": [
|
|
4700
4705
|
"../../performance/build/typescript/index.d.ts",
|
|
4701
4706
|
"../../react-performance/build/typescript/PerformanceContext.d.ts",
|
|
@@ -4772,8 +4777,7 @@
|
|
|
4772
4777
|
"../../routing/build/typescript/index.d.ts"
|
|
4773
4778
|
],
|
|
4774
4779
|
"../../react-router/build/typescript/hooks/navigate.d.ts": [
|
|
4775
|
-
"../../react-router/build/typescript/router.d.ts"
|
|
4776
|
-
"../../routing/build/typescript/index.d.ts"
|
|
4780
|
+
"../../react-router/build/typescript/router.d.ts"
|
|
4777
4781
|
],
|
|
4778
4782
|
"../../react-router/build/typescript/hooks/navigation-block.d.ts": [
|
|
4779
4783
|
"../../react-router/build/typescript/types.d.ts"
|
|
@@ -6314,7 +6318,7 @@
|
|
|
6314
6318
|
"../../react-http/build/typescript/server.d.ts"
|
|
6315
6319
|
],
|
|
6316
6320
|
"../src/server/http-handler.tsx": [
|
|
6317
|
-
"../../../node_modules/@types/react/index.d.ts",
|
|
6321
|
+
"../../../node_modules/.pnpm/@types+react@17.0.13/node_modules/@types/react/index.d.ts",
|
|
6318
6322
|
"../../async/build/typescript/server.d.ts",
|
|
6319
6323
|
"../../http-handlers/build/typescript/index.d.ts"
|
|
6320
6324
|
],
|
|
@@ -6501,6 +6505,9 @@
|
|
|
6501
6505
|
"../../react-html/build/typescript/components/SearchRobots.d.ts": [
|
|
6502
6506
|
"../../react-html/build/typescript/hooks/index.d.ts"
|
|
6503
6507
|
],
|
|
6508
|
+
"../../react-html/build/typescript/components/Serialize.d.ts": [
|
|
6509
|
+
"../../react-html/build/typescript/types.d.ts"
|
|
6510
|
+
],
|
|
6504
6511
|
"../../react-html/build/typescript/components/ThemeColor.d.ts": [
|
|
6505
6512
|
"../../react-html/build/typescript/hooks/index.d.ts"
|
|
6506
6513
|
],
|
|
@@ -6516,6 +6523,7 @@
|
|
|
6516
6523
|
"../../react-html/build/typescript/components/Link.d.ts",
|
|
6517
6524
|
"../../react-html/build/typescript/components/Meta.d.ts",
|
|
6518
6525
|
"../../react-html/build/typescript/components/SearchRobots.d.ts",
|
|
6526
|
+
"../../react-html/build/typescript/components/Serialize.d.ts",
|
|
6519
6527
|
"../../react-html/build/typescript/components/ThemeColor.d.ts",
|
|
6520
6528
|
"../../react-html/build/typescript/components/Title.d.ts",
|
|
6521
6529
|
"../../react-html/build/typescript/components/Viewport.d.ts"
|
|
@@ -7310,6 +7318,7 @@
|
|
|
7310
7318
|
"../../polyfills/build/typescript/noop.d.ts",
|
|
7311
7319
|
"../src/App.tsx",
|
|
7312
7320
|
"../src/email.ts",
|
|
7321
|
+
"../src/env.ts",
|
|
7313
7322
|
"../src/global.ts",
|
|
7314
7323
|
"../src/html.ts",
|
|
7315
7324
|
"../src/http-handlers/index.ts",
|
|
@@ -7374,6 +7383,7 @@
|
|
|
7374
7383
|
"../../react-html/build/typescript/components/Link.d.ts",
|
|
7375
7384
|
"../../react-html/build/typescript/components/Meta.d.ts",
|
|
7376
7385
|
"../../react-html/build/typescript/components/SearchRobots.d.ts",
|
|
7386
|
+
"../../react-html/build/typescript/components/Serialize.d.ts",
|
|
7377
7387
|
"../../react-html/build/typescript/components/ThemeColor.d.ts",
|
|
7378
7388
|
"../../react-html/build/typescript/components/Title.d.ts",
|
|
7379
7389
|
"../../react-html/build/typescript/components/Viewport.d.ts",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;CAAG;AAExC,OAAO,CAAC,MAAM,GAAG,EAAE,oBAAoB,CAAC;AAExC,eAAe,GAAG,CAAC"}
|
|
@@ -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<
|
|
9
|
-
export declare function createServerRenderingHttpHandler(App: ComponentType<
|
|
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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/static/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAOvD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAI1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAOD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAID,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EACvB,EACE,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,KAAY,EACZ,OAAkB,EAClB,QAAe,GAChB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/static/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAOvD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAI1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAOD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAID,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EACvB,EACE,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,KAAY,EACZ,OAAkB,EAClB,QAAe,GAChB,EAAE,OAAO,iBAsOX"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quilted/quilt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.65",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/lemonmade/quilt.git",
|
|
@@ -14,110 +14,111 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"quilt:
|
|
18
|
-
"
|
|
17
|
+
"quilt:from-source": "./src/index.ts",
|
|
18
|
+
"quilt:esnext": "./build/esnext/index.esnext",
|
|
19
19
|
"import": "./build/esm/index.mjs",
|
|
20
20
|
"require": "./build/cjs/index.cjs"
|
|
21
21
|
},
|
|
22
22
|
"./server": {
|
|
23
|
-
"quilt:
|
|
24
|
-
"
|
|
23
|
+
"quilt:from-source": "./src/server/index.ts",
|
|
24
|
+
"quilt:esnext": "./build/esnext/server/index.esnext",
|
|
25
25
|
"import": "./build/esm/server/index.mjs",
|
|
26
26
|
"require": "./build/cjs/server/index.cjs"
|
|
27
27
|
},
|
|
28
28
|
"./static": {
|
|
29
|
-
"quilt:
|
|
30
|
-
"
|
|
29
|
+
"quilt:from-source": "./src/static/index.tsx",
|
|
30
|
+
"quilt:esnext": "./build/esnext/static/index.esnext",
|
|
31
31
|
"import": "./build/esm/static/index.mjs",
|
|
32
32
|
"require": "./build/cjs/static/index.cjs"
|
|
33
33
|
},
|
|
34
34
|
"./html": {
|
|
35
|
-
"quilt:
|
|
36
|
-
"
|
|
35
|
+
"quilt:from-source": "./src/html.ts",
|
|
36
|
+
"quilt:esnext": "./build/esnext/html.esnext",
|
|
37
37
|
"import": "./build/esm/html.mjs",
|
|
38
38
|
"require": "./build/cjs/html.cjs"
|
|
39
39
|
},
|
|
40
40
|
"./email": {
|
|
41
|
-
"quilt:
|
|
42
|
-
"
|
|
41
|
+
"quilt:from-source": "./src/email.ts",
|
|
42
|
+
"quilt:esnext": "./build/esnext/email.esnext",
|
|
43
43
|
"import": "./build/esm/email.mjs",
|
|
44
44
|
"require": "./build/cjs/email.cjs"
|
|
45
45
|
},
|
|
46
46
|
"./global": {
|
|
47
|
-
"quilt:
|
|
48
|
-
"
|
|
47
|
+
"quilt:from-source": "./src/global.ts",
|
|
48
|
+
"quilt:esnext": "./build/esnext/global.esnext",
|
|
49
49
|
"import": "./build/esm/global.mjs",
|
|
50
50
|
"require": "./build/cjs/global.cjs"
|
|
51
51
|
},
|
|
52
52
|
"./http": {
|
|
53
|
-
"quilt:
|
|
54
|
-
"
|
|
53
|
+
"quilt:from-source": "./src/http.ts",
|
|
54
|
+
"quilt:esnext": "./build/esnext/http.esnext",
|
|
55
55
|
"import": "./build/esm/http.mjs",
|
|
56
56
|
"require": "./build/cjs/http.cjs"
|
|
57
57
|
},
|
|
58
58
|
"./testing": {
|
|
59
|
-
"quilt:
|
|
60
|
-
"
|
|
59
|
+
"quilt:from-source": "./src/testing.ts",
|
|
60
|
+
"quilt:esnext": "./build/esnext/testing.esnext",
|
|
61
61
|
"import": "./build/esm/testing.mjs",
|
|
62
62
|
"require": "./build/cjs/testing.cjs"
|
|
63
63
|
},
|
|
64
64
|
"./matchers": {
|
|
65
|
-
"quilt:
|
|
66
|
-
"
|
|
65
|
+
"quilt:from-source": "./src/matchers.ts",
|
|
66
|
+
"quilt:esnext": "./build/esnext/matchers.esnext",
|
|
67
67
|
"import": "./build/esm/matchers.mjs",
|
|
68
68
|
"require": "./build/cjs/matchers.cjs"
|
|
69
69
|
},
|
|
70
70
|
"./react/jsx-runtime": {
|
|
71
|
-
"quilt:
|
|
72
|
-
"
|
|
71
|
+
"quilt:from-source": "./src/react/jsx-runtime.ts",
|
|
72
|
+
"quilt:esnext": "./build/esnext/react/jsx-runtime.esnext",
|
|
73
73
|
"import": "./build/esm/react/jsx-runtime.mjs",
|
|
74
74
|
"require": "./build/cjs/react/jsx-runtime.cjs"
|
|
75
75
|
},
|
|
76
76
|
"./react/server": {
|
|
77
|
-
"quilt:
|
|
78
|
-
"
|
|
77
|
+
"quilt:from-source": "./src/react/server.ts",
|
|
78
|
+
"quilt:esnext": "./build/esnext/react/server.esnext",
|
|
79
79
|
"import": "./build/esm/react/server.mjs",
|
|
80
80
|
"require": "./build/cjs/react/server.cjs"
|
|
81
81
|
},
|
|
82
82
|
"./react": {
|
|
83
|
-
"quilt:
|
|
84
|
-
"
|
|
83
|
+
"quilt:from-source": "./src/react/index.ts",
|
|
84
|
+
"quilt:esnext": "./build/esnext/react/index.esnext",
|
|
85
85
|
"import": "./build/esm/react/index.mjs",
|
|
86
86
|
"require": "./build/cjs/react/index.cjs"
|
|
87
87
|
},
|
|
88
88
|
"./http-handlers/node": {
|
|
89
|
-
"quilt:
|
|
90
|
-
"
|
|
89
|
+
"quilt:from-source": "./src/http-handlers/node.ts",
|
|
90
|
+
"quilt:esnext": "./build/esnext/http-handlers/node.esnext",
|
|
91
91
|
"import": "./build/esm/http-handlers/node.mjs",
|
|
92
92
|
"require": "./build/cjs/http-handlers/node.cjs"
|
|
93
93
|
},
|
|
94
94
|
"./http-handlers": {
|
|
95
|
-
"quilt:
|
|
96
|
-
"
|
|
95
|
+
"quilt:from-source": "./src/http-handlers/index.ts",
|
|
96
|
+
"quilt:esnext": "./build/esnext/http-handlers/index.esnext",
|
|
97
97
|
"import": "./build/esm/http-handlers/index.mjs",
|
|
98
98
|
"require": "./build/cjs/http-handlers/index.cjs"
|
|
99
99
|
},
|
|
100
100
|
"./polyfills/base": {
|
|
101
|
-
"quilt:
|
|
102
|
-
"
|
|
101
|
+
"quilt:from-source": "./src/polyfills/base.ts",
|
|
102
|
+
"quilt:esnext": "./build/esnext/polyfills/base.esnext",
|
|
103
103
|
"import": "./build/esm/polyfills/base.mjs",
|
|
104
104
|
"require": "./build/cjs/polyfills/base.cjs"
|
|
105
105
|
},
|
|
106
106
|
"./polyfills/fetch": {
|
|
107
|
-
"quilt:
|
|
108
|
-
"
|
|
107
|
+
"quilt:from-source": "./src/polyfills/fetch.ts",
|
|
108
|
+
"quilt:esnext": "./build/esnext/polyfills/fetch.esnext",
|
|
109
109
|
"import": "./build/esm/polyfills/fetch.mjs",
|
|
110
110
|
"require": "./build/cjs/polyfills/fetch.cjs"
|
|
111
111
|
},
|
|
112
112
|
"./polyfills/noop": {
|
|
113
|
-
"quilt:
|
|
114
|
-
"
|
|
113
|
+
"quilt:from-source": "./src/polyfills/noop.ts",
|
|
114
|
+
"quilt:esnext": "./build/esnext/polyfills/noop.esnext",
|
|
115
115
|
"import": "./build/esm/polyfills/noop.mjs",
|
|
116
116
|
"require": "./build/cjs/polyfills/noop.cjs"
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
+
"types": "./build/typescript/index.d.ts",
|
|
119
120
|
"typesVersions": {
|
|
120
|
-
"
|
|
121
|
+
"*": {
|
|
121
122
|
"server": [
|
|
122
123
|
"./build/typescript/server/index.d.ts"
|
|
123
124
|
],
|
|
@@ -133,6 +134,9 @@
|
|
|
133
134
|
"global": [
|
|
134
135
|
"./build/typescript/global.d.ts"
|
|
135
136
|
],
|
|
137
|
+
"env": [
|
|
138
|
+
"./build/typescript/env.d.ts"
|
|
139
|
+
],
|
|
136
140
|
"http": [
|
|
137
141
|
"./build/typescript/http.d.ts"
|
|
138
142
|
],
|
|
@@ -174,9 +178,6 @@
|
|
|
174
178
|
],
|
|
175
179
|
"magic/http-handler": [
|
|
176
180
|
"./build/typescript/magic/http-handler.d.ts"
|
|
177
|
-
],
|
|
178
|
-
"*": [
|
|
179
|
-
"./build/typescript/index.d.ts"
|
|
180
181
|
]
|
|
181
182
|
}
|
|
182
183
|
},
|
package/sewing-kit.config.ts
CHANGED
|
@@ -6,6 +6,7 @@ export default createPackage((pkg) => {
|
|
|
6
6
|
pkg.entry({source: './src/html', name: 'html'});
|
|
7
7
|
pkg.entry({source: './src/email', name: 'email'});
|
|
8
8
|
pkg.entry({source: './src/global', name: 'global'});
|
|
9
|
+
pkg.entry({source: './src/env', name: 'env'});
|
|
9
10
|
pkg.entry({source: './src/react', name: 'react'});
|
|
10
11
|
pkg.entry({
|
|
11
12
|
source: './src/react/server',
|
package/src/env.ts
ADDED
package/src/html.ts
CHANGED
|
@@ -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
|
|
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<
|
|
22
|
-
{
|
|
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
|
-
|
|
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<
|
|
80
|
-
{
|
|
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
|
}
|
package/src/static/index.tsx
CHANGED
package/tsconfig.json
CHANGED