Skip to content

[Blazor] Enables the client to initiate blazor server-side renders #13147

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

Merged
merged 8 commits into from
Aug 17, 2019

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Aug 14, 2019

  • Remove the need to register components.
  • Removes all overloads of MapComponentHub that takes a component type.
  • Adds a RenderMode to define how to render a component.
    • HTML: Renders the component as static HTML.
    • Server: Renders a placeholder for the component so that the client can start a blazor application.
    • ServerPrerender: Prerenders the component and includes a marker before an after so that a blazor application can be started.

Fixes #12795

@javiercn javiercn requested review from rynowak and removed request for SteveSandersonMS August 14, 2019 22:52
@javiercn javiercn force-pushed the javiercn/blazor-multiple-component-entry-points branch from 236bc70 to dce881e Compare August 14, 2019 23:49
Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

I've given this a look, and I'm fairly happy with what I'm seeing in the product code.

I don't really get what's going on with some of these test changes, and I think it deserves more dicussion.

@rynowak
Copy link
Member

rynowak commented Aug 16, 2019

I also want to know if we can find a better way than relying on HttpContext.Items.

@javiercn javiercn force-pushed the javiercn/blazor-multiple-component-entry-points branch from 5ddcab7 to 96d4773 Compare August 16, 2019 12:34
Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

We discussed offline about the test changes here, and why changing something is necessary. Basically since it's no longer possible to host server-side components in static HTML we haven't change how the server-side tests work.

@javiercn - has some ideas about what we should do here to try to and make this simpler in the future. Right now what's here isn't great - there are like 3 different strategies in use. He's going to follow up after we close down preview 9.

@javiercn javiercn force-pushed the javiercn/blazor-multiple-component-entry-points branch from 9d1227e to 966435a Compare August 16, 2019 18:18
@rynowak rynowak force-pushed the javiercn/blazor-multiple-component-entry-points branch from 966435a to bea1dad Compare August 16, 2019 23:02
* Removes all overloads that register a component statically with aborts
  selector.
* Updates render component to have a RenderMode parameter that indicates
  how the component must render. Valid values are Static, Server, and
  ServerPrerendered.
* When using Server or ServerPrerendered we emit marker comments into
  the page that are later used by blazor.server.js to bootrstrap a
  blazor server-side application.
@javiercn javiercn force-pushed the javiercn/blazor-multiple-component-entry-points branch from bea1dad to 475e7e7 Compare August 17, 2019 11:36
@javiercn javiercn merged commit 74b8015 into release/3.0 Aug 17, 2019
@ghost ghost deleted the javiercn/blazor-multiple-component-entry-points branch August 17, 2019 18:45
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.

4 participants