-
Notifications
You must be signed in to change notification settings - Fork 367
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
feat: support shouldRevalidate #4781
Conversation
🦋 Changeset detectedLatest commit: bd28c37 The changes in this PR will be included in the next version bump. This PR includes changesets to release 257 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1abe730
to
bd28c37
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4781 +/- ##
==========================================
- Coverage 57.59% 51.19% -6.41%
==========================================
Files 672 681 +9
Lines 17794 18991 +1197
Branches 3876 4391 +515
==========================================
- Hits 10249 9722 -527
- Misses 6934 8539 +1605
- Partials 611 730 +119 ☔ View full report in Codecov by Sentry. |
Summary
🤖 Generated by Copilot at 1abe730
This pull request improves the data fetching and revalidation features of Modern.js and its documentation. It updates the
PrefetchLink
component, theshouldRevalidate
function, and theanalyze
module to handle more complex URL scenarios and route configurations. It also updates the documentation files for data fetching in English and Chinese, and adds and modifies tests and example apps to demonstrate the new features.Details
🤖 Generated by Copilot at 1abe730
createShouldRevalidate
function from the router runtime index file (link)path
object instead of thepathname
string, and to call theshouldRevalidate
function of the matched route if it exists (link, link, link, link, link, link, link)shouldRevalidate
function that creates ashouldRevalidate
function for a given route id (link)walk
function of the nestedRoutes module to return the final route if it has a component but no child routes or index flag (link)shouldRevalidate
property to the final route object, and to filter out theshouldRevalidate
property from the react-router route object (link, link, link, link, link, link, link, link)ROUTE_MODULES
property name in the constants module (link)tests/integration/routes/src/four
to remove the action function from the page component, to use theuseLoaderData
hook instead of theuseParams
hook, and to export theshouldRevalidate
function that checks the query parameter (link, link)tests/integration/routes/src/four
that use the session storage to get and set the data (link, link)tests/integration/routes/src/four
to add two new links to test theshouldRevalidate
function (link)tests/integration/routes/src/three
that returns the id parameter as the data (link)tests/integration/routes/src/three
to use theuseLoaderData
hook instead of theuseParams
hook, and to export theshouldRevalidate
function that checks the query parameter (link)tests/integration/routes/src/three
to add three new links to test the prefetch and shouldRevalidate features (link, link)supportActionInCSR
test function in the index test file (link, link)beforeEach
block of the index test file (link)Related Issue
Checklist
pnpm run change
.