Skip to content

Commit cc86acf

Browse files
committed
- Updated to latest .Net Core 3.0 RC 1
1 parent d1d536e commit cc86acf

File tree

55 files changed

+354
-33
lines changed

Some content is hidden

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

55 files changed

+354
-33
lines changed

CompileBlazorInBlazor/App.razor

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@
22
Configuring this here is temporary. Later we'll move the app config
33
into Program.cs, and it won't be necessary to specify AppAssembly.
44
-->
5-
<Router AppAssembly=typeof(Program).Assembly />
5+
<Router AppAssembly="typeof(Program).Assembly">
6+
<Found Context="routeData">
7+
<RouteView RouteData="routeData" DefaultLayout="typeof(Shared.MainLayout)" />
8+
</Found>
9+
<NotFound>
10+
<h1>Page not found</h1>
11+
<p>Sorry, but there's nothing here!</p>
12+
</NotFound>
13+
</Router>

CompileBlazorInBlazor/CompileBlazorInBlazor.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
77
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
88
</RestoreAdditionalProjectSources>
9-
<LangVersion>7.3</LangVersion>
9+
<LangVersion>8.0</LangVersion>
1010
<RazorLangVersion>3.0</RazorLangVersion>
1111
</PropertyGroup>
1212

1313

1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview5-19227-01" />
17-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview5-19227-01" PrivateAssets="all" />
18-
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview5-19227-01" PrivateAssets="all" />
19-
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-preview5.19227.1" />
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.0-beta1-final" />
16+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19457.4" />
17+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
18+
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview9.19457.4" PrivateAssets="all" />
19+
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-rc1.19457.3" />
20+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.3.1-beta3-final" />
2121

2222

2323
</ItemGroup>

CompileBlazorInBlazor/CompileService.cs

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ namespace CompileBlazorInBlazor
2020
public class CompileService
2121
{
2222
private readonly HttpClient _http;
23-
private readonly IUriHelper _uriHelper;
23+
private readonly NavigationManager _uriHelper;
2424
public List<string> CompileLog { get; set; }
2525
private List<MetadataReference> references { get; set; }
2626

2727

28-
public CompileService(HttpClient http, IUriHelper uriHelper)
28+
public CompileService(HttpClient http, NavigationManager uriHelper)
2929
{
3030
_http = http;
3131
_uriHelper = uriHelper;
@@ -46,7 +46,7 @@ public async Task Init()
4646
Console.WriteLine(name);
4747
references.Add(
4848
MetadataReference.CreateFromStream(
49-
await this._http.GetStreamAsync(_uriHelper.GetBaseUri()+ "/_framework/_bin/" + name)));
49+
await this._http.GetStreamAsync(_uriHelper.BaseUri+ "/_framework/_bin/" + name)));
5050
}
5151
}
5252
}
@@ -59,10 +59,37 @@ public async Task<Type> CompileBlazor(string code)
5959
var fileSystem = new EmptyRazorProjectFileSystem();
6060

6161
CompileLog.Add("Create engine");
62-
// Microsoft.AspNetCore.Blazor.Build.
63-
var engine = RazorProjectEngine.Create(RazorConfiguration.Create(RazorLanguageVersion.Version_3_0, "Blazor", new RazorExtension[0]), fileSystem, b =>
62+
// Microsoft.AspNetCore.Blazor.Build.
63+
64+
var engine = RazorProjectEngine.Create(RazorConfiguration.Create(RazorLanguageVersion.Version_3_0, "Blazor", new RazorExtension[0]), fileSystem, b =>
6465
{
65-
//BlazorExtensionInitializer.Register(b);
66+
// RazorExtensions.Register(b);
67+
68+
69+
// b.SetRootNamespace(DefaultRootNamespace);
70+
71+
// Turn off checksums, we're testing code generation.
72+
// b.Features.Add(new SuppressChecksum());
73+
74+
// if (LineEnding != null)
75+
// {
76+
// b.Phases.Insert(0, new ForceLineEndingPhase(LineEnding));
77+
// }
78+
79+
// Including MVC here so that we can find any issues that arise from mixed MVC + Components.
80+
// Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorExtensions.Register(b);
81+
//
82+
// // Features that use Roslyn are mandatory for components
83+
// Microsoft.CodeAnalysis.Razor.CompilerFeatures.Register(b);
84+
//
85+
// b.Features.Add(new CompilationTagHelperFeature());
86+
// b.Features.Add(new DefaultMetadataReferenceFeature()
87+
// {
88+
// References = references,
89+
// });
90+
91+
92+
6693
});
6794

6895

CompileBlazorInBlazor/Pages/Blazor.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<div>
88
<div class="form-group">
99
<label for="exampleFormControlTextarea1">Blazor Code</label>
10-
<textarea class="form-control" id="exampleFormControlTextarea1" rows="10" bind="@Code"></textarea>
10+
<textarea class="form-control" id="exampleFormControlTextarea1" rows="10" @bind="Code"></textarea>
1111
</div>
12-
<button type="button" class="btn btn-primary" onclick="@Run">Run</button>
12+
<button type="button" class="btn btn-primary" @onclick="Run">Run</button>
1313
<div class="card">
1414
<div class="card-body">
1515
@Result
@@ -63,14 +63,14 @@
6363
}
6464
}
6565

