hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Fix top level async breaks with routes that don't stream

Open blittle opened this issue 3 years ago • 0 comments

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 add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

blittle avatar Oct 28 '22 20:10 blittle