-
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
Resource Route Single Fetch Updates #9349
Conversation
🦋 Changeset detectedLatest commit: 19a4b17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
1c641bf
to
cc1aed7
Compare
cc1aed7
to
beef932
Compare
…derFunctionArgs_SingleFetch
9f2dff9
to
a299c07
Compare
@brophdawg11, does it mean that we can’t benefit from turbo-stream Date/Set/Map/Promise types in a useFetcher which load()s a resource route? |
…r of LoaderFunctionArgs_SingleFetch" This reverts commit a299c07.
@manzano78 No - when a fetcher hits a resource route it will still make a |
@brophdawg11 yes I can reproduce the turbo-stream format but since json() applies a simple |
I'm not sure what the issue is. Fetchers can load from resource routes returning raw objects and they will be streamed using This PR does not change that behavior when accessed via a fetcher. If you are still having issues, would you be able to please open a github issue with a minimal reproduction? |
} | ||
``` | ||
|
||
To keep things consistent, resource route `loader`/`action` functions will still receive a `response` stub and you can use it if you need to (maybe to share code amongst non-resource-route handlers): |
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.
This is a great improvement, thank you! I ran into this after I refactored our authenticate
helper to take the response stub to append the Set-Cookie
header, so it's really nice to be able to use that from resource routes as well.
"@remix-run/server-runtime": patch | ||
--- | ||
|
||
Pass `response` stub to resource route handlerså when single fetch is enabled |
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.
There is an errant å
in the changset text.
When single fetch is enabled:
json()
and a deprecation warning is loggedresponse
stub for consistency and it will be respected, but the preferred way to handle status/headers is via your returnedResponse
Closes #9314