vike-react 0.6.20 → 0.6.21

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.
@@ -55,7 +55,7 @@ async function renderPageToHtml(pageContext) {
55
55
  pageContext.page = getPageElement(pageContext).page;
56
56
  // https://github.com/vikejs/vike-react/issues/87#issuecomment-2488742744
57
57
  await callCumulativeHooks(pageContext.config.onBeforeRenderHtml, pageContext);
58
- const { renderToStringOptions } = resolveReactOptions(pageContext);
58
+ const { renderToStringOptions, renderToStreamOptions } = resolveReactOptions(pageContext);
59
59
  if (pageContext.page) {
60
60
  const streamSetting = resolveStreamSetting(pageContext);
61
61
  if (!streamSetting.enable && !streamSetting.require) {
@@ -83,6 +83,7 @@ async function renderPageToHtml(pageContext) {
83
83
  false,
84
84
  */
85
85
  undefined,
86
+ ...renderToStreamOptions,
86
87
  });
87
88
  pageContext.pageHtmlStream = pageHtmlStream;
88
89
  }
@@ -22,6 +22,7 @@ function resolveReactOptions(pageContext) {
22
22
  // @ts-ignore
23
23
  optionsAcc[fnName][key] = (...args) => {
24
24
  valPrevious?.(...args);
25
+ // @ts-ignore
25
26
  val(...args);
26
27
  };
27
28
  }
@@ -5,6 +5,7 @@ import type { ConfigsCumulative } from '../hooks/useConfig/configsCumulative.js'
5
5
  import type React from 'react';
6
6
  import type { HydrationOptions, RootOptions } from 'react-dom/client';
7
7
  import type { ServerOptions } from 'react-dom/server';
8
+ import type { RenderToStreamOptions } from 'react-streaming/server';
8
9
  declare global {
9
10
  namespace Vike {
10
11
  interface Config {
@@ -262,8 +263,33 @@ type PickWithoutGetter<T, K extends keyof T> = {
262
263
  export type ConfigViaHook = PickWithoutGetter<Vike.Config, 'Head' | 'title' | 'description' | 'image' | 'favicon' | 'lang' | 'viewport' | 'bodyAttributes' | 'htmlAttributes'>;
263
264
  export type ConfigViaHookResolved = Omit<ConfigViaHook, ConfigsCumulative> & Pick<Vike.ConfigResolved, ConfigsCumulative>;
264
265
  export type ReactOptions = {
266
+ /**
267
+ * Options passed to React's `hydrateRoot()`.
268
+ *
269
+ * https://react.dev/reference/react-dom/client/hydrateRoot
270
+ * https://vike.dev/react-setting
271
+ */
265
272
  hydrateRootOptions?: HydrationOptions;
273
+ /**
274
+ * Options passed to React's `createRoot()`.
275
+ *
276
+ * https://react.dev/reference/react-dom/client/createRoot
277
+ * https://vike.dev/react-setting
278
+ */
266
279
  createRootOptions?: RootOptions;
280
+ /**
281
+ * Options passed to React's `renderToString()`.
282
+ *
283
+ * https://react.dev/reference/react-dom/server/renderToString
284
+ * https://vike.dev/react-setting
285
+ */
267
286
  renderToStringOptions?: ServerOptions;
287
+ /**
288
+ * Options passed to `react-streaming`'s `renderToStream()` during SSR streaming.
289
+ *
290
+ * https://github.com/brillout/react-streaming#options
291
+ * https://vike.dev/react-setting
292
+ */
293
+ renderToStreamOptions?: RenderToStreamOptions;
268
294
  };
269
295
  export {};
@@ -3,7 +3,7 @@ export { assertWarning };
3
3
  function assert(condition) {
4
4
  if (condition)
5
5
  return;
6
- throw new Error('You stumbled upon a vike-react bug, reach out on GitHub.');
6
+ throw new Error('[vike-react] You stumbled upon a bug, reach out on GitHub.');
7
7
  }
8
8
  function assertWarning(condition, message) {
9
9
  if (condition)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-react",
3
- "version": "0.6.20",
3
+ "version": "0.6.21",
4
4
  "repository": "https://github.com/vikejs/vike-react",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,7 +31,7 @@
31
31
  "./__internal/integration/Loading": "./dist/integration/Loading.js"
32
32
  },
33
33
  "dependencies": {
34
- "react-streaming": "^0.4.15"
34
+ "react-streaming": "^0.4.16"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": ">=19",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@biomejs/biome": "^1.9.4",
43
- "@brillout/release-me": "^0.4.12",
43
+ "@brillout/release-me": "^0.4.13",
44
44
  "@types/node": "^24.0.8",
45
45
  "@types/react": "^19.1.13",
46
46
  "@types/react-dom": "^19.1.9",
@@ -48,7 +48,7 @@
48
48
  "react-dom": "^19.2.1",
49
49
  "rimraf": "^5.0.5",
50
50
  "typescript": "^5.9.2",
51
- "vike": "^0.4.252",
51
+ "vike": "^0.4.253",
52
52
  "vite": "^7.3.0"
53
53
  },
54
54
  "typesVersions": {