-
Notifications
You must be signed in to change notification settings - Fork 0
Wrapped Proxy Perf Improvements #58
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { dangerouslySkipEscape } from "vike/server"; | ||
| // @ts-ignore vike-react import typescript is wrong | ||
| import { onRenderHtml as vikeReactRender } from "vike-react/__internal/integration/onRenderHtml"; | ||
| import { PageContextServer } from "vike/types"; | ||
|
|
||
| const emptydocument = dangerouslySkipEscape(""); | ||
| export default async function onRenderHtml(pageContext: PageContextServer) { | ||
| if (pageContext._wrappedServerOnly) { | ||
| return await vikeReactRender(pageContext); | ||
| } | ||
| return { documentHtml: emptydocument }; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in wrapped mode we render twice. once for routing, then again after we get data from rails. this adds fast-path for the initial routing render. maybe in the future vike could give us an API for routing w/o rendering |
||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was needed because we were getting "write to stream after end" issues with the streaming. it also seems to improve response time