66-
protected override void OnInit()
66+
protected override void OnInitialized()
6767
{
6868
Code = @"
6969
<h1>Counter</h1>
7070
7171
<p>Current count: @currentCount</p>
7272
73-
<button class=""btn btn-primary"" onclick=""@IncrementCount"">Click me</button>
73+
<button class=""btn btn-primary"" @onclick=""IncrementCount"">Click me</button>
7474
7575
@functions {
7676
int currentCount = 0;

CompileBlazorInBlazor/Pages/Index.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<div>
77
<div class="form-group">
88
<label for="exampleFormControlTextarea1">C# Code</label>
9-
<textarea class="form-control" id="exampleFormControlTextarea1" rows="10" bind="@CsCode"></textarea>
9+
<textarea class="form-control" id="exampleFormControlTextarea1" rows="10" @bind="@CsCode"></textarea>
1010
</div>
11-
<button type="button" class="btn btn-primary" onclick="@Run">Run</button>
11+
<button type="button" class="btn btn-primary" @onclick="Run">Run</button>
1212
<div class="card">
1313
<div class="card-body">
1414
<pre>@ResultText</pre>
@@ -47,7 +47,7 @@
4747
}
4848
}
4949

50-
protected override void OnInit()
50+
protected override void OnInitialized()
5151
{
5252
CsCode = @"
5353
using System.Text;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
@using CompileBlazorInBlazor.Shared
2-
@layout MainLayout

CompileBlazorInBlazor/Shared/MainLayout.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
@inherits Microsoft.AspNetCore.Components.Layouts.LayoutComponentBase
1+
@inherits LayoutComponentBase
22
<div class="sidebar">
33
<NavMenu />
44
</div>
55

66
<div class="main">
77
<div class="top-row px-4">
8-
<span>.Net Core 3.0 Preview 5</span>
8+
<span>.Net Core 3.0 RC 1</span>
99
<a href="https://github.com/BlazorComponents/CompileBlazorInBlazor" target="_blank" class="ml-md-4">GIT</a>
1010
<a href="https://samprof.com" target="_blank" class="ml-md-4">Author (SamProf)</a>
1111
<a href="http://blazor.net" target="_blank" class="ml-md-4">Blazor</a>

CompileBlazorInBlazor/Shared/NavMenu.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div class="top-row pl-4 navbar navbar-dark">
22
<a class="navbar-brand" href="">CompileBlazorInBlazor</a>
3-
<button class="navbar-toggler" onclick=@ToggleNavMenu>
3+
<button class="navbar-toggler" @onclick=@ToggleNavMenu>
44
<span class="navbar-toggler-icon"></span>
55
</button>
66
</div>
77

8-
<div class=@(collapseNavMenu ? "collapse" : null) onclick=@ToggleNavMenu>
8+
<div class=@(collapseNavMenu ? "collapse" : null) @onclick=@ToggleNavMenu>
99
<ul class="nav flex-column">
1010
<li class="nav-item px-3">
1111
<NavLink class="nav-link" href="" Match=NavLinkMatch.All>

CompileBlazorInBlazor/Shared/SurveyPrompt.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
@functions {
1414
[Parameter]
15-
string Title { get; set; } // Demonstrates how a parent component can supply parameters
15+
public string Title { get; set; } // Demonstrates how a parent component can supply parameters
1616
}

CompileBlazorInBlazor/_Imports.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@using System.Net.Http
22
@using Microsoft.AspNetCore.Components.Forms
3-
@using Microsoft.AspNetCore.Components.Layouts
43
@using Microsoft.AspNetCore.Components.Routing
4+
@using Microsoft.AspNetCore.Components.Web
55
@using Microsoft.JSInterop
66
@using CompileBlazorInBlazor;

README.md

Lines changed: 1 addition & 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-10.5 KB
Binary file not shown.
8.5 KB
Binary file not shown.
Binary file not shown.
512 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

docs/_framework/_bin/System.Core.dll

512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-6.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
278 KB
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

docs/_framework/_bin/System.Xml.dll

0 Bytes
Binary file not shown.

docs/_framework/_bin/System.dll

-24 KB
Binary file not shown.

docs/_framework/_bin/mscorlib.dll

-442 KB
Binary file not shown.

docs/_framework/blazor.boot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"main":"CompileBlazorInBlazor.dll","entryPoint":"CompileBlazorInBlazor.Program::Main","assemblyReferences":["Microsoft.AspNetCore.Blazor.dll","Microsoft.AspNetCore.Components.Browser.dll","Microsoft.AspNetCore.Components.dll","Microsoft.AspNetCore.Razor.Language.dll","Microsoft.CodeAnalysis.CSharp.dll","Microsoft.CodeAnalysis.CSharp.resources.dll","Microsoft.CodeAnalysis.dll","Microsoft.CodeAnalysis.resources.dll","Microsoft.Extensions.DependencyInjection.Abstractions.dll","Microsoft.Extensions.DependencyInjection.dll","Microsoft.JSInterop.dll","Mono.Security.dll","Mono.WebAssembly.Interop.dll","mscorlib.dll","System.Buffers.dll","System.Collections.Immutable.dll","System.ComponentModel.Annotations.dll","System.Core.dll","System.dll","System.Memory.dll","System.Net.Http.dll","System.Numerics.dll","System.Numerics.Vectors.dll","System.Reflection.Metadata.dll","System.Runtime.CompilerServices.Unsafe.dll","System.Text.Encoding.CodePages.dll","System.Threading.Tasks.Extensions.dll","System.Xml.dll","System.Xml.Linq.dll"],"cssReferences":[],"jsReferences":[],"linkerEnabled":true}
1+
{"main":"CompileBlazorInBlazor.dll","entryPoint":"CompileBlazorInBlazor.Program::Main","assemblyReferences":["Microsoft.AspNetCore.Authorization.dll","Microsoft.AspNetCore.Blazor.dll","Microsoft.AspNetCore.Components.dll","Microsoft.AspNetCore.Components.Forms.dll","Microsoft.AspNetCore.Components.Web.dll","Microsoft.AspNetCore.Metadata.dll","Microsoft.AspNetCore.Razor.Language.dll","Microsoft.Bcl.AsyncInterfaces.dll","Microsoft.CodeAnalysis.CSharp.dll","Microsoft.CodeAnalysis.CSharp.resources.dll","Microsoft.CodeAnalysis.dll","Microsoft.CodeAnalysis.resources.dll","Microsoft.Extensions.DependencyInjection.Abstractions.dll","Microsoft.Extensions.DependencyInjection.dll","Microsoft.Extensions.Logging.Abstractions.dll","Microsoft.Extensions.Options.dll","Microsoft.Extensions.Primitives.dll","Microsoft.JSInterop.dll","Mono.Security.dll","Mono.WebAssembly.Interop.dll","mscorlib.dll","System.Buffers.dll","System.Collections.Immutable.dll","System.ComponentModel.Annotations.dll","System.Core.dll","System.dll","System.Memory.dll","System.Net.Http.dll","System.Numerics.dll","System.Numerics.Vectors.dll","System.Reflection.Metadata.dll","System.Runtime.CompilerServices.Unsafe.dll","System.Text.Encoding.CodePages.dll","System.Text.Encodings.Web.dll","System.Text.Json.dll","System.Threading.Tasks.Extensions.dll","System.Xml.dll","System.Xml.Linq.dll"],"cssReferences":[],"jsReferences":[],"linkerEnabled":true}

docs/_framework/blazor.server.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/_framework/blazor.webassembly.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/_framework/wasm/mono.js

Lines changed: 287 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/_framework/wasm/mono.wasm

-61.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)