Skip to content
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

Data Strategy Configuration #11098

Merged
merged 56 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8e2e259
wip
jacob-ebey Dec 6, 2023
6bbc243
2 hours...... 😮‍💨
jacob-ebey Dec 7, 2023
4c21cf9
add static handler paths
jacob-ebey Dec 7, 2023
5ecb636
added some initial tests
jacob-ebey Dec 7, 2023
2ca1506
fetchers are always called on their own
jacob-ebey Dec 7, 2023
48d23f1
remove unused lines
jacob-ebey Dec 7, 2023
66c8b7d
add a few more tests
jacob-ebey Dec 8, 2023
562cd60
feat: initial support for lazy
jacob-ebey Dec 8, 2023
d6707a7
chore: add ssr single fetch example
jacob-ebey Dec 10, 2023
32b4ad6
update fixture
jacob-ebey Dec 10, 2023
42530e0
await lazy routes in example
jacob-ebey Dec 10, 2023
9225980
callLoaderOrAction -> callLoaderOrActionImplementation
brophdawg11 Dec 11, 2023
20230d5
filter matches in fixture
jacob-ebey Dec 11, 2023
7e3e660
Merge branch 'dev' into data_strategy
jacob-ebey Dec 13, 2023
ef927da
chore: rename to unstable_dataStrategy
jacob-ebey Jan 22, 2024
fae7726
chore: fix lint
jacob-ebey Jan 22, 2024
e960cf1
chore: update test after rename
jacob-ebey Jan 22, 2024
af7fbcd
Minor refactors
brophdawg11 Jan 29, 2024
4d42692
Merge branch 'dev' into data_strategy
brophdawg11 Jan 29, 2024
719defb
Remove excess callDataStratgy fn
brophdawg11 Jan 29, 2024
109f464
Add more unit tests
brophdawg11 Jan 30, 2024
359a714
Add decision doc
brophdawg11 Jan 31, 2024
0bba762
Rework internals to support HandlerResult and match.handler()
brophdawg11 Feb 1, 2024
57333e0
Switch to match.handler API
brophdawg11 Feb 2, 2024
fad8182
Bump bundle
brophdawg11 Feb 2, 2024
f49bb0c
Update decision doc
brophdawg11 Feb 2, 2024
6bb2c92
Remove match.route promise implementation in favor of handler
brophdawg11 Feb 2, 2024
53eb1a2
Refactor SuccessResult/ErrorResult to hold the raw response
brophdawg11 Feb 2, 2024
64a420e
Convert RedirectResult to use raw response, code cleanup
brophdawg11 Feb 2, 2024
c670e77
Bump bundle
brophdawg11 Feb 2, 2024
4181202
Refactor to new loadRoute/handler API
brophdawg11 Feb 5, 2024
31e619e
Don't export HandlerResult
brophdawg11 Feb 5, 2024
1a60803
Bump bundle
brophdawg11 Feb 5, 2024
dfdc2ce
Allow loaders/actions to be a boolean
brophdawg11 Feb 6, 2024
a088889
Merge branch 'dev' into data_strategy
brophdawg11 Feb 6, 2024
acfea93
Add loadRouteIds and bikeshed_load functionality
brophdawg11 Feb 14, 2024
bf37bae
Bump bundle
brophdawg11 Feb 14, 2024
a8bedaa
Move dataStrategys test to their own file
brophdawg11 Feb 14, 2024
3ba3024
Handle falsy errors correctly
brophdawg11 Feb 14, 2024
2272fa7
Rename bikeshed_loaderRoutes->resolve/bikeshed_load->shouldLoad
brophdawg11 Feb 15, 2024
5bedc16
Add v7_skipActionErrorRevalidation fiuture flag
brophdawg11 Feb 16, 2024
cbcd94b
Proxy along ErrorResponse status codes to ErrorResult
brophdawg11 Feb 16, 2024
0c7e98b
Bump bundle
brophdawg11 Feb 16, 2024
de419c3
Updates
brophdawg11 Feb 16, 2024
885bd5c
Mark DecodedResponse exports as unstable
brophdawg11 Feb 29, 2024
0141b5e
Merge branch 'dev' into data_strategy
brophdawg11 Feb 29, 2024
432fcb2
Remove DecodedResponse and use HandlerResult
brophdawg11 Mar 1, 2024
7110845
Merge branch 'dev' into data_strategy
brophdawg11 Mar 5, 2024
921ace2
Apply suggestions from code review
brophdawg11 Mar 6, 2024
ec2ae97
Merge branch 'dev' into data_strategy
brophdawg11 Mar 8, 2024
c72d536
Updates from final review
brophdawg11 Mar 8, 2024
aa19ad4
Add skipLoaderErrorBubbling and final tests
brophdawg11 Mar 11, 2024
496788e
Fix lint issue
brophdawg11 Mar 11, 2024
a68dbaa
Revert "Fix lint issue"
brophdawg11 Mar 11, 2024
e516247
Revert "Revert "Fix lint issue"" to trigger CI?
brophdawg11 Mar 11, 2024
2a8dc42
Bump buindle
brophdawg11 Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/data-strategy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@remix-run/router": minor
---

Add a new `unstable_dataStrategy` configuration option

- This option allows Data Router applications to take control over the approach for executing route loaders and actions
- 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
11 changes: 11 additions & 0 deletions .changeset/skip-action-revalidation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@remix-run/router": minor
---

Add a new `future.unstable_skipActionRevalidation` future flag

- Currently, active loaders revalidate after any action, regardless of the result
- With this flag enabled, actions that return/throw a 4xx/5xx response status will no longer automatically revalidate
- This should reduce load on your server since it's rare that a 4xx/5xx should actually mutate any data
- If you need to revalidate after a 4xx/5xx result with this flag enabled, you can still do that via returning `true` from `shouldRevalidate`
- `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
8 changes: 8 additions & 0 deletions .changeset/static-query-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@remix-run/router": minor
---

Added 2 new options to the `staticHandler.query` method for use in Remix's Single Fetch implementation:

- `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)
- `skipLoaderErrorBubbling`: Disable error bubbling on loader executions for single-fetch scenarios where the client-side router will handle the bubbling
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
npm-debug.log

/docs/api/
Expand Down
Loading
Loading