Skip to content

Extraction of MatBlazor Documentation as a reusable component #872

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

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5366cfb
seperated Doc App from Mat Blazor Doc
TFTomSun Mar 24, 2021
16f4c7e
completed separation of MatBlazor.Doc and documentation of MatBlazor
TFTomSun Mar 25, 2021
8134a0e
switched back to MatBlazor Docu for pull request
TFTomSun Mar 25, 2021
70767fb
renamed doc containers
TFTomSun Mar 25, 2021
5b1590b
fixed full doc
TFTomSun Mar 25, 2021
d17cd67
cleanup and switch Doc.Demo completly to XmlDoc and RazorDoc container
TFTomSun Mar 25, 2021
33ce966
added launch settings to switch between new and old approach to creat…
TFTomSun Mar 25, 2021
dc14158
master -> develop
TFTomSun Mar 25, 2021
8c6df23
removed support for new documentation approach from the existing docu…
TFTomSun Mar 25, 2021
339b36f
added caching for razor code
TFTomSun Mar 25, 2021
5410886
made appbar links configurable
TFTomSun Mar 25, 2021
d4bd83f
some rename / cleanup
TFTomSun Mar 25, 2021
69de6fa
added MatBlazorVirtualScroll
TFTomSun Mar 27, 2021
4acb4cb
fixed docinfo caching
TFTomSun Mar 27, 2021
7948715
fixed MatVirtualScroll: MatVirtualScrollView properties must be double
TFTomSun Mar 27, 2021
3bff762
merged SamProf/develop ->TFTomSun/develop
TFTomSun Mar 27, 2021
99d837f
removed obsolete msbuild properties for .net5 build
TFTomSun Mar 27, 2021
74573e6
added ItemsProvider support to MatBlazorVirtualScroll (>.NET 5 only)
TFTomSun Mar 27, 2021
a7e847f
minor change
TomCollaboration Apr 24, 2021
a169b05
fixed ordering of nav items
TomCollaboration Apr 24, 2021
91b55e9
added git versioning
TomCollaboration Apr 24, 2021
047344e
added OnFirstRenderedAsync parameter
TomCollaboration May 5, 2021
02a5cc2
fixed blazor fiddle interop exception on reloading page, made rating …
TomCollaboration Jun 19, 2021
aa71b48
make MatBlazor offline capabable
TomCollaboration Jul 9, 2021
a21d1fe
added batch to add the remote
TomCollaboration Jul 9, 2021
b1f3d68
merged from upstream / develop
TomCollaboration Jul 9, 2021
a5b89d2
added hook to fix matblazor hidden destroy issue
TomCollaboration Jul 13, 2021
efc274b
removed netstandard 2.1 support, added global cancellation token to c…
TomCollaboration Jul 31, 2021
fa453ee
added try catch for js invoke during dispose
TomCollaboration Apr 19, 2022
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
4 changes: 4 additions & 0 deletions src/AddForkBaseRemote.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
git remote add upstream2 https://github.com/SamProf/MatBlazor.git
echo IMPORTANT: now fetch upstream2 from sync window in visual studio
pause
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<ItemGroup>
<ProjectReference Include="..\MatBlazor.Demo\MatBlazor.Demo.csproj" />
<ProjectReference Include="..\MatBlazor.Doc.Demo\MatBlazor.Doc.Demo.csproj" />
<ProjectReference Include="..\MatBlazor\MatBlazor.csproj" />
</ItemGroup>

Expand Down
36 changes: 18 additions & 18 deletions src/MatBlazor.Demo.ClientApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using MatBlazor.Demo.Models;
using MatBlazor.Demo.Services;
using MatBlazor.Demo.Pages;
using MatBlazor.Doc;
using MatBlazor.Doc.Demo;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
Expand All @@ -13,27 +16,24 @@ public class Program
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");

builder.Services.AddTransient(sp => new HttpClient
builder.RootComponents.Add<MatBlazor.Doc.DocApp>("app");
var services = builder.Services;
services.AddTransient(sp => new HttpClient
{BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)});


builder.Services.AddMatBlazor();
builder.Services.AddSingleton<AppModel>();
builder.Services.AddScoped<UserAppModel>();
builder.Services.AddScoped<DemoUserService>();
builder.Services.AddMatToaster(config =>
{
//example MatToaster customizations
config.PreventDuplicates = false;
config.NewestOnTop = true;
config.ShowCloseButton = true;
});

await builder
.Build()
.RunAsync();
var useDocFrameModel = Environment.GetEnvironmentVariable("USE_DOC_APPFRAME_DEMO") == "true";
AppModel appModel = useDocFrameModel ?
new DocFrameAppModel() :
new MatBlazorDocumentationAppModel();

services.AddDocApp(appModel);

//builder.Services.AddDocApp(new AppModel(typeof(Pages.Index), DemoNavModel.Default()));
services.AddScoped<DemoUserService>();


