Skip to content

Commit

Permalink
feat: make streamIsRequired public
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Jun 5, 2024
1 parent dc1ec7b commit 2829b15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/vike-react-query/renderer/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
queryClientConfig: undefined,
VikeReactQueryWrapper: 'import:vike-react-query/renderer/VikeReactQueryWrapper:default',
FallbackErrorBoundary: 'import:vike-react-query/renderer/FallbackErrorBoundary:default',
_streamIsRequied: true,
streamIsRequired: true,
meta: {
queryClientConfig: {
env: {
Expand Down
8 changes: 2 additions & 6 deletions packages/vike-react/src/renderer/onRenderHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType<OnRender
pageView = ''
} else {
const page = getPageElement(pageContext)
const {
stream,
// @ts-expect-error
_streamIsRequied
} = pageContext.config
if (!stream && !_streamIsRequied) {
const { stream, streamIsRequired } = pageContext.config
if (!stream && !streamIsRequired) {
pageView = dangerouslySkipEscape(renderToString(page))
} else {
const disable = stream === false ? true : undefined
Expand Down
7 changes: 7 additions & 0 deletions packages/vike-react/src/types/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ declare global {
*/
stream?: boolean

/**
* Whether the existence of the React SSR stream is required (some integrations require it).
*
* HTML Streaming can still be disabled: the SSR stream is awaited and converted to a string.
*/
streamIsRequired?: boolean

/**
* Whether to use `<StrictMode>`.
*
Expand Down

0 comments on commit 2829b15

Please sign in to comment.