epic-stack
epic-stack copied to clipboard
add util for handling remix headers generally
It's a bit tedious to manually merge Remix headers since the process is mostly the same. This PR adds a utility to streamline that process.
Related Discussion #809 More details on the utility: https://gist.github.com/nichtsam/bff3a0e58f7edfad3985e9322582f67f
Test Plan
- There are test cases for various functionalities.
- Test cases with real use cases ensure the utility remains practical.
Checklist
- [x] Tests updated
- [x] Docs updated
Just for the record, reason for switching to draft: https://github.com/privatenumber/tsx/issues/627
This is affecting vite and causing imports behavior to differentiate between tsx and node.
Just for the record, reason for switching to draft: privatenumber/tsx#627 This is affecting
viteand causing imports behavior to differentiate betweentsxandnode.
I switch to another ESM cache-control parser to avoid encountering this issue.
I think React Router v7 (single fetch specifically) changes how headers work a fair bit so I don't think I'll be merging this since I want to get on RR7 soon. Sorry I didn't get to you on this sooner!
I think React Router v7 (single fetch specifically) changes how headers work a fair bit so I don't think I'll be merging this since I want to get on RR7 soon. Sorry I didn't get to you on this sooner!
That’s totally fine! I was also thinking that single fetch might impact things. Just wanted to finish up the PR. No worries, and thanks for the update!
RR7 has been merged! Feel free to check whether this is necessary and update things if so. Thanks!
RR7 has been merged! Feel free to check whether this is necessary and update things if so. Thanks!
I've rebased onto main.
I’ve tested the behavior of headers, and it appears to remain unchanged, where:
- Either
loaderHeadersoractionHeaderswill have a value, but not both at the same time. errorHeaderswill be present when an error occurs and will mirror the value of eitherloaderHeadersoractionHeaders.