From 04f9c476a85cfbf3a75d3a17ec4de14e1b58f011 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 9 Jan 2018 13:45:15 +0000 Subject: [PATCH] Update StandaloneApp to render a component. Remove some redundant code. --- samples/StandaloneApp/Program.cs | 14 +++++++++++++- samples/StandaloneApp/StandaloneApp.csproj | 1 + samples/StandaloneApp/wwwroot/index.html | 2 +- src/Microsoft.Blazor/Test.cs | 10 ---------- .../ReferencedAssemblyFileProviderTest.cs | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 src/Microsoft.Blazor/Test.cs diff --git a/samples/StandaloneApp/Program.cs b/samples/StandaloneApp/Program.cs index 2da2284002..e5000876a7 100644 --- a/samples/StandaloneApp/Program.cs +++ b/samples/StandaloneApp/Program.cs @@ -1,6 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.Blazor.Browser.Rendering; +using Microsoft.Blazor.Components; +using Microsoft.Blazor.RenderTree; using System; namespace StandaloneApp @@ -9,7 +12,16 @@ namespace StandaloneApp { public static void Main(string[] args) { - Console.WriteLine(Microsoft.Blazor.Test.Message); + new BrowserRenderer() + .AddComponent("app", new PlaceholderComponent()); + } + + private class PlaceholderComponent : IComponent + { + public void BuildRenderTree(RenderTreeBuilder builder) + { + builder.AddText("Hello from the placeholder component."); + } } } } diff --git a/samples/StandaloneApp/StandaloneApp.csproj b/samples/StandaloneApp/StandaloneApp.csproj index bc9e3e57a8..40516dfe00 100644 --- a/samples/StandaloneApp/StandaloneApp.csproj +++ b/samples/StandaloneApp/StandaloneApp.csproj @@ -9,6 +9,7 @@ + diff --git a/samples/StandaloneApp/wwwroot/index.html b/samples/StandaloneApp/wwwroot/index.html index 83ab2a0396..57433aa96c 100644 --- a/samples/StandaloneApp/wwwroot/index.html +++ b/samples/StandaloneApp/wwwroot/index.html @@ -5,6 +5,6 @@ Blazor standalone -

Hello

+ Loading... diff --git a/src/Microsoft.Blazor/Test.cs b/src/Microsoft.Blazor/Test.cs deleted file mode 100644 index 3aafc43123..0000000000 --- a/src/Microsoft.Blazor/Test.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Blazor -{ - public static class Test - { - public readonly static string Message = "Hello, world!"; - } -} diff --git a/test/Microsoft.Blazor.Build.Test/ReferencedAssemblyFileProviderTest.cs b/test/Microsoft.Blazor.Build.Test/ReferencedAssemblyFileProviderTest.cs index 3c2f100770..d688c36d49 100644 --- a/test/Microsoft.Blazor.Build.Test/ReferencedAssemblyFileProviderTest.cs +++ b/test/Microsoft.Blazor.Build.Test/ReferencedAssemblyFileProviderTest.cs @@ -68,11 +68,11 @@ namespace Microsoft.Blazor.Server.Test fewer assemblies from the server, and during publishing, illink would remove all the uncalled implementation code from mscorlib.dll anyway. */ + "/Microsoft.Blazor.Browser.dll", "/Microsoft.Blazor.dll", "/mscorlib.dll", "/netstandard.dll", "/StandaloneApp.dll", - "/System.Console.dll", "/System.Core.dll", "/System.Diagnostics.StackTrace.dll", "/System.dll",