Skip to content

[Blazor] Rename ComponentPlatform to RendererInfo#56263

Merged
javiercn merged 2 commits intomainfrom
javiercn/rename-component-platform-to-renderer-info
Jun 17, 2024
Merged

[Blazor] Rename ComponentPlatform to RendererInfo#56263
javiercn merged 2 commits intomainfrom
javiercn/rename-component-platform-to-renderer-info

Conversation

@javiercn
Copy link
Copy Markdown
Member

@javiercn javiercn commented Jun 17, 2024

Renames as per #56047 (comment)

Fixes #56047

@ghost ghost 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
Comment thread src/Components/Components/src/RenderTree/RendererInfo.cs Outdated
/// <summary>
/// Gets the name of the platform.
/// </summary>
public string Name { get; } = rendererName;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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>
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