Files
JJ KasperGitHubShu Dingkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
fdacca8abc Add initial separated route resolving (#47208)
This updates to have a separate routing process and separate rendering
processes for `pages` and `app` so that we can properly isolate the two
since they rely on different react versions.

Besides allowing the above mentioned isolation this also helps us
control recovering from process crashes easier as pieces are more
isolated from one another e.g. an infinite loop during rendering will no
longer block the compiler and can be stopped/restarted as needed.

In follow-up PRs we will continue to separate out the routing logic from
the rendering logic so that each process only loads what is relevant to
it helping simplify the flow for requests regardless of type.

---------

Co-authored-by: Shu Ding <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-02 15:17:15 +02:00

15 lines
415 B
JavaScript

export default (props) => <div id="from-middleware">{props.fromMiddleware}</div>
export async function getServerSideProps({ req, res }) {
return {
props: {
fromMiddleware:
// TODO: this should only use request header once
// start is using the separate renders as well
req.headers['x-from-middleware'] ||
res.getHeader('x-from-middleware') ||
null,
},
}
}