fix(EditorForm): add IsFixed parameter prevent trigger OnParameterSet#7324
fix(EditorForm): add IsFixed parameter prevent trigger OnParameterSet#7324
Conversation
Co-Authored-By: Tony-ST0754 <244411587+tony-st0754@users.noreply.github.com>
This reverts commit a41d194.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts the EditorForm cascading values so that the EditorForm instance is treated as a fixed cascading value, preventing unnecessary OnParametersSet triggers, while leaving the editor items collection dynamic. Sequence diagram for EditorForm cascading value with IsFixed optimizationsequenceDiagram
actor User
participant Browser
participant ParentComponent
participant EditorForm
participant CascadingValue_EditorItems as CascadingValue_EditorItems
participant CascadingValue_EditorForm as CascadingValue_EditorForm_IsFixedTrue
participant ChildEditorItem
User->>Browser: Interact with page
Browser->>ParentComponent: Trigger state change
ParentComponent->>EditorForm: Render EditorForm
EditorForm->>CascadingValue_EditorItems: Provide _editorItems(IsFixed=false)
CascadingValue_EditorItems->>ChildEditorItem: Update cascading parameter editorItems
ChildEditorItem->>ChildEditorItem: OnParametersSet (editorItems changed)
EditorForm->>CascadingValue_EditorForm: Provide this(IsFixed=true)
CascadingValue_EditorForm->>ChildEditorItem: Initial cascading parameter EditorForm
ChildEditorItem->>ChildEditorItem: OnParametersSet (EditorForm set first time)
loop Subsequent ParentComponent renders
Browser->>ParentComponent: Further state change
ParentComponent->>EditorForm: Re-render EditorForm
EditorForm->>CascadingValue_EditorItems: Update _editorItems(IsFixed=false)
CascadingValue_EditorItems->>ChildEditorItem: Update cascading parameter editorItems
ChildEditorItem->>ChildEditorItem: OnParametersSet (editorItems changed)
EditorForm->>CascadingValue_EditorForm: Provide this(IsFixed=true)
CascadingValue_EditorForm--xChildEditorItem: No cascading update (value fixed)
ChildEditorItem->>ChildEditorItem: OnParametersSet not triggered by EditorForm
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
This PR optimizes the EditorForm component's cascading value behavior to prevent unnecessary OnParametersSet calls in child components. The change addresses issue #7312 by adding the IsFixed="true" parameter to the CascadingValue that provides the EditorForm instance to descendants.
Key changes:
- Added
IsFixed="true"to the EditorFormCascadingValueto prevent unnecessary parameter updates in child components - Removed BOM (Byte Order Mark) character from the Razor file
- Changed version from 10.1.4-beta05 to 10.1.3
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/EditorForm/EditorForm.razor | Added IsFixed="true" to the EditorForm CascadingValue to optimize performance by preventing unnecessary OnParametersSet calls in descendant components like DisplayBase |
| src/BootstrapBlazor/BootstrapBlazor.csproj | Version changed from 10.1.4-beta05 to 10.1.3, which appears to be a version downgrade |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| <PropertyGroup> | ||
| <Version>10.1.4-beta05</Version> | ||
| <Version>10.1.3</Version> |
There was a problem hiding this comment.
The version has been changed from 10.1.4-beta05 to 10.1.3, which represents a downgrade from a beta version to an older stable version. This appears to be unintentional and could cause confusion in versioning. If this is a fix for version 10.1.3, consider using 10.1.3.1 or 10.1.4 instead. If this is intentional, please clarify the versioning strategy.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7324 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 747 747
Lines 32714 32714
Branches 4534 4534
=========================================
Hits 32714 32714
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:
|
Link issues
fixes #7312
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhancements: