Skip to content

[Blazor] Remove internals visible to from Components -> Components.Server #62084

Open
@javiercn

Description

@javiercn

https://github.com/dotnet/aspnetcore/blame/64262a764941e1956b28e854fb24679057e9ebc4/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj#L82C11-L82C11

We don't do IvT across framework assemblies other than tests. Components.Web is a special case.

Microsoft.AspNetCore.Components should not have an InternalsVisibleTo reference to Microsoft.AspNetCore.Components.Server.
This makes the entire Microsoft.AspNetCore.Components assembly public to Microsoft.AspNetCore.Components.Server, which is undesirable.
We want to avoid coupling our abstractions to specific render mode implementations.
FailCircuitActivity should receive and tag the activity with the circuit ID.
There is a missing StopCircuitActivity; we need to track not only when circuits start, but also when they finish.
The renderer can capture Activity.Current:
It is the HttpRequestIn activity during SSR.
It is the CircuitStart activity during interactive rendering.
The renderer should pass the activity at creation time to the ComponentActivitySource.
StartCircuit must occur in ComponentHub so it can capture HostInitialization.
CircuitId must be created ahead of time so it can be added to the activity.
ComponentActivitySource needs to be split into two separate sources:
CircuitActivitySource for Start/Stop/Fail circuit.
ComponentActivitySource for the remaining methods.
It should link the activity captured by the renderer.
Optionally, copy tags from that activity (including circuitId), but only if necessary, since tags are available on the linked activity.
This approach avoids InternalsVisibleTo and keeps ComponentActivitySource from referencing concepts it shouldn’t be aware of, such as HTTP or circuit.

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions