Skip to content

Commit f430c9c

Browse files
authored
.NET Web Worker template update to Blazor Web Worker template (#66070)
* Remove licence headers + condense xml doc to RazorClassLib's ExampleJsInterop-like form. * Add timeout to avoid init/invoke hangs. * Avoid changing return type when string looks like a valid JSON but is in fact a primitive value. * Blazor interop has invoke void method equivalent, template should cover it. * Feedback: symmetric treating input and output. * Rename to blazor web worker project + support JSExports defined in Web Worker project. * Both assemblies can export methods at the same time
1 parent a4740d4 commit f430c9c

42 files changed

Lines changed: 265 additions & 316 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/ProjectTemplates/Web.ProjectTemplates/WebWorker-CSharp.csproj.in renamed to src/ProjectTemplates/Web.ProjectTemplates/BlazorWebWorker-CSharp.csproj.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
78
</PropertyGroup>
89

910
<ItemGroup>

src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<GeneratedContent Include="BlazorWebCSharp.csproj.in" OutputPath="content/BlazorWeb-CSharp/BlazorWebCSharp.1/BlazorWebCSharp.1.csproj" />
6565
<GeneratedContent Include="BlazorWebCSharp.Client.csproj.in" OutputPath="content/BlazorWeb-CSharp/BlazorWebCSharp.1.Client/BlazorWebCSharp.1.Client.csproj" />
6666
<GeneratedContent Include="ComponentsWebAssembly-CSharp.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/ComponentsWebAssembly-CSharp.csproj" />
67-
<GeneratedContent Include="WebWorker-CSharp.csproj.in" OutputPath="content/WebWorker-CSharp/Company.WebWorker1.csproj" />
67+
<GeneratedContent Include="BlazorWebWorker-CSharp.csproj.in" OutputPath="content/BlazorWebWorker-CSharp/Company.WebWorker1.csproj" />
6868
</ItemGroup>
6969

7070
</Project>

src/ProjectTemplates/Web.ProjectTemplates/content/WebWorker-CSharp/.template.config/dotnetcli.host.json renamed to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWebWorker-CSharp/.template.config/dotnetcli.host.json

File renamed without changes.

src/ProjectTemplates/Web.ProjectTemplates/content/WebWorker-CSharp/.template.config/ide.host.json renamed to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWebWorker-CSharp/.template.config/ide.host.json

File renamed without changes.

src/ProjectTemplates/Web.ProjectTemplates/content/WebWorker-CSharp/.template.config/ide/icon.ico renamed to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWebWorker-CSharp/.template.config/ide/icon.ico

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Web Worker",
4+
"description": "A project for creating a class library that runs .NET code on a web worker from a Blazor WebAssembly or Blazor Web app.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net11.0/description": "Target net11.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"postActions/restore/description": "Restore NuGet packages required by this project.",
9+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Web Worker",
4+
"description": "A project for creating a class library that runs .NET code on a web worker from a Blazor WebAssembly or Blazor Web app.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net11.0/description": "Target net11.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"postActions/restore/description": "Restore NuGet packages required by this project.",
9+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
10+
}

src/ProjectTemplates/Web.ProjectTemplates/content/WebWorker-CSharp/.template.config/localize/templatestrings.en.json renamed to src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWebWorker-CSharp/.template.config/localize/templatestrings.en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Microsoft",
3-
"name": ".NET Web Worker",
4-
"description": "A project for creating a class library that runs .NET code in a Web Worker.",
3+
"name": "Blazor Web Worker",
4+
"description": "A project for creating a class library that runs .NET code on a web worker from a Blazor WebAssembly or Blazor Web app.",
55
"symbols/Framework/description": "The target framework for the project.",
66
"symbols/Framework/choices/net11.0/description": "Target net11.0",
77
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Web Worker",
4+
"description": "A project for creating a class library that runs .NET code on a web worker from a Blazor WebAssembly or Blazor Web app.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net11.0/description": "Target net11.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"postActions/restore/description": "Restore NuGet packages required by this project.",
9+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor Web Worker",
4+
"description": "A project for creating a class library that runs .NET code on a web worker from a Blazor WebAssembly or Blazor Web app.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net11.0/description": "Target net11.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"postActions/restore/description": "Restore NuGet packages required by this project.",
9+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
10+
}

0 commit comments

Comments
 (0)