Skip to content

Commit

Permalink
Fixes for .NET 8 RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Nov 2, 2023
1 parent 08834f8 commit d5185b3
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 125 deletions.
20 changes: 13 additions & 7 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ source https://api.nuget.org/v3/index.json
storage: none
framework: net8.0

nuget Microsoft.AspNetCore.Components.Web >= 8.0 preview
nuget Elmish >= 4.0.1 < 5.0 lowest_matching: true
nuget Microsoft.AspNetCore.Components.WebAssembly >= 8.0.0-rc.2.23480.2
nuget Microsoft.JSInterop.WebAssembly >= 8.0.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.Web >= 8.0.0-rc.2.23480.2
nuget Microsoft.Extensions.Http >= 8.0.0-rc.2.23479.6
nuget FSharp.SystemTextJson >= 0.19.13
nuget System.Text.Json >= 8.0.0-rc.2.23479.6

group build
source https://api.nuget.org/v3/index.json
Expand Down Expand Up @@ -84,9 +90,9 @@ source https://api.nuget.org/v3/index.json
storage: none
framework: net8.0

nuget Microsoft.AspNetCore.OpenApi ~> 8.0 preview
nuget Microsoft.AspNetCore.Components.Authorization ~> 8.0 preview
nuget Microsoft.AspNetCore.Components.WebAssembly ~> 8.0 preview
nuget Microsoft.AspNetCore.Components.WebAssembly.Authentication ~> 8.0 preview
nuget Microsoft.AspNetCore.Components.WebAssembly.DevServer ~> 8.0 preview
nuget Microsoft.AspNetCore.Components.WebAssembly.Server ~> 8.0 preview
nuget Microsoft.AspNetCore.OpenApi ~> 8.0.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.Authorization ~> 8.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.WebAssembly ~> 8.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.WebAssembly.Authentication ~> 8.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.WebAssembly.DevServer ~> 8.0-rc.2.23480.2
nuget Microsoft.AspNetCore.Components.WebAssembly.Server ~> 8.0-rc.2.23480.2
307 changes: 194 additions & 113 deletions paket.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Bolero.Server/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ Nerdbank.GitVersioning
FSharp.SystemTextJson

group net8
Microsoft.JSInterop.WebAssembly
Microsoft.AspNetCore.Components.WebAssembly
Microsoft.AspNetCore.Components.Web
7 changes: 7 additions & 0 deletions src/Bolero.Server/paket.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ interproject-references fix
excludeddependencies
nerdbank.gitversioning
include-pdbs true
dependencies
framework: net6.0
framework: net7.0
framework: net8.0
Microsoft.AspNetCore.Components.Web >= 8.0-rc.2.23480.2
Microsoft.AspNetCore.Components.WebAssembly >= 8.0-rc.2.23480.2
Microsoft.JSInterop.WebAssembly >= 8.0-rc.2.23480.2
3 changes: 2 additions & 1 deletion src/Bolero/Bolero.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<OutputType>Library</OutputType>
<IsTrimmable>true</IsTrimmable>
<!-- <DefineConstants>DEBUG_RENDERER;$(DefineConstants)</DefineConstants> -->
Expand Down
9 changes: 8 additions & 1 deletion src/Bolero/Router.fs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,15 @@ exception InvalidRouter of kind: InvalidRouterKind with
type PageModel<'T> =
{ Model: 'T }

#if NET8_0
static let prop = typeof<PageModel<'T>>.GetProperty("Model")

Check failure on line 194 in src/Bolero/Router.fs

View workflow job for this annotation

GitHub Actions / build

For F#7 and lower, static value definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version 'preview'.

Check failure on line 194 in src/Bolero/Router.fs

View workflow job for this annotation

GitHub Actions / build

For F#7 and lower, static value definitions may only be used in types with a primary constructor ('type X(args) = ...'). To enable them in all other types, use language version 'preview'.

member internal this.SetModel(value) =
prop.SetValue(this, value)
#else
member internal this.SetModel(value) =
(Unsafe.AsRef<'T> &this.Model) <- value
(Unsafe.AsRef<'T>(&this.Model)) <- value
#endif

[<AutoOpen>]
module private RouterImpl =
Expand Down
9 changes: 8 additions & 1 deletion src/Bolero/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ Microsoft.AspNetCore.Components.WebAssembly
Elmish
Nerdbank.GitVersioning
Microsoft.Extensions.Http
FSharp.SystemTextJson
FSharp.SystemTextJson

group net8
Elmish
Microsoft.AspNetCore.Components.WebAssembly
Microsoft.JSInterop.WebAssembly
Microsoft.Extensions.Http
FSharp.SystemTextJson
7 changes: 6 additions & 1 deletion src/Bolero/paket.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ excludeddependencies
include-pdbs true
dependencies
framework: net6.0
Microsoft.JSInterop.WebAssembly ~> 6.0
Microsoft.AspNetCore.Components.WebAssembly ~> 6.0
framework: net7.0
Microsoft.AspNetCore.Components.WebAssembly >= 7.0
Microsoft.JSInterop.WebAssembly ~> 7.0
Microsoft.AspNetCore.Components.WebAssembly ~> 7.0
framework: net8.0
Microsoft.JSInterop.WebAssembly >= 8.0-rc.2.23480.2
Microsoft.AspNetCore.Components.WebAssembly >= 8.0-rc.2.23480.2
4 changes: 3 additions & 1 deletion tests/Remoting.Server/paket.references
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
group tests
FSharp.Core
Swashbuckle.AspNetCore
FSharp.SystemTextJson.Swagger

group tests-net8
Microsoft.AspNetCore.OpenApi
Microsoft.AspNetCore.Components
Microsoft.AspNetCore.Components.WebAssembly
Microsoft.AspNetCore.Components.WebAssembly.Server
FSharp.SystemTextJson.Swagger
2 changes: 2 additions & 0 deletions tests/Server/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ group tests
FSharp.Core

group tests-net8
Microsoft.AspNetCore.Components
Microsoft.AspNetCore.Components.WebAssembly
Microsoft.AspNetCore.Components.WebAssembly.Server
2 changes: 2 additions & 0 deletions tests/Unit/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Selenium.WebDriver.ChromeDriver
Unquote

group tests-net8
Microsoft.AspNetCore.Components
Microsoft.AspNetCore.Components.WebAssembly
Microsoft.AspNetCore.Components.WebAssembly.Server

0 comments on commit d5185b3

Please sign in to comment.