Skip to content

Commit 85c781a

Browse files
authored
Merge pull request #41 from canhorn/feature/blazor_server_support
Blazor Server Support
2 parents 1e08568 + cfe43f2 commit 85c781a

File tree

661 files changed

+104539
-755
lines changed

Some content is hidden

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

661 files changed

+104539
-755
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: codecov/codecov-action@v1
3232
with:
3333
token: ${{ secrets.CODECOV_TOKEN }}
34-
file: ./Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/coverage.opencover.xml
34+
files: ./Tests/EventHorizon.Blazor.TypeScript.Interop.Generator.Tests/coverage.opencover.xml,./Tests/EventHorizon.Blazor.Interop.Generator.Tests/coverage.opencover.xml
3535
- name: .NET Publish
3636
run: dotnet publish --configuration Release -o published ./Sample/EventHorizon.Blazor.BabylonJS
3737
- name: Publish Static Site

EventHorizon.Blazor.TypeScript.Interop.Generator.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Microsoft Visual Studio Solution File, Format Version 12.00
23
# Visual Studio Version 16
34
VisualStudioVersion = 16.0.30204.135
@@ -31,6 +32,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tool", "Tool", "{C261DE2D-6
3132
EndProject
3233
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHorizon.Blazor.TypeScript.Interop.Tool", "Tool\EventHorizon.Blazor.TypeScript.Interop.Tool\EventHorizon.Blazor.TypeScript.Interop.Tool.csproj", "{5893EDD4-24E7-4260-9A43-EFF21EE23F97}"
3334
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{88BB5182-7755-4777-A45F-7BC667CAF330}"
36+
EndProject
37+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{0FD80298-8614-4419-8D86-250A9AE740AD}"
38+
EndProject
39+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHorizon.Blazor.Interop.Generator", "Source\Server\EventHorizon.Blazor.Interop.Generator\EventHorizon.Blazor.Interop.Generator.csproj", "{1284B89B-86BB-4566-A74B-E915771974A8}"
40+
EndProject
41+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHorizon.Blazor.Interop.Generator.Writers.Project", "Source\Server\EventHorizon.Blazor.Interop.Generator.Writers.Project\EventHorizon.Blazor.Interop.Generator.Writers.Project.csproj", "{03025F91-89CE-4DE0-A03A-BC96E4073418}"
42+
EndProject
43+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventHorizon.Blazor.Interop.Generator.Tests", "Tests\EventHorizon.Blazor.Interop.Generator.Tests\EventHorizon.Blazor.Interop.Generator.Tests.csproj", "{AB730C78-E056-470D-8CBF-B2C7E94F11C2}"
44+
EndProject
3445
Global
3546
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3647
Debug|Any CPU = Debug|Any CPU
@@ -61,6 +72,18 @@ Global
6172
{5893EDD4-24E7-4260-9A43-EFF21EE23F97}.Debug|Any CPU.Build.0 = Debug|Any CPU
6273
{5893EDD4-24E7-4260-9A43-EFF21EE23F97}.Release|Any CPU.ActiveCfg = Release|Any CPU
6374
{5893EDD4-24E7-4260-9A43-EFF21EE23F97}.Release|Any CPU.Build.0 = Release|Any CPU
75+
{1284B89B-86BB-4566-A74B-E915771974A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76+
{1284B89B-86BB-4566-A74B-E915771974A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
77+
{1284B89B-86BB-4566-A74B-E915771974A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{1284B89B-86BB-4566-A74B-E915771974A8}.Release|Any CPU.Build.0 = Release|Any CPU
79+
{03025F91-89CE-4DE0-A03A-BC96E4073418}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
80+
{03025F91-89CE-4DE0-A03A-BC96E4073418}.Debug|Any CPU.Build.0 = Debug|Any CPU
81+
{03025F91-89CE-4DE0-A03A-BC96E4073418}.Release|Any CPU.ActiveCfg = Release|Any CPU
82+
{03025F91-89CE-4DE0-A03A-BC96E4073418}.Release|Any CPU.Build.0 = Release|Any CPU
83+
{AB730C78-E056-470D-8CBF-B2C7E94F11C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84+
{AB730C78-E056-470D-8CBF-B2C7E94F11C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
85+
{AB730C78-E056-470D-8CBF-B2C7E94F11C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
86+
{AB730C78-E056-470D-8CBF-B2C7E94F11C2}.Release|Any CPU.Build.0 = Release|Any CPU
6487
EndGlobalSection
6588
GlobalSection(SolutionProperties) = preSolution
6689
HideSolutionNode = FALSE
@@ -69,6 +92,10 @@ Global
6992
{CAEED771-5D2A-48F8-9DF5-8E60FA569FA0} = {932AD335-24DD-419D-9F45-93720F37D7DE}
7093
{2D1BE986-B7C9-457F-8F09-E7D71EEA0D8F} = {66BA240A-9512-4874-A05A-FE86C72DAA5B}
7194
{5893EDD4-24E7-4260-9A43-EFF21EE23F97} = {C261DE2D-65FB-4616-B02A-5A7461C6D767}
95+
{0FD80298-8614-4419-8D86-250A9AE740AD} = {88BB5182-7755-4777-A45F-7BC667CAF330}
96+
{1284B89B-86BB-4566-A74B-E915771974A8} = {0FD80298-8614-4419-8D86-250A9AE740AD}
97+
{03025F91-89CE-4DE0-A03A-BC96E4073418} = {66BA240A-9512-4874-A05A-FE86C72DAA5B}
98+
{AB730C78-E056-470D-8CBF-B2C7E94F11C2} = {932AD335-24DD-419D-9F45-93720F37D7DE}
7299
EndGlobalSection
73100
GlobalSection(ExtensibilityGlobals) = postSolution
74101
SolutionGuid = {DB1241E0-8802-4F96-9FD7-B938FE890192}

Sample/EventHorizon.BabylonJS.Interop.Generator.ConsoleApp/EventHorizon.BabylonJS.Interop.Generator.ConsoleApp.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<ItemGroup>
1717
<ProjectReference Include="..\..\Source\EventHorizon.Blazor.TypeScript.Interop.Generator.Writers.Project\EventHorizon.Blazor.TypeScript.Interop.Generator.Writers.Project.csproj" />
1818
<ProjectReference Include="..\..\Source\EventHorizon.Blazor.TypeScript.Interop.Generator\EventHorizon.Blazor.TypeScript.Interop.Generator.csproj" />
19+
20+
<ProjectReference Include="..\..\Source\Server\EventHorizon.Blazor.Interop.Generator.Writers.Project\EventHorizon.Blazor.Interop.Generator.Writers.Project.csproj" />
21+
<ProjectReference Include="..\..\Source\Server\EventHorizon.Blazor.Interop.Generator\EventHorizon.Blazor.Interop.Generator.csproj" />
1922
</ItemGroup>
2023

2124
<ItemGroup>

Sample/EventHorizon.BabylonJS.Interop.Generator.ConsoleApp/Program.cs

Lines changed: 64 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,36 @@ namespace EventHorizon.Blazor.TypeScript.Interop.Generator.ConsoleApp
55
using System.IO;
66
using EventHorizon.Blazor.TypeScript.Interop.Generator.Formatter;
77
using EventHorizon.Blazor.TypeScript.Interop.Generator.Logging;
8-
using EventHorizon.Blazor.TypeScript.Interop.Generator.Writers.Project;
8+
9+
using ServerGenerator = Blazor.Interop.Generator.GenerateInteropSource;
10+
using ServerProjectWriter = Blazor.Interop.Generator.Writers.Project.ServerProjectWriter;
11+
using WasmGenerator = GenerateSource;
12+
using WasmProjectWriter = Writers.Project.ProjectWriter;
913

1014
public class Program
1115
{
1216
static void Main(string[] args)
1317
{
14-
//Run(AstParser.Model.ASTParserType.NodeJS); // 75084ms/71877ms to generate.
15-
Run(AstParser.Model.ASTParserType.Sdcb); // 22027ms/19835ms/18236ms to generate.
18+
//Run(AstParser.Model.ASTParserType.NodeJS, true); // 75084ms/71877ms to generate.
19+
Run(
20+
AstParser.Model.ASTParserType.Sdcb,
21+
true,
22+
"EventHorizon.Blazor.BabylonJS.WASM"
23+
); // 22027ms/19835ms/18236ms to generate.
24+
//Run(
25+
// AstParser.Model.ASTParserType.Sdcb,
26+
// false,
27+
// "EventHorizon.Blazor.BabylonJS.Server"
28+
//);
1629
}
17-
static void Run(AstParser.Model.ASTParserType type)
30+
static void Run(
31+
AstParser.Model.ASTParserType type,
32+
bool useWasm,
33+
string projectAssembly
34+
)
1835
{
1936
var stopwatch = Stopwatch.StartNew();
20-
var projectAssembly = "EventHorizon.Blazor.BabylonJS.WASM";
37+
//var projectAssembly = "EventHorizon.Blazor.BabylonJS.WASM";
2138
var projectGenerationLocation = Path.Combine(
2239
"..",
2340
"_generated"
@@ -28,10 +45,6 @@ static void Run(AstParser.Model.ASTParserType type)
2845
"SourceFiles"
2946
);
3047
var textFormatter = new NoFormattingTextFormatter();
31-
var writer = new ProjectWriter(
32-
projectGenerationLocation,
33-
projectAssembly
34-
);
3548
var sourceFiles = new List<string>
3649
{
3750
//"testing.d.ts",
@@ -86,19 +99,48 @@ static void Run(AstParser.Model.ASTParserType type)
8699
}
87100
GlobalLogger.Info("Removed Generation Directory");
88101

89-
new GenerateSource().Run(
90-
projectAssembly,
91-
sourceDirectory,
92-
sourceFiles,
93-
generationList,
94-
writer,
95-
textFormatter,
96-
new Dictionary<string, string>
97-
{
98-
{ "BABYLON.PointerInfoBase | type", "int" }
99-
},
100-
type
101-
);
102+
if (useWasm)
103+
{
104+
GlobalLogger.Info("Running Wasm Generator");
105+
var writer = new WasmProjectWriter(
106+
projectGenerationLocation,
107+
projectAssembly
108+
);
109+
new WasmGenerator().Run(
110+
projectAssembly,
111+
sourceDirectory,
112+
sourceFiles,
113+
generationList,
114+
writer,
115+
textFormatter,
116+
new Dictionary<string, string>
117+
{
118+
{ "BABYLON.PointerInfoBase | type", "int" }
119+
},
120+
type
121+
);
122+
}
123+
else
124+
{
125+
GlobalLogger.Info("Running Server Generator");
126+
var writer = new ServerProjectWriter(
127+
projectGenerationLocation,
128+
projectAssembly
129+
);
130+
new ServerGenerator().Run(
131+
projectAssembly,
132+
sourceDirectory,
133+
sourceFiles,
134+
generationList,
135+
writer,
136+
textFormatter,
137+
new Dictionary<string, string>
138+
{
139+
{ "BABYLON.PointerInfoBase | type", "int" }
140+
},
141+
type
142+
);
143+
}
102144
stopwatch.Stop();
103145
GlobalLogger.Info("Removed Generation Directory");
104146
GlobalLogger.Info($"Took {stopwatch.ElapsedMilliseconds}ms to generate.");

Sample/EventHorizon.Blazor.BabylonJS/Model/CachedEntityExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ this CachedEntity entity
1313
}
1414
}
1515

16-
namespace BabylonJS
16+
namespace BABYLON
1717
{
1818
public static class BabylonjsNodeExtensions
1919
{

Sample/EventHorizon.Blazor.BabylonJS/Model/Canvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Text.Json.Serialization;
2-
using BabylonJS;
2+
using BABYLON;
33
using EventHorizon.Blazor.Interop;
44

55
namespace EventHorizon.Blazor.BabylonJS.Model

Sample/EventHorizon.Blazor.BabylonJS/Model/SceneLoaderImportMeshEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Text.Json.Serialization;
2-
using BabylonJS;
2+
using BABYLON;
33
using EventHorizon.Blazor.Interop;
44

55
namespace EventHorizon.Blazor.BabylonJS.Model

Sample/EventHorizon.Blazor.BabylonJS/Pages/AnimationExample.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using BabylonJS;
6-
using BabylonJS.GUI;
5+
using BABYLON;
6+
using BABYLON.GUI;
77
using EventHorizon.Blazor.BabylonJS.Model;
88
using EventHorizon.Blazor.Interop.Callbacks;
99

Sample/EventHorizon.Blazor.BabylonJS/Pages/ButtonExample.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using BabylonJS;
6-
using BabylonJS.GUI;
5+
using BABYLON;
6+
using BABYLON.GUI;
77
using EventHorizon.Blazor.BabylonJS.Model;
88
using EventHorizon.Blazor.Interop.Callbacks;
99

Sample/EventHorizon.Blazor.BabylonJS/Pages/Index.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using BabylonJS;
5+
using BABYLON;
66
using EventHorizon.Blazor.BabylonJS.Model;
77
using EventHorizon.Blazor.Interop.Callbacks;
88

0 commit comments

Comments
 (0)