-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(rendering): allow framework renders to be cancelled #10448
Conversation
🦋 Changeset detectedLatest commit: dd66cdf The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
||
describe('Streaming', () => { | ||
if (isWindows) return; |
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.
The test suite passes on windows. Was there another reason these were skipped?
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.
No idea, to be honest. But if it passes, happy days!
function handleCancellation(e: unknown) { | ||
if (result.cancelled) return { render() {} }; | ||
throw e; | ||
} |
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.
I was thinking we can wrap this entire function body with a try..catch
, but this also works for me.
Changes
renderTemplate()
did not complete - an error was thrown before we could get references to the expressions.renderComponent()
allowed us to get a reference the promise that would reject, and we could handle it.Testing
node --test test/streaming.test.js
.Docs