- Notifications
You must be signed in to change notification settings - Fork 10.5k
[Blazor] Support persisting component state on enhanced navigation #62824
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
Conversation
e634740
to 4bc47f9
Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements "Enhanced Nav Agent Mode", adding support for advanced persistent state management in Blazor components with enhanced navigation capabilities. The changes introduce new restore behaviors, allow state updates during enhanced navigation, and improve component state handling across different rendering scenarios.
- New restore behaviors (SkipInitialValue, SkipLastSnapshot) for fine-grained control over when state is restored
- Enhanced navigation support with AllowUpdates property for dynamic state updates
- Improved state persistence management with context-aware restoration
- Test infrastructure enhancements including filtered state properties and non-persisted counters
Reviewed Changes
Copilot reviewed 60 out of 66 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
Components/test/testassets/ | Added filtered state properties and non-persisted counter examples for testing |
Components/test/E2ETest/ | Enhanced tests for state persistence with streaming and enhanced navigation |
Components/WebAssembly/WebAssembly/ | Updated WebAssembly renderer to handle app state during component updates |
Components/Server/ | Enhanced circuit management with restore context and state update handling |
Components/Components/src/ | Core implementation of RestoreBehavior, RestoreContext, and enhanced state management |
src/Components/Components/src/PersistentState/PersistentValueProviderComponentSubscription.cs Outdated Show resolved Hide resolved
src/Components/Components/src/PersistentState/PersistentStateValueProviderKeyResolver.cs Outdated Show resolved Hide resolved
src/Components/Components/src/PersistentState/PersistentStateKeyResolver.cs Outdated Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type was just split off of PersistentStateValueProvider
e741f0b
to 8cb2e7d
Compare src/Components/Components/src/IPersistentComponentStateSerializer.cs Outdated Show resolved Hide resolved
src/Components/Components/src/PersistentState/PersistentValueProviderComponentSubscription.cs Outdated Show resolved Hide resolved
a4b2290
to 14b1124
Compare /backport to release/10.0-preview7 |
Started backporting to release/10.0-preview7: https://github.com/dotnet/aspnetcore/actions/runs/16427035175 |
14b1124
to e19a454
Compare @javiercn any chance for merge? |
e19a454
to 2a9966d
Compare 615d641
to 017df53
Compare * Adds support for ignoring persisted values during prerendering * Adds support for ignoring persisted values during resume * Adds support for receiving value updates during enhanced navigation Fixes #51584
017df53
to b51e028
Compare
Fixes #51584, #62393, #62330, #62781
Detailed design can be found #51584 (comment)