Skip to content
Open
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
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ indent_style = space
[*.xml]
indent_size = 2

# YAML files
[*.yml]
# YAML, JSON, FsProj files
[*.yml,*.json,*.fsproj]
indent_size = 2
indent_style = space

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,6 @@ $RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

*.fs.js
*.fs.js.map
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strict-peer-dependencies=false
shamefully-hoist=true
79 changes: 71 additions & 8 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
This value should match the version in the props generated by paket
If they differ, this means we need to do a restore in order to ensure correct dependencies
-->
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
<PropertyGroup Condition="'$(PaketPropsVersion)' != '6.0.0' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
</PropertyGroup>

Expand Down Expand Up @@ -236,13 +236,16 @@
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
<CopyLocal Condition="'%(PaketReferencesFileLinesInfo.Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<CopyLocal Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 6">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<OmitContent Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 7">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])</OmitContent>
<ImportTargets Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 8">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])</ImportTargets>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.CopyLocal) == 'false' or %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.OmitContent) == 'true'">$(ExcludeAssets);contentFiles</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.ImportTargets) == 'false'">$(ExcludeAssets);build;buildMultitargeting;buildTransitive</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>
Expand Down Expand Up @@ -289,14 +292,16 @@
<PropertyGroup>
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
<UseMSBuild16_10_Pack>false</UseMSBuild16_10_Pack>
<UseMSBuild16_10_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' AND '@(MSBuildMinorVersion)' > '10' ">true</UseMSBuild16_10_Pack>
<UseMSBuild16_0_Pack>false</UseMSBuild16_0_Pack>
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' ">true</UseMSBuild16_0_Pack>
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' AND (! $(UseMSBuild16_10_Pack)) ">true</UseMSBuild16_0_Pack>
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8' ">true</UseMSBuild15_9_Pack>
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseMSBuild15_8_Pack>
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) AND (! $(UseMSBuild16_10_Pack)) ">true</UseMSBuild15_8_Pack>
<UseNuGet4_Pack>false</UseNuGet4_Pack>
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseNuGet4_Pack>
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) AND (! $(UseMSBuild16_10_Pack)) ">true</UseNuGet4_Pack>
<AdjustedNuspecOutputPath>$(PaketIntermediateOutputPath)\$(Configuration)</AdjustedNuspecOutputPath>
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(PaketIntermediateOutputPath)</AdjustedNuspecOutputPath>
</PropertyGroup>
Expand All @@ -314,6 +319,55 @@
</ConvertToAbsolutePath>

<!-- Call Pack -->
<PackTask Condition="$(UseMSBuild16_10_Pack)"
PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
PackageFilesToExclude="@(_PackageFilesToExclude)"
PackageVersion="$(PackageVersion)"
PackageId="$(PackageId)"
Title="$(Title)"
Authors="$(Authors)"
Description="$(Description)"
Copyright="$(Copyright)"
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
LicenseUrl="$(PackageLicenseUrl)"
ProjectUrl="$(PackageProjectUrl)"
IconUrl="$(PackageIconUrl)"
ReleaseNotes="$(PackageReleaseNotes)"
Tags="$(PackageTags)"
DevelopmentDependency="$(DevelopmentDependency)"
BuildOutputInPackage="@(_BuildOutputInPackage)"
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
SymbolPackageFormat="$(SymbolPackageFormat)"
TargetFrameworks="@(_TargetFrameworks)"
AssemblyName="$(AssemblyName)"
PackageOutputPath="$(PackageOutputAbsolutePath)"
IncludeSymbols="$(IncludeSymbols)"
IncludeSource="$(IncludeSource)"
PackageTypes="$(PackageType)"
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Serviceable="$(Serviceable)"
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
IncludeBuildOutput="$(IncludeBuildOutput)"
BuildOutputFolders="$(BuildOutputTargetFolder)"
ContentTargetFolders="$(ContentTargetFolders)"
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
NuspecFile="$(NuspecFileAbsolutePath)"
NuspecBasePath="$(NuspecBasePath)"
NuspecProperties="$(NuspecProperties)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
Readme="$(PackageReadmeFile)"
NoDefaultExcludes="$(NoDefaultExcludes)"/>

