-
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
Add support for X-Remix-Reload-Document header #6842
Add support for X-Remix-Reload-Document header #6842
Conversation
|
Name | Type |
---|---|
@remix-run/cloudflare | Minor |
@remix-run/deno | Minor |
@remix-run/node | Minor |
@remix-run/server-runtime | Minor |
@remix-run/cloudflare-pages | Minor |
@remix-run/cloudflare-workers | Minor |
@remix-run/architect | Minor |
@remix-run/express | Minor |
@remix-run/serve | Minor |
@remix-run/testing | Minor |
@remix-run/dev | Minor |
@remix-run/react | Minor |
create-remix | Minor |
remix | Minor |
@remix-run/css-bundle | Minor |
@remix-run/eslint-config | Minor |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Any idea when this is going to land? Need any help getting this in |
@zackeryg see remix-run/react-router#10705 (comment) |
Thanks @robbtraister! We updated to an experimental react router version in #7040 so this is good to merge to dev and ship in Remix v2. I added an integration test as well so I'll get this merge once CI passes. |
if (revalidate) { | ||
headers["X-Remix-Revalidate"] = revalidate; | ||
} | ||
let reloadDocument = response.headers.get("X-Remix-Reload-Document"); | ||
if (reloadDocument) { | ||
headers["X-Remix-Reload-Document"] = reloadDocument; | ||
} |
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.
@brophdawg11 do you think it's worth refactoring this into an array + for-loop (or .forEach or .reduce)?
something like:
let HEADERS_TO_PRESERVE = ["X-Remix-Revalidate", "X-Remix-Reload-Document"];
...
for (let headerName of HEADERS_TO_PRESERVE) {
let headerValue = response.headers.get(headerName);
if (headerValue) {
headers[headerName] = headerValue;
}
}
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.
nah not yet for the 2nd header - something something kent c dodds avoid hasty abstractions :)
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
This PR is paired with remix-run/react-router#10705 to add support for passing along the
X-Remix-Reload-Document
header.Open Development discussion