await builder.Build().RunAsync();
}
}
}
10 changes: 10 additions & 0 deletions src/MatBlazor.Demo.ClientApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:62766/"
},
"MatBlazor.Demo.ClientApp_new": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"USE_DOC_APPFRAME_DEMO": "true"
},
"applicationUrl": "http://localhost:62766/"
}

}
}
6 changes: 3 additions & 3 deletions src/MatBlazor.Demo.ClientApp/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
</script>


<link href="_content/MatBlazor.Demo/site.css" rel="stylesheet" />
<link href="_content/MatBlazor.Doc/site.css" rel="stylesheet" />
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
<link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" />
<script src="_content/MatBlazor.Demo/matBlazorDemo.js"></script>
<script src="_content/MatBlazor.Demo/blazorFiddleLoader.js"></script>
<script src="_content/MatBlazor.Doc/matBlazorDemo.js"></script>
<script src="_content/MatBlazor.Doc/blazorFiddle.js"></script>
<script data-ad-client="ca-pub-3904134905954949" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


Expand Down
38 changes: 0 additions & 38 deletions src/MatBlazor.Demo.ServerApp/App.razor

This file was deleted.

3 changes: 2 additions & 1 deletion src/MatBlazor.Demo.ServerApp/MatBlazor.Demo.ServerApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<LangVersion>9</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,6 +19,7 @@

<ItemGroup>
<ProjectReference Include="..\MatBlazor.Demo\MatBlazor.Demo.csproj" />
<ProjectReference Include="..\MatBlazor.Doc.Demo\MatBlazor.Doc.Demo.csproj" />
<ProjectReference Include="..\MatBlazor\MatBlazor.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/MatBlazor.Demo.ServerApp/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
}


@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
@(await Html.RenderComponentAsync<MatBlazor.Doc.DocApp>(RenderMode.ServerPrerendered))
6 changes: 3 additions & 3 deletions src/MatBlazor.Demo.ServerApp/Pages/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
</script>


<link href="_content/MatBlazor.Demo/site.css" rel="stylesheet" />
<link href="_content/MatBlazor.Doc/site.css" rel="stylesheet" />
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
<link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" />
<script src="_content/MatBlazor.Demo/matBlazorDemo.js"></script>
<script src="_content/MatBlazor.Demo/blazorFiddleLoader.js"></script>
<script src="_content/MatBlazor.Doc/matBlazorDemo.js"></script>
<script src="_content/MatBlazor.Doc/blazorFiddle.js"></script>
<script data-ad-client="ca-pub-3904134905954949" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

</head>
Expand Down
9 changes: 9 additions & 0 deletions src/MatBlazor.Demo.ServerApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"MatBlazor.Demo.ServerApp_new": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"USE_DOC_APPFRAME_DEMO": "true"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}
18 changes: 8 additions & 10 deletions src/MatBlazor.Demo.ServerApp/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using MatBlazor.Demo.Models;
using MatBlazor.Demo.Services;
using MatBlazor.Doc.Demo;
using MatBlazor.Demo.Pages;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
Expand Down Expand Up @@ -33,18 +35,14 @@ public void ConfigureServices(IServiceCollection services)

});

var useDocFrameModel = Environment.GetEnvironmentVariable("USE_DOC_APPFRAME_DEMO") == "true";
AppModel appModel = useDocFrameModel ?
new DocFrameAppModel() :
new MatBlazorDocumentationAppModel();

services.AddDocApp(appModel);

services.AddSingleton<AppModel>();
services.AddScoped<UserAppModel>();
services.AddScoped<DemoUserService>();
services.AddMatToaster(config =>
{
//example MatToaster customizations
config.PreventDuplicates = false;
config.NewestOnTop = true;
config.ShowCloseButton = true;
});
services.AddScoped<DemoUserService>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down
6 changes: 0 additions & 6 deletions src/MatBlazor.Demo.ServerApp/_Imports.razor

This file was deleted.

2 changes: 1 addition & 1 deletion src/MatBlazor.Demo/Demo/DemoAutocomplete.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

</Content>
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatAutocomplete Items=""@options"" Label=""Pick one"" @bind-Value=""@value""></MatAutocomplete>

@code
Expand Down
39 changes: 20 additions & 19 deletions src/MatBlazor.Demo/MatBlazor.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<LangVersion>9</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<TargetFrameworks>net5.0;netstandard2.1</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>



<ItemGroup Condition="$(TargetFramework) == 'netstandard2.1'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net5.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0" />
</ItemGroup>

<Choose>
<When Condition="$(TargetFramework) == 'netstandard2.1'">
<PropertyGroup>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<ProjectReference Include="..\MatBlazor.Doc\MatBlazor.Doc.csproj" />
<ProjectReference Include="..\MatBlazor\MatBlazor.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Doc" />
</ItemGroup>
</Project>
Loading