<PackTask Condition="$(UseMSBuild16_0_Pack)"
PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
Expand Down Expand Up @@ -343,6 +397,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand All @@ -359,7 +415,8 @@
NuspecProperties="$(NuspecProperties)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" />
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
NoDefaultExcludes="$(NoDefaultExcludes)" />

<PackTask Condition="$(UseMSBuild15_9_Pack)"
PackItem="$(PackProjectInputFile)"
Expand Down Expand Up @@ -390,6 +447,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down Expand Up @@ -433,6 +492,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down Expand Up @@ -475,6 +536,8 @@
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Expand Down
Binary file modified .paket/paket.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### 0.12.0-alpha.5 - Wednesday, February 15th, 2023
* Fix incorrect FableHub configuration in `AddSignalR` extension method: all the `OnConnected`, `OnDisconnected`, `Both` hubs have been registered as the `Both` hub specified in the wildcard-case in `Config` match.

### 0.12.0-alpha.4 - Saturday, January 21th, 2023
* Add `CancellationToken` to server-streaming functions (`StreamFrom`).
* Make `FableHubModule.Stream.Both.Both` constructor public (instead of internal) -- to fix the hub registration error in DI-container.

### 0.12.0-alpha.2 - Monday, January 9th, 2023
* Add .NET 6 support
* Ensure Fable 4 Theta-018 compatible
* Ensure Elmish 4 compatible
* Relax some dependency versions

### 0.11.5 - Tuesday, June 29th, 2021
* Update client side JSON serialization to remove warnings in Fable 3

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
environment:
CLI_VERSION: 5.0.301
image: Visual Studio 2019
image: Visual Studio 2022
init:
- git config --global core.autocrlf input
install:
Expand Down
18 changes: 11 additions & 7 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// FAKE build script
// --------------------------------------------------------------------------------------
#nowarn "0213"
#if FAKE
#r "paket: groupref FakeBuild //"
#endif
#load "./tools/FSharpLint.fs"
#load "./tools/Web.fs"
#load "./tools/Pnpm.fs"
#load "./.fake/build.fsx/intellisense.fsx"

open Fake.Core
Expand Down Expand Up @@ -163,6 +166,7 @@ Target.create "PrepDocs" ignore
// Restore tasks

let restoreSolution () =
DotNet.exec id "paket" "restore" |> ignore
solutionFile
|> DotNet.restore id

Expand All @@ -178,9 +182,8 @@ Target.create "YarnInstall" <| fun _ ->
Yarn.install setParams
else Yarn.install id

Target.create "RebuildSass" <| fun _ ->
Target.activateFinal "KillProcess"
TaskRunner.runWithRetries (fun () -> Npm.exec "rebuild node-sass" id) 5
Target.create "PnpmInstall" <| fun _ ->
Pnpm.install id

// --------------------------------------------------------------------------------------
// Build tasks
Expand Down Expand Up @@ -268,10 +271,12 @@ Target.create "PackageJson" <| fun _ ->
Json.setJsonPkg setValues

Target.create "Start" <| fun _ ->
Yarn.exec "start" id
//Yarn.exec "start" id
Pnpm.exec "start" (fun ps -> { ps with WorkingDirectory = __SOURCE_DIRECTORY__ })

Target.create "PublishPages" <| fun _ ->
Yarn.exec "publish-docs" id
//Yarn.exec "publish-docs" id
Pnpm.exec "publish-docs" id

// --------------------------------------------------------------------------------------
// Build and release NuGet targets
Expand Down Expand Up @@ -334,10 +339,9 @@ Target.create "CI" ignore
"Clean"
==> "Restore"
==> "PackageJson"
==> "YarnInstall"
==> "PnpmInstall" // ==> "YarnInstall"
==> "Lint"
==> "Build"
==> "RebuildSass"
==> "RunTests"

