Skip to content

Commit

Permalink
Update single fetch headers approach to use response stub API (#9142)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Ebey <jacob.ebey@live.com>
  • Loading branch information
brophdawg11 and jacob-ebey committed Mar 27, 2024
1 parent 69f5196 commit 7498997
Show file tree
Hide file tree
Showing 12 changed files with 1,114 additions and 183 deletions.
16 changes: 13 additions & 3 deletions integration/error-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2229,9 +2229,19 @@ test.describe("single fetch", () => {
expect(await app.getHtml("#parent-error")).toEqual(
'<p id="parent-error">Broken!</p>'
);
expect(await app.getHtml("#parent-matches-data")).toEqual(
'<p id="parent-matches-data"></p>'
);
if (javaScriptEnabled) {
// This data remains in single fetch with JS because we don't revalidate
// due to the 500 action response
expect(await app.getHtml("#parent-matches-data")).toEqual(
'<p id="parent-matches-data">PARENT</p>'
);
} else {
// But without JS document requests call all loaders up to the
// boundary route so parent's data clears out
expect(await app.getHtml("#parent-matches-data")).toEqual(
'<p id="parent-matches-data"></p>'
);
}
expect(await app.getHtml("#parent-data")).toEqual(
'<p id="parent-data"></p>'
);
Expand Down
2 changes: 1 addition & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@remix-run/dev": "workspace:*",
"@remix-run/express": "workspace:*",
"@remix-run/node": "workspace:*",
"@remix-run/router": "0.0.0-experimental-c7dd3d3a",
"@remix-run/router": "0.0.0-experimental-0f302655",
"@remix-run/server-runtime": "workspace:*",
"@types/express": "^4.17.9",
"@vanilla-extract/css": "^1.10.0",
Expand Down
6 changes: 3 additions & 3 deletions integration/revalidate-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ test.describe("single fetch", () => {
<li><Link to="/">/</Link></li>
<li><Link to="/parent">/parent</Link></li>
<li><Link to="/parent/child">/parent/child</Link></li>
<li><Link to="/parent/child?revalidate=parent">/parent/child</Link></li>
<li><Link to="/parent/child?revalidate=child">/parent/child</Link></li>
<li><Link to="/parent/child?revalidate=parent,child">/parent/child</Link></li>
<li><Link to="/parent/child?revalidate=parent">/parent/child?revalidate=parent</Link></li>
<li><Link to="/parent/child?revalidate=child">/parent/child?revalidate=child</Link></li>
<li><Link to="/parent/child?revalidate=parent,child">/parent/child?revalidate=parent,child</Link></li>
</ul>
</nav>
<Outlet />
Expand Down

0 comments on commit 7498997

Please sign in to comment.