-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Add Blazor support to an ASP.NET Core app #30791
Conversation
@danroth27 .... I take it you mean in the first two scenarios without a donor that we'll show unstyled components? This goes down a rabbit hole showing a lot of code without it if we show Blazor styling ... and the layout ... and the nav menu. I'll start the write-up without it (no donor, no styling, no layout, no nav menu). |
Ok ... I have just the 🦴 bare bones 🦴 in place to see if this is the general direction that the first two sections need to go without a donor. If we get into the weeds down a rabbit hole 😄, I think the donor is better (i.e., layout, styles, nav menu, the works!). If we just need these absolutely minimal bits, then I think I have about what's needed in the first two sections. |
... and let me know for the 2nd section if you want to include ....... @using static Microsoft.AspNetCore.Components.Web.RenderMode .... and change the @rendermode InteractiveServer |
Yeah, unstyled. Just the minimum required. The existing app will likely already have its own layout and styles. |
It might be best for the last section if we merge the first two sections first but delete the third section, and then I can open a new PR with the third section for feedback. I can do that now if you want. |
Co-authored-by: Daniel Roth <daroth@microsoft.com>
Hold a sec ... I'm going to merge this and add the third section back on a new PR. I'll do more work to the first two sections on Monday. I can get your feedback on the third section today. Stand-by for a sec ....................................... 🏃 |
Oooooops! ... forgot to knock out the link. 🙈 |
|
||
When the app is run, the `Counter` component is accessed at the `/counter` endpoint. | ||
|
||
### Enable interactive Auto or WebAssembly rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also like to simplify this section to make it more minimalistic:
- Clarify at the beginning that the user should first enable support for static server rendering if they don't have that already, like we do in the section on enabling interactive server rendering.
- When creating the donor project use the
--empty
option. We're just trying to enable the project structure, not include the sample pages and content. - Remove step 2 to copy over Bootstrap and the styles. The existing app might not be using Bootstrap.
- Remove step 4. The generated project without sample pages won't have a Components folder. We'll need to add a step to add a component to the client project to demonstrate that it's working.
- Simplify step 10 given that the user has done a bunch of the described changes already as part of enabling static server rendering. Key things are to enable interactive WebAssembly support and to add the client project as an additional assembly
- Step 11 is huge! 😮 I'd like to shrink it way down to just adding another Pages/Counter2.razor component to the client project with
@rendermode InteractiveWebAssembly
orInteractiveAuto
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ... I'll put it on the new PR tho. That way, all lines go in clean for feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! 👍 Most of my feedback is on slimming down the interactive webassembly section.
Fixes #30471
Internal previews