Skip to content

Commit c7dd3d3

Browse files
authored
Data Strategy Configuration (#11098)
1 parent 4ac3a2c commit c7dd3d3

24 files changed

+3143
-381
lines changed

Diff for: .changeset/data-strategy.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@remix-run/router": minor
3+
---
4+
5+
Add a new `unstable_dataStrategy` configuration option
6+
7+
- This option allows Data Router applications to take control over the approach for executing route loaders and actions
8+
- The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix single-fetch, middleware/context APIs, automatic loader caching, and more

Diff for: .changeset/skip-action-revalidation.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@remix-run/router": minor
3+
---
4+
5+
Add a new `future.unstable_skipActionRevalidation` future flag
6+
7+
- Currently, active loaders revalidate after any action, regardless of the result
8+
- With this flag enabled, actions that return/throw a 4xx/5xx response status will no longer automatically revalidate
9+
- This should reduce load on your server since it's rare that a 4xx/5xx should actually mutate any data
10+
- If you need to revalidate after a 4xx/5xx result with this flag enabled, you can still do that via returning `true` from `shouldRevalidate`
11+
- `shouldRevalidate` now also receives a new `unstable_actionStatus` argument alongside `actionResult` so you can make decision based on the status of the `action` response without having to encode it into the action data

Diff for: .changeset/static-query-flags.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@remix-run/router": minor
3+
---
4+
5+
Added 2 new options to the `staticHandler.query` method for use in Remix's Single Fetch implementation:
6+
7+
- `loadRouteIds`: An optional array of route IDs to load if you wish to load a subset of the matched routes (useful for fine-grained revalidation)
8+
- `skipLoaderErrorBubbling`: Disable error bubbling on loader executions for single-fetch scenarios where the client-side router will handle the bubbling

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
npm-debug.log
23

34
/docs/api/

0 commit comments

Comments
 (0)