Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add react-streaming #33

Merged
merged 1 commit into from
Nov 17, 2023
Merged

add react-streaming #33

merged 1 commit into from
Nov 17, 2023

Conversation

nitedani
Copy link
Member

No description provided.

@brillout
Copy link
Member

💯

@brillout brillout merged commit 4b3c4a7 into vikejs:main Nov 17, 2023
@brillout
Copy link
Member

Released as 0.3.3.

(I ain't forgetting about your Vike PR and your DMs, I'll get back to you about these next week. But let me know if you're blocked and I'll have a look at it this weekend.)

Copy link
Contributor

@lourot lourot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for doing this @nitedani. See my two concerns 🙏

@@ -12,20 +12,16 @@ import React from 'react'
checkVikeVersion()

const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType<OnRenderHtmlAsync> => {
let pageHtml = ''
if (!!pageContext.Page) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when pageContext.Page is undefined here this means that ssr: false is being used. Should we still be making use of renderToStream() in this case?

Comment on lines +8 to +10
if (!pageContext.Page) {
return <></>
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is correct to have moved this early return here? As we may have two cases to differentiate:

  1. Page may be undefined but we may still want to render the Wrapper and the Layout, or
  2. Page is undefined because we are running on server and SSR is disabled, in which case not rendering anything is correct. But we don't know this in this function and we shouldn't. This is why this was handled in onRenderHtml in the previous version instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants