-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
We need a Blazor WebAssembly new-project template with ASP.NET hosting that allows new adopters to actually be able to adopt Blazor WebAssembly (sic) - like we used to have before .NET 8 #59887
Comments
I'm interested in this as well! As a beginner in Blazor WebAssembly it is a challenge to understand this flow (Still till today). Additionally, I also pick up signals that developers around me seem to think that they can create a WebAssembly project + Class library, which calls the database and be done. But it isn't so simple in SPA's, is it? How about securing data? (Same for moving from Blazor Server to WebAssembly). That, including what is said above would be a great template. For security, this source pointed me in the right direction and to understand that it isn't so simple: |
"Have the client-side Blazor WebAssembly app call the server-side...." How? The new-project template shows no examples of the client-side BWA app calling anything. Instead you get this:- // 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" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray(); which is totally useless. FWIW, my client-side BWA apps always call controller actions in the |
This is very much needed. In the current template model, it is totally ignored that there is a good side thing on blazor which is its blazor webview. Previously I could just extend the default template and use blazor on wasm(PWA), server (API) and devices(BlazorWebview). Current templates totally ignore this beautiful combination where u can develop wasm and server separately without thinking of how and where it is rendering and if data is getting fetched twice. Really not sure what happened to the web api with wasm and server. Think template developers didn't understand it too and put random data in WeatherForecast within WASM and didn't know how to get this from server altogether. Out of all the template, there is no way to send a user event on wasm and do some db work and return the response. So not sure how to work with a form submission now with current so called "INTERACTIVITY". Interactivity is nice to have for professional developer but under no circumstances, it should be a priority over a necessity like simple web api calls. |
We've brought back #55307 from the backlog and we plan to use that for tracking purposes. We won't be resurrecting the old hosted webassembly template as it was, but we want to find a way to bring back the sample HttpClient call in a way that makes sense. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
It's very difficult for new adopters to get a classic
Client
,Server
,Shared
, ASP.NET-hosted Blazor WebAssembly (BWA) solution because the current new-project template won't generate one. It doesn't clearly identify theServer
project, it omits aShared
project, and it doesn't show how theClient
project would get data from theServer
(it fakes it!). It also asks questions of a new user that they couldn't possibly answer ("Interactivity Location").Beginners aren't even going to know that a
Shared
project (class library) is common and natural, nor that shared data model classes are a thing.This not only harms new adoption rates, it also makes it harder for seasoned pros who started before November 2023 to stand up a new BWA website without a lot of referring back to previous solutions, and a lot of manual editing.
If I was looking at Blazor WebAssembly as something I might adopt right now, in January 2025, the fact that the
Client
project fakes the loading of the data from the server - giving me no idea of how to do it for real - would mean a hard pass. Back to Angular or React or whatever. What an EPIC FAIL.For further confirmation of how bad this is see here:-
Quote from the last link above: "The new templates are horrible for beginners."
The huge, current worry is that the closest outstanding issue that touches on this - started by @SteveSandersonMS himself - is backlogged!
Without this being done soon, and certainly by the .NET 10 milestone, I fear for the future of Blazor WebAssembly as something thriving and growing and living. As things currently stand, Blazor is a "closed club" - understandable and navigable only by those of us who achieved escape velocity because we were lucky enough to adopt before November 2023.
Describe the solution you'd like
There should be a new-project template that:-
Client
,Server
andShared
projects, like we had before .NET 8Server
project needs to be named as such, as beforeClient
project how to get data from a controller action in theServer
project via a shared data model class in theShared
projectMore generally: stop making Blazor the "closed club" that it currently is.
Additional context
No response
The text was updated successfully, but these errors were encountered: