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

Blazor United feedback (it's good) #46292

Closed
simonziegler opened this issue Jan 27, 2023 · 12 comments
Closed

Blazor United feedback (it's good) #46292

simonziegler opened this issue Jan 27, 2023 · 12 comments
Labels
area-blazor Includes: Blazor, Razor Components
Milestone

Comments

@simonziegler
Copy link

@SteveSandersonMS tweeted his Blazor United demonstration, and he invited comment on GitHub.

My only comment is "yes please, in full".

In one stroke this demo answers a bunch of wish-list items I have for the future of how best to render my web app and to integrate it within a broader website. Achieving the results shown in the demo in that or a similar manner would be a wonderful result.

@simonziegler simonziegler added the design-proposal This issue represents a design proposal for a different issue, linked in the description label Jan 27, 2023
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Jan 27, 2023
@syedqutub
Copy link

Loved the demo and got goose bumps when say how easy it was to switch the rendring modes without losing the component based design of blazor. But would it ve possible to dynamically switch from server to wasm mode as soon as wasm binaries all download in Auto mode?

@tstockwell
Copy link

Apologies in advance if adding to this issue is bad form, but here goes :-)....

First, Blazor is amazing and the ability to make Blazor pages routable is awesome!

However, as a developer that's done Razor Pages and Blazor I prefer creating templates with Razor Pages because I find them way more easy to maintain and create. And that's mostly due to tag helpers.
For now, I prefer to stick to simpler Razor Pages with a small amount of client-side behavior, I avoid Blazor for larger apps because I find Blazor too difficult to create a lot of pages and too difficult to maintain.
From my perspective, it would be necessary for Razor Components to support tag helpers before I would consider Razor Pages and Razor Components to be integrated.
This is because I use tag helpers all the time to apply cross-cutting changes to my apps and to generate UI elements based on model attributes.

For example, here's the form from StarRatingReviews.razor (in the demo video around 3:48)...

<EditForm method="post" class="review-editor" EditContext="EditContext" enhance>
	<StarRating @bind-Value="EditContext.Model.Rating"/>
	<ValidationMessage For="@(() => EditContext.Model.Rating)"
	<InputTextArea rows="5" name="text" placeholder="Write a review" @bind-Value="EditContext.Model.Text"/>
	<ValidationMessage For="@(() => EditContext.Model.Text)"
	<button type="submit">Submit<button/>
<EditForm>

For the sake of argument let's say that I accept that I should rewrite everything in Razor Components, consider what happens down the road when I want to make a change to that .
Let's suppose that I want to change all the submit buttons on all my forms in all my applications to be disabled until the form validates.
Using Blazor will force me to make these changes to all my templates myself.
However, I could theoretically do that with a tag helper that could render into a Razor Component, the tag helper could add the new behavior into the page, maybe something like this...

<MyButtonHelper Context='bhelper'>
<button type="submit" disabled="@bhelper.IsContainingFormValid"/>
</MyButtonHelper>

Adopting Blazor and Razor Components would force me to make these kinds of changes to templates myself, and I'd also have to give up my custom model attributes.

I really really really want to go all in on Blazor, but I'm concerned that doing so will make my life more difficult, so the lack of tag helper support will be a barrier to adoption for me.

@juepiezhongren
Copy link

juepiezhongren commented Jan 30, 2023

hope that hybrid mode will be included in 9 or 10.

@Ponant
Copy link
Contributor

Ponant commented Jan 30, 2023

Agreed this is a very nice way and intuitive way to go.

@mkArtakMSFT mkArtakMSFT added this to the Discussions milestone Jan 30, 2023
@mkArtakMSFT mkArtakMSFT removed the design-proposal This issue represents a design proposal for a different issue, linked in the description label Jan 30, 2023
@snow-jallen
Copy link

Yes, yes, please! Htmx is probably the next best thing but I like this WAY more. Very much looking forward to future development along these lines.

@PeterDraex
Copy link

WebComponentRenderMode.Auto mode could significantly speed up first page load (time to interactive) of existing WebAssembly apps, as it would not be necessary to wait for all assemblies to download before interaction. That would be a relevant and significant improvement.

However, if this disables prerendering and so makes the site not indexable, it can't be used on any site that requires SEO. Therefore, if you can make it happen without breaking SEO, please, deliver it asap 💚! If not, rather focus on other improvements.

@juepiezhongren
Copy link

Loved the demo and got goose bumps when say how easy it was to switch the rendring modes without losing the component based design of blazor. But would it ve possible to dynamically switch from server to wasm mode as soon as wasm binaries all download in Auto mode?

I think auto mode is only for page re entering. What we need is another mode, autoWithSwitch. Considering the cost for switch, wasm side data sync with server side needs a period, switch status and view options r required. I suggest auto and autoWithSwitch are 2 different modes.

@mammadkoma
Copy link

mammadkoma commented Feb 10, 2023

How to add RenderMode.Auto to our .net7 wasm projects? Is there an article or video?

@d3c0d3d
Copy link

d3c0d3d commented Feb 11, 2023

@mammadkoma Wait for the next .NET Preview version, maybe there's something there.

@mammadkoma
Copy link

mammadkoma commented Feb 12, 2023

If we use MudBlazor components and then use RenderMode.Auto, it loads first the page server side then after download the MudBlazor components and other wasm dll load and work on client side browser? We only want to increase the startup speed.

@d3c0d3d
Copy link

d3c0d3d commented Feb 13, 2023

@mammadkoma Only the future will tell, wait for the next updates.
Tip: Tomorrow, February 14th there will be a live on the dotnet channel on youtube with more information about the project who knows there you can ask more questions directly to the Blazor United developers.

@danroth27
Copy link
Member

Thanks everyone for the feedback! To help track all of the Blazor United related work from one place we've opened #46636 with links to all the related issues that we're tracking for .NET 8. Please use this new issue and related sub issues for all Blazor United related discussions. We'll be adding more details and clarity to the sub issues in the days to come. To help consolidate the Blazor United discussions I'm going to go ahead and close this issue.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests