Skip to content

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

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

Open
javiercn opened this issue May 23, 2025 · 0 comments · May be fixed by #62085
Open

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

javiercn opened this issue May 23, 2025 · 0 comments · May be fixed by #62085
Assignees
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@javiercn
Copy link
Member

javiercn commented May 23, 2025

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.

@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label May 23, 2025
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 a pull request may close this issue.

1 participant