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

Shouldn't the .NET 8 Blazor Web App template show client-server communication for WebAssembly SPAs? #52285

Closed
1 task done
Bellarmine-Head opened this issue Nov 22, 2023 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-templates ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@Bellarmine-Head
Copy link

Bellarmine-Head commented Nov 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Prior to converting my .NET 7 ASP.NET-hosted Blazor WebAssembly apps (three of them) to .NET 8, I created some new apps using the new Blazor Web App template.

In no variation of creating an app did I end up with the client project actually communicating with the server project over HTTP (if there can be said to be a server project... the Server designation seems to have gone away).

Instead, the Weather page in the client fakes it:-

        // Simulate asynchronous loading to demonstrate a loading indicator
        await Task.Delay(500);

        var startDate = DateOnly.FromDateTime(DateTime.Now);
        var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };

Did I miss something? What is the magic combination of choices that shows me genuine client-server communication?

Now, I can probably work out what to do... rename the first project to say "Server", add a "Shared" project, add controllers to the Server, set up the calls from the Client etc.

But really: shouldn't the template have these features?

If I'm right and the template simply doesn't include this stuff, then all I can say is that I'm glad I started with Blazor WebAssembly for creating SPAs in May 2020 and aren't starting now. It seems to me that if you're starting now, using the new template won't help you any.

You're a new adopter.. you create a new Blazor WebAssembly solution with the new template... you get what is probably a Server project and you definitely get a Client project... and the two don't even communicate with each other! It's bizarre and totally unhelpful.

Describe the solution you'd like

The new .NET 8 Blazor Web App project template shows a clear "Blazor WebAssembly SPA with Client and Server" option, and includes code that demonstrates the client getting data from the server thru a shared model... instead of not doing so and "faking" a load of some data after a delay, purely in the client.

Additional context

The changes need to be communicated better for users migrating solutions from .NET 5, 6, 7 - and more especially the new project template needs to show genuine client-server communication for people new to Blazor.

E.g when I migrate, should I keep the Shared project? Or should I add shared DTOs to the Client project? Is the Shared project deprecated now? Or what? The new project template is causing confusion, and not providing clear answers.

I was hoping (even expecting!) the template to take a major step forwards, and include a gRPC-instead-over-Http-communication-between-client-and-server option... instead it's taken a regrettable major step backwards by not showing any communication.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Nov 22, 2023
@javiercn javiercn added this to the .NET 9 Planning milestone Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Member

Looks like this is a dupe of #52474

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2024
@mkArtakMSFT mkArtakMSFT added ✔️ Resolution: Duplicate Resolved as a duplicate of another issue feature-templates labels Jan 3, 2024
@ghost ghost added the Status: Resolved label Jan 3, 2024
@ghost ghost locked as resolved and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-templates ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants