Skip to content

Commit 481390e

Browse files
authored
Demo for using a NuGet package (#48)
1 parent 24c17a0 commit 481390e

22 files changed

+223
-105
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
<!-- Use Local NuGet package -->
3+
<ItemGroup Condition="$(BLLUseLocalNugetPackages)">
4+
<PackageReference Include="BlazorLazyLoading.Components" Version="$(BLLVersion)" />
5+
</ItemGroup>
6+
7+
<!-- Use Project reference -->
8+
<ItemGroup Condition="!$(BLLUseLocalNugetPackages)">
9+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj" />
10+
</ItemGroup>
11+
</Project>

demo/BlazorLazyLoading.Module.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<!-- Use Local NuGet package -->
3+
<ItemGroup Condition="$(BLLUseLocalNugetPackages)">
4+
<PackageReference Include="BlazorLazyLoading.Module" Version="$(BLLVersion)" PrivateAssets="all" />
5+
</ItemGroup>
6+
7+
<!-- Use Project reference -->
8+
<ItemGroup Condition="!$(BLLUseLocalNugetPackages)">
9+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Module\BlazorLazyLoading.Module.csproj" PrivateAssets="all" />
10+
</ItemGroup>
11+
<Import Condition="!$(BLLUseLocalNugetPackages)" Project="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Module\build\BlazorLazyLoading.Module.props" />
12+
<Import Condition="!$(BLLUseLocalNugetPackages)" Project="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Module\build\BlazorLazyLoading.Module.targets" />
13+
</Project>

demo/BlazorLazyLoading.Server.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
<!-- Use Local NuGet package -->
3+
<ItemGroup Condition="$(BLLUseLocalNugetPackages)">
4+
<PackageReference Include="BlazorLazyLoading.Server" Version="$(BLLVersion)" PrivateAssets="all" />
5+
</ItemGroup>
6+
7+
<!-- Use Project reference -->
8+
<ItemGroup Condition="!$(BLLUseLocalNugetPackages)">
9+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Server\BlazorLazyLoading.Server.csproj" PrivateAssets="all" />
10+
</ItemGroup>
11+
</Project>

demo/BlazorLazyLoading.Wasm.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
<!-- Use Local NuGet package -->
3+
<ItemGroup Condition="$(BLLUseLocalNugetPackages)">
4+
<PackageReference Include="BlazorLazyLoading.Wasm" Version="$(BLLVersion)" PrivateAssets="all" />
5+
</ItemGroup>
6+
7+
<!-- Use Project reference -->
8+
<ItemGroup Condition="!$(BLLUseLocalNugetPackages)">
9+
<ProjectReference Include="$(MSBuildThisFileDirectory)..\nuget\BlazorLazyLoading.Wasm\BlazorLazyLoading.Wasm.csproj" PrivateAssets="all" />
10+
</ItemGroup>
11+
</Project>

demo/Demo.sln

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LazyAreas", "LazyAreas", "{
3737
EndProject
3838
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{DB1AE536-72C2-4CCD-A7D9-0A79AAEEDA54}"
3939
EndProject
40+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LazyComponentFromNuget", "LazyAreas\LazyComponentFromNuget\LazyComponentFromNuget.csproj", "{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}"
41+
EndProject
42+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Imports", "Imports", "{7B174F1E-2091-4D48-9111-B52531C1B865}"
43+
ProjectSection(SolutionItems) = preProject
44+
BlazorLazyLoading.Components.props = BlazorLazyLoading.Components.props
45+
BlazorLazyLoading.Module.props = BlazorLazyLoading.Module.props
46+
BlazorLazyLoading.Server.props = BlazorLazyLoading.Server.props
47+
BlazorLazyLoading.Wasm.props = BlazorLazyLoading.Wasm.props
48+
EndProjectSection
49+
EndProject
4050
Global
4151
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4252
Debug|Any CPU = Debug|Any CPU
@@ -155,6 +165,18 @@ Global
155165
{DB1AE536-72C2-4CCD-A7D9-0A79AAEEDA54}.Release|x64.Build.0 = Release|Any CPU
156166
{DB1AE536-72C2-4CCD-A7D9-0A79AAEEDA54}.Release|x86.ActiveCfg = Release|Any CPU
157167
{DB1AE536-72C2-4CCD-A7D9-0A79AAEEDA54}.Release|x86.Build.0 = Release|Any CPU
168+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
169+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|Any CPU.Build.0 = Debug|Any CPU
170+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|x64.ActiveCfg = Debug|Any CPU
171+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|x64.Build.0 = Debug|Any CPU
172+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|x86.ActiveCfg = Debug|Any CPU
173+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Debug|x86.Build.0 = Debug|Any CPU
174+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|Any CPU.ActiveCfg = Release|Any CPU
175+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|Any CPU.Build.0 = Release|Any CPU
176+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|x64.ActiveCfg = Release|Any CPU
177+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|x64.Build.0 = Release|Any CPU
178+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|x86.ActiveCfg = Release|Any CPU
179+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97}.Release|x86.Build.0 = Release|Any CPU
158180
EndGlobalSection
159181
GlobalSection(SolutionProperties) = preSolution
160182
HideSolutionNode = FALSE
@@ -171,6 +193,8 @@ Global
171193
{E503BF43-DE57-4DB6-AF93-A5F765C94154} = {2587AE99-7624-47E4-B6B8-79EC67346F67}
172194
{566D14F1-B2FB-463C-A627-C5EB23B763B7} = {2587AE99-7624-47E4-B6B8-79EC67346F67}
173195
{DB1AE536-72C2-4CCD-A7D9-0A79AAEEDA54} = {2587AE99-7624-47E4-B6B8-79EC67346F67}
196+
{A4D17AA8-D918-45FD-9CCA-3FC5ECCDBD97} = {566D14F1-B2FB-463C-A627-C5EB23B763B7}
197+
{7B174F1E-2091-4D48-9111-B52531C1B865} = {2587AE99-7624-47E4-B6B8-79EC67346F67}
174198
EndGlobalSection
175199
GlobalSection(ExtensibilityGlobals) = postSolution
176200
SolutionGuid = {B979A335-AE81-406A-AADA-F236549D23D3}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.1</TargetFramework>
5+
<RazorLangVersion>3.0</RazorLangVersion>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.2" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.2" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Faso.Blazor.SpinKit" Version="1.0.1" />
15+
</ItemGroup>
16+
17+
<Import Project="../../BlazorLazyLoading.Components.props" />
18+
19+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@page "/lazy-component-from-nuget"
2+
3+
<h1>Lazy Component from NuGet</h1>
4+
<p>
5+
The following component is rendered from a nuget package (Faso.Blazor.SpinKit in this case).
6+
The nuget DLL will only be loaded when opening this page for the first time. Please check the network tab :)
7+
</p>
8+
9+
@*
10+
Works fine out of the box
11+
*@
12+
<Faso.Blazor.SpinKit.SpinKitWave />
13+
14+
@*
15+
Requires the Module to have:
16+
+ <BLLManifestAssemblies Include="Faso.Blazor.SpinKit" />
17+
*@
18+
@*<Lazy Name="Faso.Blazor.SpinKit.SpinKitWave" />*@
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@using System.Net.Http
2+
@using Microsoft.AspNetCore.Components.Forms
3+
@using Microsoft.AspNetCore.Components.Routing
4+
@using Microsoft.AspNetCore.Components.Web
5+
@using Microsoft.JSInterop
6+
7+
@using BlazorLazyLoading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_lazy/
2+
_lazy.json

demo/Logger/Logger.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@
1010
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.2" />
1111
</ItemGroup>
1212

13-
<!-- Use Local NuGet package -->
14-
<ItemGroup Condition="$(BLLUseLocalNugetPackages)">
15-
<PackageReference Include="BlazorLazyLoading.Components" Version="$(BLLVersion)" />
16-
</ItemGroup>
17-
18-
<!-- Use Project reference -->
19-
<ItemGroup Condition="!$(BLLUseLocalNugetPackages)">
20-
<ProjectReference Include="..\..\nuget\BlazorLazyLoading.Components\BlazorLazyLoading.Components.csproj" />
21-
</ItemGroup>
13+
<Import Project="../BlazorLazyLoading.Components.props" />
2214

2315
<ItemGroup>
2416
<ProjectReference Include="..\Core\Core.csproj" />

0 commit comments

Comments
 (0)