Replies: 1 comment 1 reply
-
I'm not quite sure what issue you're having. It may be helpful to provide some examples. Remix loaders and actions return standard export async function loader() {
return fetch(...)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Allow Passthrough Responses by Returning a Request
When building for the edge, we often want to pass through particular requests. For example, consider the case of static files collected in a particular route. If remix gets a request on this route, we'd want remix to avoid fetching the s3 all-together, and just return the request we want the cloudfront/cloudflare/fastly distribution to use.
That's the easy case for which there are some platform specific workarounds. But more complex cases might have Remix applying more complicated logic to alter the request.
This seems to be a key capability given remix's goal to be built for the Edge.
The problem
Proposed solution
No Disruption to the current API
As far as I can tell it would leave everything else intact, without any disruption. Any projects that don't use this feature would not be impacted. Currently request responses are not used for anything else.
Not Difficult to Implement?
This should be straight forward to implement as it's logic can be confined entirely within a single special case in (1) the adapter plugins and (2) the dev server. That means would be releasable without requiring a feature-flag for backward compatibility.
Other options?
There may be a better way to accomplish this. If so, please let me know. Feel free to edit or revise this proposals as needed.
NOTE: Perhaps this should be throwing a request instead of returning one.
Beta Was this translation helpful? Give feedback.
All reactions