"All"
Expand Down
2 changes: 1 addition & 1 deletion demo/Client/Client.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion demo/Client/paket.references
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
group Fable
group FableDemo
Fable.Browser.Dom
Fable.Core
Fable.Promise
Fable.Remoting.Client
Feliz
Feliz.CompilerPlugins
Feliz.Plotly
FSharp.Core
Zanaptak.TypedCssClasses
1 change: 0 additions & 1 deletion demo/Server/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module App =
open Microsoft.Extensions.Logging
open Saturn
open System
open FSharp.Control.Tasks.V2

module Setup =
open SignalRApp.Auth
Expand Down
2 changes: 1 addition & 1 deletion demo/Server/Server.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions demo/Server/SignalR.fs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace SignalRApp

module SignalRHub =
open System.Threading
open Fable.SignalR
open FSharp.Control
open FSharp.Control.Tasks.V2
open SignalRHub

let update (msg: Action) =
Expand All @@ -20,7 +20,7 @@ module SignalRHub =

[<RequireQualifiedAccess>]
module Stream =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) (_: CancellationToken) =
match msg with
| StreamFrom.Action.AppleStocks ->
Stocks.appleStocks
Expand Down
3 changes: 1 addition & 2 deletions demo/Server/paket.references
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
group Net5
group Net6
Fable.Remoting.Giraffe
FSharp.Core
FSharp.Control.AsyncSeq
FSharp.Data
Microsoft.AspNetCore.Authentication.JwtBearer
Saturn
TaskBuilder.fs
2 changes: 1 addition & 1 deletion demo/Shared/Shared.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion demo/Shared/paket.references
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group NetCoreApp3
group Net6
FSharp.Core
3 changes: 3 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.11.6 - tbd
* Add .NET 6 support

### 0.11.5 - Tuesday, June 29th, 2021
* Update client side JSON serialization to remove warnings in Fable 3

Expand Down
6 changes: 3 additions & 3 deletions docs/signalr-server/aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ module Endpoints =

If you want to support streaming either from the client and/or the
server you need to define the behavior you want:
* Streaming from - A function that takes a streaming message (`StreamFrom.Action`)
and hub context that then returns an `IAsyncEnumerable<StreamFrom.Response>`.
* Streaming from - A function that takes a streaming message (`StreamFrom.Action`), hub context, a `CancellationToken` signalling the stream to stop, and then returns an `IAsyncEnumerable<StreamFrom.Response>`.
* Streaming to - A function that takes a `IAsyncEnumerable<StreamTo.Action>` and a hub context
and then (maybe) responds (with a `Response`).

Expand All @@ -160,6 +159,7 @@ module SignalRHub =
open FSharp.Control
open FSharp.Control.Tasks.V2
open SignalRHub
open System.Threading
open System.Collections.Generic

let update (msg: Action) =
Expand All @@ -176,7 +176,7 @@ module SignalRHub =

[<RequireQualifiedAccess>]
module Stream =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) (cancellationToken: CancellationToken) =
match msg with
| StreamFrom.Action.GenInts ->
asyncSeq {
Expand Down
6 changes: 3 additions & 3 deletions docs/signalr-server/saturn.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ module Endpoints =

If you want to support streaming either from the client and/or the
server you need to define the behavior you want:
* Streaming from - A function that takes a streaming message (`StreamFrom.Action`)
and hub context that then returns an `IAsyncEnumerable<StreamFrom.Response>`.
* Streaming from - A function that takes a streaming message (`StreamFrom.Action`), hub context, a `CancellationToken` signalling the stream to stop, and then returns an `IAsyncEnumerable<StreamFrom.Response>`.
* Streaming to - A function that takes a `IAsyncEnumerable<StreamTo.Action>` and a hub context
and then (maybe) responds (with a `Response`).

Expand All @@ -148,6 +147,7 @@ module SignalRHub =
open FSharp.Control
open FSharp.Control.Tasks.V2
open SignalRHub
open System.Threading
open System.Collections.Generic

let update (msg: Action) =
Expand All @@ -164,7 +164,7 @@ module SignalRHub =

[<RequireQualifiedAccess>]
module Stream =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) =
let sendToClient (msg: StreamFrom.Action) (hubContext: FableHub<Action,Response>) (cancellationToken: CancellationToken) =
match msg with
| StreamFrom.Action.GenInts ->
asyncSeq {
Expand Down
Loading