vike-react 0.4.14 → 0.4.16
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/README.md +2 -5
- package/dist/+config.js +1 -1
- package/dist/renderer/onRenderHtml.js +4 -3
- package/dist/types/Config.d.ts +8 -2
- package/package.json +4 -4
package/README.md
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
See also:
|
4
|
-
- Docs at [`vike.dev`](https://vike.dev) and [`vike.dev/vike-react`](https://vike.dev/vike-react)
|
5
|
-
- [CHANGELOG.md](https://github.com/vikejs/vike-react/blob/main/packages/vike-react/CHANGELOG.md)
|
1
|
+
Docs: [vike.dev/vike-react](https://vike.dev/vike-react)
|
2
|
+
Source code: [GitHub > vikejs/vike-react](https://github.com/vikejs/vike-react)
|
package/dist/+config.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
// https://vike.dev/onRenderHtml
|
2
2
|
export { onRenderHtml };
|
3
|
+
import React from 'react';
|
3
4
|
import { renderToString } from 'react-dom/server';
|
4
5
|
import { renderToStream } from 'react-streaming/server';
|
5
|
-
import {
|
6
|
+
import { dangerouslySkipEscape, escapeInject, version } from 'vike/server';
|
7
|
+
import { PageContextProvider } from '../hooks/usePageContext.js';
|
6
8
|
import { getHeadSetting } from './getHeadSetting.js';
|
7
9
|
import { getPageElement } from './getPageElement.js';
|
8
|
-
import { PageContextProvider } from '../hooks/usePageContext.js';
|
9
|
-
import React from 'react';
|
10
10
|
checkVikeVersion();
|
11
11
|
addEcosystemStamp();
|
12
12
|
const onRenderHtml = async (pageContext) => {
|
@@ -35,6 +35,7 @@ const onRenderHtml = async (pageContext) => {
|
|
35
35
|
else {
|
36
36
|
const disable = stream === false ? true : undefined;
|
37
37
|
pageView = await renderToStream(page, {
|
38
|
+
webStream: typeof stream === 'string' ? stream === 'web' : undefined,
|
38
39
|
userAgent: pageContext.headers?.['user-agent'] ||
|
39
40
|
// Deprecated way of acccessing User Agent header. Eventually remove it.
|
40
41
|
pageContext.userAgent,
|
package/dist/types/Config.d.ts
CHANGED
@@ -42,14 +42,20 @@ declare global {
|
|
42
42
|
*/
|
43
43
|
ssr?: boolean;
|
44
44
|
/**
|
45
|
-
* Whether to stream the page's HTML.
|
45
|
+
* Whether to stream the page's HTML.
|
46
|
+
*
|
47
|
+
* Requires Server-Side Rendering (`ssr: true`).
|
48
|
+
*
|
49
|
+
* A Node.js Stream is used whenever possible, falling back to a Web Stream otherwise.
|
50
|
+
*
|
51
|
+
* By setting the value to `web` or `node`, you force the usage of a Web Stream or Node.js Stream.
|
46
52
|
*
|
47
53
|
* @default false
|
48
54
|
*
|
49
55
|
* https://vike.dev/stream
|
50
56
|
*
|
51
57
|
*/
|
52
|
-
stream?: boolean;
|
58
|
+
stream?: boolean | 'node' | 'web';
|
53
59
|
/**
|
54
60
|
* Whether the existence of the React SSR stream is required (some integrations require it).
|
55
61
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vike-react",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.16",
|
4
4
|
"type": "module",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"peerDependencies": {
|
24
24
|
"react": ">=18.0.0",
|
25
25
|
"react-dom": ">=18.0.0",
|
26
|
-
"vike": ">=0.4.
|
26
|
+
"vike": ">=0.4.178",
|
27
27
|
"vite": ">=4.3.8"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
@@ -36,10 +36,10 @@
|
|
36
36
|
"react-dom": "^18.2.0",
|
37
37
|
"rimraf": "^5.0.5",
|
38
38
|
"typescript": "^5.3.3",
|
39
|
-
"vike": "^0.4.
|
39
|
+
"vike": "^0.4.178"
|
40
40
|
},
|
41
41
|
"dependencies": {
|
42
|
-
"react-streaming": "^0.3.
|
42
|
+
"react-streaming": "^0.3.36"
|
43
43
|
},
|
44
44
|
"typesVersions": {
|
45
45
|
"*": {
|