Skip to content
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

[Blazor] Rename ComponentPlatform to RendererInfo #56263

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Jun 17, 2024

Renames as per #56047 (comment)

Fixes #56047

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jun 17, 2024
@javiercn javiercn force-pushed the javiercn/rename-component-platform-to-renderer-info branch from d0b90cc to c1cfe2e Compare June 17, 2024 09:41
@javiercn javiercn marked this pull request as ready for review June 17, 2024 09:49
@javiercn javiercn requested a review from a team as a code owner June 17, 2024 09:49
/// <summary>
/// Gets the name of the platform.
/// </summary>
public string Name { get; } = rendererName;
Copy link
Member

@SteveSandersonMS SteveSandersonMS Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just academic, but I'm curious how this differs from:

public string Name => rendererName;

I would have thought doing it like this reduces the amount of storage required since we're reading the primary constructor's generated field directly instead of copying it into another field on construction, but maybe the compiler optimizes it to be the same regardless.

Not a big deal but if you happen to know then I'm interested!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler optimizes that afaik.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was curious and checked; the generated code is virtually identical. In both cases there's only one backing field.

Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
@javiercn javiercn enabled auto-merge (squash) June 17, 2024 11:44
@javiercn javiercn merged commit d57ef96 into main Jun 17, 2024
26 checks passed
@javiercn javiercn deleted the javiercn/rename-component-platform-to-renderer-info branch June 17, 2024 14:17
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview6 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconsider the Platform concept in the new render mode detection API
2 participants