Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"rollForward": false
},
"fable": {
"version": "4.25.0",
"version": "5.0.0-rc.7",
"commands": [
"fable"
],
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### 4.13.0

* CI: Upgrade Fable from 4.25.0 to 5.0.0-rc.7 and .NET SDK from 8.0.19 to 10.0.100 to fix a CI hang where the Fable build step ran for 6+ hours with .NET 10. Fable 5 + .NET 10 compiles in ~20 seconds.
* CI: Conditionally disable SourceLink for Fable builds to fix a compilation error where AssemblyInfo.fs was being embedded by SourceLink and passed to the Fable compiler.
* Tests: Update 4 Fable tests that used `rejects.toThrow()` to use `Async.Catch` with a `Choice2Of2` pattern match instead, since Fable 5's `failwith` throws a custom `Exception` type that is not a JavaScript `Error` instance.
* Added `AsyncSeq.ofList` — creates an async sequence from an F# list with an optimised direct-enumerator implementation (avoids `IEnumerator<T>` boxing).
* Added `AsyncSeq.ofArray` — creates an async sequence from an array with an optimised index-based enumerator (avoids `IEnumerator<T>` boxing).
* Added `AsyncSeq.cycle` — infinitely cycles through all elements of a source async sequence; returns empty if the source is empty.
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.19",
"version": "10.0.100",
"rollForward": "minor"
}
}
2 changes: 1 addition & 1 deletion src/FSharp.Control.AsyncSeq/FSharp.Control.AsyncSeq.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableSourceLink>true</EnableSourceLink>
<EnableSourceLink Condition="'$(FABLE_COMPILER)' != 'True'">true</EnableSourceLink>
</PropertyGroup>
<ItemGroup>
<Compile Include="AsyncSeq.fsi" />
Expand Down
15 changes: 10 additions & 5 deletions tests/fable/FSharp.Control.AsyncSeq.Tests/AsyncSeq.test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ Jest.describe("AsyncSeq.interleave", fun () ->
return! AsyncSeq.interleave s1 s2 |> AsyncSeq.toArrayAsync
}

do! Jest.expect(f |> Async.StartAsPromise).rejects.toThrow()
let! result = f |> Async.Catch
Jest.expect(result |> (function Choice2Of2 _ -> true | _ -> false)).toBe(true)
})
)

Expand Down Expand Up @@ -481,11 +482,13 @@ Jest.describe("AsyncSeq.try", fun () ->

Jest.expect(x.Value).toBe(0)

do! Jest.expect(s |> AsyncSeq.toListAsync |> Async.StartAsPromise).rejects.toThrow()
let! result1 = s |> AsyncSeq.toListAsync |> Async.Catch
Jest.expect(result1 |> (function Choice2Of2 _ -> true | _ -> false)).toBe(true)

Jest.expect(x.Value).toBe(3)

do! Jest.expect(s |> AsyncSeq.toListAsync |> Async.StartAsPromise).rejects.toThrow()
let! result2 = s |> AsyncSeq.toListAsync |> Async.Catch
Jest.expect(result2 |> (function Choice2Of2 _ -> true | _ -> false)).toBe(true)

Jest.expect(x.Value).toBe(6)
})
Expand Down Expand Up @@ -991,15 +994,17 @@ Jest.describe("AsyncSeq.ofObservableBuffered", fun () ->
let src, discarded = observe [] true
let actual = src |> AsyncSeq.ofObservableBuffered |> AsyncSeq.toArrayAsync

do! Jest.expect(actual |> Async.StartAsPromise).rejects.toThrow()
let! result = actual |> Async.Catch
Jest.expect(result |> (function Choice2Of2 _ -> true | _ -> false)).toBe(true)
Jest.expect(discarded()).toBe(true)
})

Jest.test("AsyncSeq.ofObservableBuffered should work (one, fail)", async {
let src, discarded = observe [1] true
let actual = src |> AsyncSeq.ofObservableBuffered |> AsyncSeq.toArrayAsync

do! Jest.expect(actual |> Async.StartAsPromise).rejects.toThrow()
let! result = actual |> Async.Catch
Jest.expect(result |> (function Choice2Of2 _ -> true | _ -> false)).toBe(true)
Jest.expect(discarded()).toBe(true)
})

Expand Down
Loading