@taujs/react 0.0.6 → 0.0.8
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/dist/index.d.ts +2 -2
- package/dist/index.js +15 -9
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -38,12 +38,12 @@ declare const createRenderer: ({ appComponent, headContent }: RendererOptions) =
|
|
|
38
38
|
headContent: string;
|
|
39
39
|
appHtml: string;
|
|
40
40
|
}>;
|
|
41
|
-
renderStream: (serverResponse: ServerResponse, callbacks: RenderCallbacks, initialDataPromise: Record<string, unknown>, location: string, bootstrapModules?: string, meta?: Record<string, unknown
|
|
41
|
+
renderStream: (serverResponse: ServerResponse, callbacks: RenderCallbacks, initialDataPromise: Record<string, unknown>, location: string, bootstrapModules?: string, meta?: Record<string, unknown>, cspNonce?: string) => void;
|
|
42
42
|
};
|
|
43
43
|
declare const createRenderStream: (serverResponse: ServerResponse, { onHead, onFinish, onError }: RenderCallbacks, { appComponent, headContent, initialDataPromise, location, bootstrapModules, }: RendererOptions & {
|
|
44
44
|
initialDataPromise: Record<string, unknown>;
|
|
45
45
|
location: string;
|
|
46
46
|
bootstrapModules?: string;
|
|
47
|
-
}) => void;
|
|
47
|
+
}, cspNonce?: string) => void;
|
|
48
48
|
|
|
49
49
|
export { type SSRStore, SSRStoreProvider, createRenderStream, createRenderer, createSSRStore, hydrateApp, resolveHeadContent, useSSRStore };
|
package/dist/index.js
CHANGED
|
@@ -138,15 +138,20 @@ var createRenderer = ({ appComponent, headContent }) => {
|
|
|
138
138
|
appHtml
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
const renderStream = (serverResponse, callbacks, initialDataPromise, location, bootstrapModules, meta = {}) => {
|
|
141
|
+
const renderStream = (serverResponse, callbacks, initialDataPromise, location, bootstrapModules, meta = {}, cspNonce) => {
|
|
142
142
|
const dynamicHeadContent = resolveHeadContent(headContent, meta);
|
|
143
|
-
createRenderStream(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
createRenderStream(
|
|
144
|
+
serverResponse,
|
|
145
|
+
callbacks,
|
|
146
|
+
{
|
|
147
|
+
appComponent: (props) => appComponent({ ...props, location }),
|
|
148
|
+
headContent: dynamicHeadContent,
|
|
149
|
+
initialDataPromise,
|
|
150
|
+
location,
|
|
151
|
+
bootstrapModules
|
|
152
|
+
},
|
|
153
|
+
cspNonce
|
|
154
|
+
);
|
|
150
155
|
};
|
|
151
156
|
return { renderSSR, renderStream };
|
|
152
157
|
};
|
|
@@ -156,10 +161,11 @@ var createRenderStream = (serverResponse, { onHead, onFinish, onError }, {
|
|
|
156
161
|
initialDataPromise,
|
|
157
162
|
location,
|
|
158
163
|
bootstrapModules
|
|
159
|
-
}) => {
|
|
164
|
+
}, cspNonce) => {
|
|
160
165
|
const store = createSSRStore(initialDataPromise);
|
|
161
166
|
const appElement = /* @__PURE__ */ jsx3(SSRStoreProvider, { store, children: appComponent({ location }) });
|
|
162
167
|
const { pipe } = renderToPipeableStream(appElement, {
|
|
168
|
+
nonce: cspNonce,
|
|
163
169
|
bootstrapModules: bootstrapModules ? [bootstrapModules] : void 0,
|
|
164
170
|
onShellReady() {
|
|
165
171
|
const dynamicHeadContent = resolveHeadContent(headContent, initialDataPromise);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taujs/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "taujs | τjs",
|
|
5
5
|
"author": "Aoede <taujs@aoede.uk.net> (https://www.aoede.uk.net)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"vitest": "^2.0.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@taujs/server": "^0.
|
|
63
|
+
"@taujs/server": "^0.3.0",
|
|
64
64
|
"@vitejs/plugin-react": "^4.6.0",
|
|
65
65
|
"react": "^19.0.0",
|
|
66
66
|
"react-dom": "^19.0.0",
|