Skip to content

Commit

Permalink
- Update to .NET 9
Browse files Browse the repository at this point in the history
- Update dependencies
- Fix talk page
  • Loading branch information
WilStead committed Nov 21, 2024
1 parent c5dc1e0 commit 45cef86
Show file tree
Hide file tree
Showing 30 changed files with 1,283 additions and 1,167 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '8.x'
dotnet-version: '9.x'

- name: Install dependencies
run: dotnet restore
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: publish
env:
VERSION: '0.9.13-preview'
VERSION: '0.10.0-preview'
PRERELEASE: true
on:
push:
Expand All @@ -12,11 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '8.x'
dotnet-version: '9.x'


- name: Install dependencies
Expand Down
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.10.0-preview
### Updated
- Update to .NET 9
- Update dependencies
### Fixed
- Talk page

## 0.9.12-13-preview
### Updated
- Update dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions sample/Web App Example/Tavenem.Wiki.Blazor.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@

app.UseAntiforgery();

app.MapStaticAssets();

app.MapWiki();
app.MapRazorComponents<App>()
.AddInteractiveWebAssemblyRenderMode()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand All @@ -11,7 +11,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Server\Tavenem.Wiki.Blazor.Server.csproj" />
<ProjectReference Include="..\Tavenem.Wiki.Blazor.Example.Client\Tavenem.Wiki.Blazor.Example.Client.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions sample/WebAssembly Example/Tavenem.Wiki.Blazor.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.10" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions src/Client/Internal/WikiState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ public string DisplayTitle
/// </summary>
public bool IsCompact { get; internal set; }

/// <summary>
/// Whether the current wiki page is being edited.
/// </summary>
public bool IsEditing { get; set; }

/// <summary>
/// Whether the current wiki page is being previewed.
/// </summary>
public bool IsPreview { get; set; }

/// <summary>
/// Whether the current page is a special system page.
/// </summary>
Expand Down Expand Up @@ -67,6 +77,16 @@ public bool NotAuthorized
/// </summary>
public string PageTitle { get; private set; }

/// <summary>
/// Whether the history of the current wiki page is being shown, rather than the content.
/// </summary>
public bool ShowHistory { get; set; }

/// <summary>
/// Whether the links to the current wiki page are being shown, rather than the content.
/// </summary>
public bool ShowWhatLinksHere { get; set; }

/// <summary>
/// The current user (if non-anonymous).
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/Client/LinkerConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
<linker>
<assembly fullname="Tavenem.DataStore" />
<assembly fullname="Tavenem.Wiki" />
<assembly fullname="Tavenem.Wiki.Blazor.Shared" />
</linker>
95 changes: 95 additions & 0 deletions src/Client/Pages/ArticleView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using System.Diagnostics.CodeAnalysis;

namespace Tavenem.Wiki.Blazor.Client.Pages;

/// <summary>
/// The article view.
/// </summary>
public class ArticleView : ComponentBase
{
/// <summary>
/// The article to display.
/// </summary>
[Parameter] public Page? Page { get; set; }

/// <summary>
/// Whether the current user has permission to edit this article.
/// </summary>
[Parameter] public bool CanEdit { get; set; }

/// <summary>
/// The content to display.
/// </summary>
[Parameter] public MarkupString Content { get; set; }

/// <summary>
/// Whether to display a diff.
/// </summary>
[Parameter] public bool IsDiff { get; set; }

/// <summary>
/// The current user (may be null if the current user is browsing anonymously).
/// </summary>
[Parameter] public IWikiUser? User { get; set; }

[Inject, NotNull] private WikiBlazorOptions? WikiBlazorClientOptions { get; set; }

[Inject, NotNull] private WikiOptions? WikiOptions { get; set; }

/// <inheritdoc/>
[UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2111:RequiresUnreferencedCode",
Justification = "OpenComponent already has the right set of attributes")]
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddAttribute(1, "class", "wiki-site-subtitle");
builder.AddContent(2, "From ");
builder.AddContent(3, WikiOptions.SiteName);
builder.CloseElement();

if (!IsDiff && Page is not null)
{
var frontMatterType = WikiBlazorClientOptions.GetArticleFrontMatter(Page);
if (frontMatterType is not null)
{
var frontMatterRenderMode = WikiBlazorClientOptions.GetArticleFrontMatterRenderMode(Page);
builder.OpenComponent(4, frontMatterType);
builder.AddAttribute(5, nameof(WikiComponent.Page), Page);
builder.AddAttribute(6, nameof(WikiComponent.CanEdit), CanEdit);
builder.AddAttribute(7, nameof(WikiComponent.User), User);
if (frontMatterRenderMode is not null)
{
builder.AddComponentRenderMode(frontMatterRenderMode);
}
builder.CloseComponent();
}
}

builder.OpenElement(8, "tf-syntax-highlight");
builder.AddAttribute(9, "class", "wiki-parser-output");
builder.AddContent(10, Content);
builder.CloseElement();

if (!IsDiff && Page is not null)
{
var endMatterType = WikiBlazorClientOptions.GetArticleFrontMatter(Page);
if (endMatterType is not null)
{
var endMatterRenderMode = WikiBlazorClientOptions.GetArticleFrontMatterRenderMode(Page);
builder.OpenComponent(11, endMatterType);
builder.AddAttribute(12, nameof(WikiComponent.Page), Page);
builder.AddAttribute(13, nameof(WikiComponent.CanEdit), CanEdit);
builder.AddAttribute(14, nameof(WikiComponent.User), User);
if (endMatterRenderMode is not null)
{
builder.AddComponentRenderMode(endMatterRenderMode);
}
builder.CloseComponent();
}
}
}
}
18 changes: 0 additions & 18 deletions src/Client/Pages/ArticleView.razor

This file was deleted.

73 changes: 0 additions & 73 deletions src/Client/Pages/ArticleView.razor.cs

This file was deleted.

Loading

0 comments on commit 45cef86

Please sign in to comment.