-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
fix(react-router/server-runtime): delay turbo-stream
serialization of .data
redirects
#14205
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(react-router/server-runtime): delay turbo-stream
serialization of .data
redirects
#14205
Conversation
🦋 Changeset detectedLatest commit: 71c1f8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
16f464f
to
71c1f8c
Compare
🤖 Hello there, We just published version Thanks! |
turbo-stream
serialization of .data
redirects
turbo-stream
serialization of .data
redirectsturbo-stream
serialization of .data
redirects
🤖 Hello there, We just published version Thanks! |
@brophdawg11, I think this change may have unintentionally had the opposite effect on our Playwright integration tests. We have route actions that throw redirects in specific cases. Until now, tests for those cases could just examine a response object's As of 7.8.2, it looks like those tests would instead "have to be aware of the implementation detail that is the turbo-stream encoding and the 202 response". I have no idea what to do with this finding, what do you think? Should I file a bug, a request for test tools, or something else entirely? |
@aaronadamsCA I think I would need to see an example. This shouldn't change anything about how redirects are returned on document or data requests:
What should change here is the point in time when redirects on Here's a quick example: https://stackblitz.com/edit/github-5cdfffvj?file=app%2Froutes%2Fredirect.tsx If you downgrade that to 7.8.1 you can see the old 202 behavior. |
This dedupes a good bit of code and keeps the middleware chain a bit more consistent between document/data requests since you can now inspect and "see" a redirect in both cases and you don't have to be aware of the implementation detail that is the turbo-stream encoding and the 202 response. We just wait until right before we send the response before we serialize it via turbo-stream.