hydrogen
hydrogen copied to clipboard
Fix top level async breaks with routes that don't stream
Description
Fix a critical issue where a top level asynchronous request within App.server.jsx would break if subsequent routes attempt to disable streaming. For example:
// App.server.jsx
export default renderHydrogen() {
useSession();
...
}
// NotFound.server.jsx
export default function NotFound({response}) {
resonse.doNotStream();
...
}
Additional context
Before submitting the PR, please make sure you do the following:
- [ ] Read the Contributing Guidelines
- [ ] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123) - [ ] Update docs in this repository according to your change
- [ ] Run
yarn changeset addif this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning