feat(inertia): add partial reloads support with lazy function props#1904
Merged
Conversation
🦋 Changeset detectedLatest commit: 0c96f56 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1904 +/- ##
==========================================
+ Coverage 92.02% 92.08% +0.05%
==========================================
Files 115 115
Lines 3936 3965 +29
Branches 1013 1025 +12
==========================================
+ Hits 3622 3651 +29
Misses 282 282
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
yusukebe
reviewed
May 28, 2026
Member
|
@ashunar0 Thanks! I'll merge. |
Merged
This was referenced Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves the first item ("partial reloads") of #1900.
Summary
Adds server-side support for Inertia.js partial reloads:
X-Inertia-Partial-Component,X-Inertia-Partial-Data(only), andX-Inertia-Partial-Exceptheaders.Scope
This PR sticks to the foundation that the rest of the breakdown in #1900 builds on:
only/exceptprops filtering() => T | Promise<T>)X-Inertia-Partial-Componentdoes not match the rendered componentDeferred to follow-up PRs:
<Deferred>)always(fn)marker for one-shot props such as flashed messagesBehavior notes
X-Inertia-Partial-Componentmatches the component being rendered and at least one ofX-Inertia-Partial-Data/X-Inertia-Partial-Exceptis present. Otherwise the request is processed as a normal Inertia visit.Response(non-Promise<Response>) return type for the common case.Backward compatibility
Callers that pass only plain values keep the exact same behavior. The new type
ResolvedProps<P>awaits the return type of any function-valued prop — plain props are pass-through.Tests
9 new tests in
packages/inertia/src/index.test.tscovering the partial filter, lazy invocation skip, async resolution, component mismatch, whitespace handling, only+except intersection, and the "partial-only header without component" guard.The author should do the following, if applicable
yarn changesetat the top of this repo and push the changeset