Skip to content

Feature/components #21

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 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 58 additions & 4 deletions BlazorLazyLoading.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoading.Module",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManifestGenerator", "src\ManifestGenerator\ManifestGenerator.csproj", "{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorLazyLoading.Components", "nuget\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj", "{D5DC7943-2F45-4EDE-AF78-592A6A153671}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LazyComponents", "src\LazyComponents\LazyComponents.csproj", "{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManifestReader", "src\ManifestReader\ManifestReader.csproj", "{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AssemblyLoading", "AssemblyLoading", "{9E765815-21C8-4920-B6C4-B072C5A5DEE3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{43806489-02DC-4E72-A983-40B4B6113D27}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Manifest", "Manifest", "{2B3516BB-63DC-46FA-ADE9-A1A4BF05F513}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -128,18 +140,60 @@ Global
{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C}.Release|x64.Build.0 = Release|Any CPU
{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C}.Release|x86.ActiveCfg = Release|Any CPU
{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C}.Release|x86.Build.0 = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|x64.ActiveCfg = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|x64.Build.0 = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|x86.ActiveCfg = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Debug|x86.Build.0 = Debug|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|Any CPU.Build.0 = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|x64.ActiveCfg = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|x64.Build.0 = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|x86.ActiveCfg = Release|Any CPU
{D5DC7943-2F45-4EDE-AF78-592A6A153671}.Release|x86.Build.0 = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|x64.ActiveCfg = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|x64.Build.0 = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|x86.ActiveCfg = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Debug|x86.Build.0 = Debug|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|Any CPU.Build.0 = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|x64.ActiveCfg = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|x64.Build.0 = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|x86.ActiveCfg = Release|Any CPU
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1}.Release|x86.Build.0 = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|x64.ActiveCfg = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|x64.Build.0 = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|x86.ActiveCfg = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Debug|x86.Build.0 = Debug|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|Any CPU.Build.0 = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x64.ActiveCfg = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x64.Build.0 = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x86.ActiveCfg = Release|Any CPU
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BA733883-4EB1-4BD3-91EB-6414814196E3} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{2E031DBF-19C0-40F1-A77F-39F7429081BA} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{BFC6F53C-1292-48AE-A95D-3D53148AB22B} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{BA733883-4EB1-4BD3-91EB-6414814196E3} = {9E765815-21C8-4920-B6C4-B072C5A5DEE3}
{2E031DBF-19C0-40F1-A77F-39F7429081BA} = {9E765815-21C8-4920-B6C4-B072C5A5DEE3}
{BFC6F53C-1292-48AE-A95D-3D53148AB22B} = {9E765815-21C8-4920-B6C4-B072C5A5DEE3}
{36FDF188-E5B9-4E1C-8EB7-707DE44AB77F} = {593AE082-BD15-4FEB-8DC2-20D4ABA3AFD4}
{B14D3B51-3320-46B7-8815-0FF3F18DBCB3} = {593AE082-BD15-4FEB-8DC2-20D4ABA3AFD4}
{0DE40B36-69C4-4F1C-B419-B9A4DB9CFC8D} = {593AE082-BD15-4FEB-8DC2-20D4ABA3AFD4}
{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{DF18C6BF-F2D7-45B9-BB90-B3E6418AB36C} = {2B3516BB-63DC-46FA-ADE9-A1A4BF05F513}
{D5DC7943-2F45-4EDE-AF78-592A6A153671} = {593AE082-BD15-4FEB-8DC2-20D4ABA3AFD4}
{4265A87B-BD94-413F-8883-BA3D1A3C0BC1} = {43806489-02DC-4E72-A983-40B4B6113D27}
{10AB33A5-80F4-4D02-9DBE-0484C3BB6954} = {2B3516BB-63DC-46FA-ADE9-A1A4BF05F513}
{9E765815-21C8-4920-B6C4-B072C5A5DEE3} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{43806489-02DC-4E72-A983-40B4B6113D27} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
{2B3516BB-63DC-46FA-ADE9-A1A4BF05F513} = {7A7C9856-CA0D-4655-8AF9-4BF60D997ACB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FE945EF4-4832-4073-8FD8-D1517AE90E21}
Expand Down
17 changes: 16 additions & 1 deletion demo/Demo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoading.Server",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoading.Wasm", "..\nuget\BlazorLazyLoading.Wasm\BlazorLazyLoading.Wasm.csproj", "{B78FC2FE-F107-49AB-95FC-E7F4559C879A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModulesHost", "ModulesHost\ModulesHost.csproj", "{9B062109-5E21-46CD-BDD1-315529E585E8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesHost", "ModulesHost\ModulesHost.csproj", "{9B062109-5E21-46CD-BDD1-315529E585E8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{2587AE99-7624-47E4-B6B8-79EC67346F67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoading.Components", "..\nuget\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj", "{83419656-8137-4AEB-9A5B-74C7B85621F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -123,6 +125,18 @@ Global
{9B062109-5E21-46CD-BDD1-315529E585E8}.Release|x64.Build.0 = Release|Any CPU
{9B062109-5E21-46CD-BDD1-315529E585E8}.Release|x86.ActiveCfg = Release|Any CPU
{9B062109-5E21-46CD-BDD1-315529E585E8}.Release|x86.Build.0 = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|x64.ActiveCfg = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|x64.Build.0 = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Debug|x86.Build.0 = Debug|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|Any CPU.Build.0 = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|x64.ActiveCfg = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|x64.Build.0 = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|x86.ActiveCfg = Release|Any CPU
{83419656-8137-4AEB-9A5B-74C7B85621F6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -135,6 +149,7 @@ Global
{6C5945E8-44F9-4898-AB78-FF0D85F5515B} = {2DFA918F-9417-49B8-9FDA-E2231179978C}
{B78FC2FE-F107-49AB-95FC-E7F4559C879A} = {2DFA918F-9417-49B8-9FDA-E2231179978C}
{9B062109-5E21-46CD-BDD1-315529E585E8} = {2587AE99-7624-47E4-B6B8-79EC67346F67}
{83419656-8137-4AEB-9A5B-74C7B85621F6} = {2DFA918F-9417-49B8-9FDA-E2231179978C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B979A335-AE81-406A-AADA-F236549D23D3}
Expand Down
2 changes: 1 addition & 1 deletion demo/Logger/Logger.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<BLLGenerateLazyManifest>false</BLLGenerateLazyManifest>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions demo/ModulesHost/Components/Component1.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h3>YESSS IM LAZY</h3>
4 changes: 2 additions & 2 deletions demo/ModulesHost/ModulesHost.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<!-- Modules -->
<ItemGroup>
<!--<ProjectReference Include="..\Logger\Logger.csproj" Name="Logger" />-->
<ProjectReference Include="..\Logger\Logger.csproj" Name="Logger" />
</ItemGroup>

<!-- Extra dependencies -->
Expand Down
2 changes: 2 additions & 0 deletions demo/WasmHost/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

<Lazy Name="Component1" />

@code {
private int currentCount = 0;

Expand Down
2 changes: 2 additions & 0 deletions demo/WasmHost/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
@using Microsoft.JSInterop
@using WasmHost
@using WasmHost.Shared

@using BlazorLazyLoading
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<PropertyGroup>
<PackageId>$(MSBuildProjectName)</PackageId>
<Product>$(MSBuildProjectName)</Product>
<Title>$(MSBuildProjectName)</Title>
<Description>Razor Components for lazy loadable modules</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\LazyComponents\LazyComponents.csproj" />
<ProjectReference Include="..\..\src\ManifestReader\ManifestReader.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
</PropertyGroup>

<ItemGroup>
<BLLManifestGeneratorAssemblyNames Remove="*" />
<BLLManifestGeneratorAssemblyPaths Remove="*" />

<BLLManifestGeneratorAssemblyNames Include="$(MSBuildProjectName)" />
<BLLManifestGeneratorAssemblyPaths Include="$(_BLLNugetPackageBuildBinDirectory)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
</PropertyGroup>

<ItemGroup>
<ManifestGeneratorAssemblyNames Include="@(ProjectReference->'%(Name)')" />
<BLLManifestGeneratorAssemblyNames Include="@(ProjectReference->'%(Name)')" />
</ItemGroup>

<Message Importance="normal" Text="BLLManifestGeneratorAssemblyNames: @(BLLManifestGeneratorAssemblyNames)" />

<GenerateManifest
AssemblyNames="@(BLLManifestGeneratorAssemblyNames)"
AssemblyPaths="$(ProjectOutDir);@(BLLManifestGeneratorAssemblyPaths)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<ProjectReference Include="..\..\src\AssemblyLoader.Server\AssemblyLoader.Server.csproj" />
<ProjectReference Include="..\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace BlazorLazyLoading.Server
{
public static class AssemblyLoaderStartupExtensions
public static class BLLServerStartupExtensions
{
public static IServiceCollection AddLazyLoading(
this IServiceCollection services,
Expand All @@ -20,19 +20,21 @@ public static IServiceCollection AddLazyLoading(
services.AddScoped<IAssemblyLoader, AssemblyLoader>();
services.AddSingleton<IAssemblyLoadContextFactory, DisposableAssemblyLoadContextFactory>();
services.AddSingleton<IAssemblyDataLocator, AssemblyDataLocator>();
services.AddSingleton<IAssemblyDataProvider, AssemblyDataProvider>();

services.AddSingleton<ILazyModuleHintsProvider>(
p => new LazyModuleHintsProvider(options.ModuleHints));

services.AddSingleton<IAssemblyDataProvider>(
services.AddSingleton<IContentFileReader>(
p =>
{
IWebHostEnvironment env = p.GetRequiredService<IWebHostEnvironment>();
IAssemblyDataLocator assemblyDataLocator = p.GetRequiredService<IAssemblyDataLocator>();

return new FileProviderAssemblyDataProvider(assemblyDataLocator, env.WebRootFileProvider);
return new FileProviderContentFileReader(env.WebRootFileProvider);
});

services.AddSingleton<ILazyModuleHintsProvider>(
p => new LazyModuleHintsProvider(options.ModuleHints));

services.AddSingleton<IManifestLocator, ManifestLocator>();
services.AddSingleton<IManifestRepository, ManifestRepository>();

return services;
}

Expand Down
1 change: 1 addition & 0 deletions nuget/BlazorLazyLoading.Wasm/BlazorLazyLoading.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<ProjectReference Include="..\..\src\AssemblyLoader.Wasm\AssemblyLoader.Wasm.csproj" />
<ProjectReference Include="..\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@

namespace BlazorLazyLoading.Wasm
{
public static class AssemblyLoaderStartupExtensions
public static class BLLWasmStartupExtensions
{
public static IServiceCollection AddLazyLoading(
this IServiceCollection services,
LazyLoadingOptions options)
{
services.AddSingleton<IAssemblyLoader, AssemblyLoader>();
services.AddSingleton<IAssemblyLoadContextFactory, AppDomainAssemblyLoadContextFactory>();
services.AddSingleton<IAssemblyDataProvider, NetworkAssemblyDataProvider>();
services.AddSingleton<IAssemblyDataLocator, AssemblyDataLocator>();
services.AddSingleton<IContentFileReader, NetworkContentFileReader>();
services.AddSingleton<IAssemblyDataProvider, AssemblyDataProvider>();

services.AddSingleton<IManifestLocator, ManifestLocator>();
services.AddSingleton<IManifestRepository, ManifestRepository>();

services.AddSingleton<ILazyModuleHintsProvider>(
p => new LazyModuleHintsProvider(options.ModuleHints));
Expand Down

This file was deleted.

Loading