Skip to content

Empty Blazor WebAssembly Project Template #42215

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 42 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bf569bb
Duplicated required files
cerasamson Jun 14, 2022
9627fd8
Removed authentication, pages, formatting
cerasamson Jun 14, 2022
0aca1b6
Fix namespaces
cerasamson Jun 14, 2022
766e946
Remove readme / auth template options
cerasamson Jun 15, 2022
4a6e9b0
Update Index.razor
cerasamson Jun 15, 2022
10c9c40
Remove auth options from templatestrings
cerasamson Jun 15, 2022
5cb350f
Update launchSettings.json
cerasamson Jun 15, 2022
7884d75
Merge branch 'dotnet:main' into t-samsoncera/empty-wasm
cerasamson Jun 16, 2022
b51e9c7
Remove auth (cont.), rename files
cerasamson Jun 16, 2022
f8a30dd
Added .csproj.in files
cerasamson Jun 16, 2022
020fc43
Update templatestrings.json
cerasamson Jun 16, 2022
b93749e
Update templatestrings.cs.json
cerasamson Jun 16, 2022
5575cfb
Update Program.cs
cerasamson Jun 16, 2022
52e3807
Modify to reflect changes in http/https launch profiles
cerasamson Jun 17, 2022
84c26e8
Merge branch 'main' into t-samsoncera/empty-wasm
cerasamson Jun 17, 2022
e48887e
Add template test; remove RequiresHttps logic
cerasamson Jun 17, 2022
1cc0911
Added blazorwasm-empty template baseline tests
cerasamson Jun 17, 2022
0a3ec04
Merge branch 'main' into t-samsoncera/empty-wasm
cerasamson Jun 20, 2022
8ae18a8
Changes from code review; fix failing test
cerasamson Jun 20, 2022
9702889
Add empty file to Shared folder
cerasamson Jun 20, 2022
450c3ae
Merge branch 'main' into t-samsoncera/empty-wasm
cerasamson Jun 20, 2022
d20c638
Merge branch 'dotnet:main' into t-samsoncera/empty-wasm
cerasamson Jun 20, 2022
de700d1
Update src/ProjectTemplates/test/Templates.Blazor.Tests/EmptyBlazorWa…
cerasamson Jun 20, 2022
22f4998
Fix issues with launchBrowser and missing PWA install app
cerasamson Jun 21, 2022
25132ba
Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyCompone…
cerasamson Jun 21, 2022
5ce1f32
Update EmptyComponentsWebAssembly-CSharp.sln
cerasamson Jun 21, 2022
9ee7e71
Merge branch 't-samsoncera/empty-wasm' of https://github.com/cerasams…
cerasamson Jun 21, 2022
ef4078f
Merge branch 'dotnet:main' into t-samsoncera/empty-wasm
cerasamson Jun 21, 2022
28e94cf
Fix missing Server project
cerasamson Jun 21, 2022
e31a381
Update .json files
cerasamson Jun 21, 2022
95119a3
Update template-baselines.json
cerasamson Jun 21, 2022
c9a1168
Move icon.png into ide/
cerasamson Jun 21, 2022
fed1120
Update ide.host.json
cerasamson Jun 21, 2022
acc7d53
Fix template-baselines, template.json
cerasamson Jun 21, 2022
fa76595
Fix templates-baselines, remove icon-192.png
cerasamson Jun 21, 2022
a35c985
Revert "Fix templates-baselines, remove icon-192.png"
cerasamson Jun 21, 2022
46ac431
Delete icon-192.png
cerasamson Jun 21, 2022
6e0262a
Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyCompone…
cerasamson Jun 21, 2022
8423016
Add ExcludeLaunchSettings to template.json
cerasamson Jun 21, 2022
3ff7385
Merge branch 't-samsoncera/empty-wasm' of https://github.com/cerasams…
cerasamson Jun 21, 2022
6de517a
Move tags into ide.host.json
cerasamson Jun 21, 2022
4a1a6d9
Fix closing brace appsettings.json
cerasamson Jun 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order": 610,
"icon": "icon.png",
"supportedAuthentications": [
{
"auth": "None",
"authenticationType": "NoAuth",
"allowUnsecured": true
}
],
"ports": [
{
"name": "HttpPort",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net7.0/description": "Target net7.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
"symbols/Hosted/displayName": "ASP.NET Core Hosted",
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
"symbols/auth/choices/None/description": "No authentication",
"symbols/auth/description": "The type of authentication to use",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@
"displayName": "ASP.NET Core _Hosted",
"description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app."
},
"auth": {
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "None",
"description": "No authentication"
}
],
"defaultValue": "None",
"description": "The type of authentication to use"
},
"ExcludeLaunchSettings": {
"type": "parameter",
"datatype": "bool",
Expand Down Expand Up @@ -191,7 +179,7 @@
"iisHttpsPort": {
"type": "parameter",
"datatype": "integer",
"description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used)."
"description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used."
},
"iisHttpsPortGenerated": {
"type": "generated",
Expand All @@ -217,13 +205,9 @@
"displayName": "_Progressive Web Application",
"description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use."
},
"NoAuth": {
"type": "computed",
"value": "(!(IndividualAuth || OrganizationalAuth))"
},
"RequiresHttps": {
"type": "computed",
"value": "(OrganizationalAuth || IndividualAuth || !NoHttps)"
"value": "(!NoHttps)"
},
"NoHttps": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@inherits LayoutComponentBase

<div class="page">
<main>
@Body
</main>
</div>
<main> @Body </main>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@page "/"

<h1>Hello, world!</h1>

This is an empty Blazor WebAssembly template.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

#if (!Hosted || NoAuth)
#if (!Hosted)
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
#else
builder.Services.AddHttpClient("ComponentsWebAssembly_CSharp.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
builder.Services.AddHttpClient("EmptyComponentsWebAssembly_CSharp.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();

// Supply HttpClient instances that include access tokens when making requests to the server project
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("ComponentsWebAssembly_CSharp.ServerAPI"));
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("EmptyComponentsWebAssembly_CSharp.ServerAPI"));
#endif

await builder.Build().RunAsync();
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ async function onInstall(event) {
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
.filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
.map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
//#if(IndividualLocalAuth && Hosted)
//#if(Hosted)

// Also cache authentication configuration
assetsRequests.push(new Request('_configuration/ComponentsWebAssembly-CSharp.Client'));
assetsRequests.push(new Request('_configuration/EmptyComponentsWebAssembly-CSharp.Client'));

//#endif
await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
Expand All @@ -43,10 +43,9 @@ async function onFetch(event) {
if (event.request.method === 'GET') {
// For all navigation requests, try to serve index.html from cache
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
//#if(IndividualLocalAuth && Hosted)
//#if(Hosted)
const shouldServeIndexHtml = event.request.mode === 'navigate'
&& !event.request.url.includes('/connect/')
&& !event.request.url.includes('/Identity/');
//#else
const shouldServeIndexHtml = event.request.mode === 'navigate';
//#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
#if (IndividualLocalAuth)
app.UseMigrationsEndPoint();
#endif
app.UseWebAssemblyDebugging();
}
else
Expand All @@ -25,7 +22,6 @@

#if (RequiresHttps)
app.UseHttpsRedirection();

#endif
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
Expand Down
Binary file not shown.