Skip to content

CssBuilder/StyleBuilder: declare as readonly struct#12598

Merged
ScarletKuro merged 2 commits intoMudBlazor:devfrom
ScarletKuro:cssbuild_per
Feb 2, 2026
Merged

CssBuilder/StyleBuilder: declare as readonly struct#12598
ScarletKuro merged 2 commits intoMudBlazor:devfrom
ScarletKuro:cssbuild_per

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented Feb 2, 2026

Something we forgot to do.
The readonly struct increases performance as as it avoids hidden defensive copies.

trade off:
default(CssBuilder) / default(StyleBuilder) will throw NullReferenceException at runtime

We don't support it anymore.

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests

@ScarletKuro ScarletKuro added the breaking change This change will require consumer code updates label Feb 2, 2026
@mudbot mudbot bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library performance Time/memory/CPU/allocation performance characteristics labels Feb 2, 2026
@ScarletKuro ScarletKuro merged commit 352af0b into MudBlazor:dev Feb 2, 2026
6 checks passed
@ScarletKuro ScarletKuro removed the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Feb 2, 2026
@ScarletKuro ScarletKuro deleted the cssbuild_per branch February 2, 2026 01:29
@ScarletKuro ScarletKuro mentioned this pull request Feb 11, 2026
9 tasks
This was referenced Feb 20, 2026
This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates performance Time/memory/CPU/allocation performance characteristics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant