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

Support controlling render modes and RendererInfo during testing #1596

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

linkdotnet
Copy link
Collaborator

@linkdotnet linkdotnet commented Nov 1, 2024

.net 9 related changes

  • docs
  • @rendermode on element
  • top level @rendermode

@egil egil force-pushed the net9 branch 2 times, most recently from b5c8029 to e835c6c Compare November 15, 2024 16:30
@egil egil changed the title Net9 Support controlling render modes and RendererInfo during testing Nov 15, 2024
@egil
Copy link
Member

egil commented Nov 15, 2024

@linkdotnet force pushed some changes!

I think this is done, but there may be some improvements to the code before we merge in.

@egil
Copy link
Member

egil commented Nov 15, 2024

Just tagging @scottsauber and @linkdotnet to see if you have suggestions to improve the code. Did some changes after the stream.

Still missing a documentation page.

/// Gets or sets the <see cref="IComponentRenderMode"/> that will be specified in
/// the render tree for component the parameters are being passed to.
/// </summary>
public IComponentRenderMode? RenderMode { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

This and the ToRenderFragment method should probably have been on the builder, but that we can move in V2, where the types are internal.

/// </summary>
/// <param name="renderMode">The render mode to assign to the component, e.g. <c>RenderMode.InteractiveServer</c>, or <see langword="null"/>, to not assign a specific render mode.</param>
/// <returns>This <see cref="ComponentParameterCollectionBuilder{TComponent}"/>.</returns>
public ComponentParameterCollectionBuilder<TComponent> SetAssignedRenderMode(IComponentRenderMode? renderMode)
Copy link
Member

Choose a reason for hiding this comment

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

Set still seems like the right name. Matches the SetRendererInfo on Renderer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, yeah see comment above

@@ -104,6 +112,9 @@ void AddComponent(RenderTreeBuilder builder)
{
builder.OpenComponent<TComponent>(0);
AddAttributes(builder);
#if NET9_0_OR_GREATER
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SetRenderMode would be better as this doesn’t have collection like behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants