Skip to content

V1.0.0 Release#13

Merged
AngelMunoz merged 57 commits into
mainfrom
vnext
Jun 25, 2026
Merged

V1.0.0 Release#13
AngelMunoz merged 57 commits into
mainfrom
vnext

Conversation

@AngelMunoz

Copy link
Copy Markdown
Owner

This tracking PR is going to stay here as a placeholder while we finish up the v1 release. The RCs and previews will be produced from this branch until v1 is out

Significant refactoring and restructuring of `Router.fs`:
- Removed several types and modules, introduced `RouteDisposables` and `RouteInfo.RouteUnit`.
- Simplified navigation logic with a new `Navigable` module and `Router` class.
- Enhanced state management and navigation capabilities.

Introduced `IDisposableBag` interface and updated `RouteContext`:
- Added `disposables` field and `addDisposable` method to `RouteContext`.
- Introduced `NavigationError<'View>` type for navigation errors.
- Modified `NavigationState`, `RouteGuard<'View>`, and `GetView<'View>` types.
- Removed `children` field from `RouteDefinition<'View>` and `RouteTrack<'View>` type.
- Updated `GuardResponse` and `CacheStrategy` types.
Replaced `ValueTask` with `CancellableValueTask` from `IcedTasks` library across the codebase, including `RouteGuard` and `GetView` delegate types. Updated `navigate` function in `Navigable` module to accept a `token` parameter directly, removing `CancellableTaskResult.getCancellationToken()`. Adjusted `guard.Invoke` and `getContent.Invoke` calls to pass `token` directly. Reordered namespaces in `Router.fs` and `Router.fsi`, removed `Navs` namespace from `Router.fsi`, and added `System.Threading.Tasks` to `Types.fs`.
Updated Navs.Interop with additional open statements.
Modified Route's Define method to use cancellableValueTask.
Added CanActivate and CanDeactivate methods in Guard module.
Refactored Route module in DSL.fs with inline functions.
Removed child and children methods from Route type.
Updated DSL.fsi to reflect changes in DSL.fs.
Converted Route module's cache function to let/val binding.
Updated Navs.fsproj to target .NET 8.0 and 9.0 frameworks and use preview language version. Refactored `navigate` function in `Router.fs` to handle cancellation tokens more robustly, adding multiple checks and appropriate error handling. Introduced `IsNavigationCancelled` active pattern for handling navigation cancellation errors. Updated `Router` type to use `build` method for initialization, reflected in test cases and modules. Refactored `Navigate` method to handle cancellation tokens effectively and ensure state is set to `Idle` if navigation is canceled or fails. Updated `Routes` module in `DSL.fs` to use `GetView` with `ValueTask` for `getContent` function, adding cancellation tokens to test cases. Updated `NavigationState`, `RouteContext`, `Navigation`, `Guards`, and `Cancellation` modules to use `Router.build` method and handle cancellation tokens. Converted `canActivate` and `canDeactivate` functions to asynchronous versions. Updated `NavigateByName` method to check for cancellation before proceeding. Updated `open` statements in `Router.fs` and `DSL.fs` to include necessary namespaces.
- samples/CSharpToo: upgrade Avalonia packages to version 11.1.0
- samples/FuncUI: upgrade Avalonia and FuncUI packages to versions 11.1.0 and 1.5.1
- samples/Routerish: upgrade Avalonia and NXUI packages to version 11.1.0
- src/Navs.Avalonia: upgrade Avalonia package to version 11.1.0
- src/Navs.FuncUI: upgrade Avalonia and FuncUI packages to versions 11.1.0 and 1.5.1
- src/Navs: update FSharp.Data.Adaptive to version 1.2.24 and IcedTasks to version 0.11.8
feat(Routerish): add counter route with state management
- Updated `fantomas` version from `6.3.16` to `7.0.2` in `dotnet-tools.json`.
- Added `<Nullable>enable</Nullable>` in `Navs.fsproj`.
- Updated `FsToolkit.ErrorHandling` version from `4.18.0` to `5.0.0` in both `Navs.fsproj` and `UrlTemplates.fsproj`.
- Added optional ILogger parameter to AvaloniaRouter, FuncUIRouter, and TerminalGuiRouter constructors for logging capabilities.
- Included Microsoft.Extensions.Logging package in multiple project files.
- Introduced `ILogger` parameter to various functions in `Navs.Router`.
- Enhanced `navigate` function to log cache hits and route resolutions.
- Added logging for guard checks and navigation states.
- Updated `attemptRedirect` to log redirect stack and errors.
- Modified `Router.build` method to accept an optional logger.
- Introduced a new project for NxuiDeclarative with necessary configurations.
- Added a new launch configuration for debugging the NxuiDeclarative sample.
- Created a build task for the NxuiDeclarative project.
- Updated route handlers to explicitly return Control type for consistency.
- Adjusted "books" route definition for proper type casting.
- Ensured "guid" route handler returns Control type.
- Updated Route class to include new constructors for various handler types.
- Introduced SyncGuard and AsyncGuard types for route guard functionality.
- Refactored method signatures to improve type safety and clarity.
- Added documentation comments for better understanding of route functionalities.
- Added optional parameters for initialUri and noView in Routes.
- Updated navigateToFirstRoute to use initialUri for navigation.
- Improved documentation for Routes constructor.
- Introduced initial navigation logic in RouterOutlet with optional logger.
…#15)

* chore: move to central package management
upgrade version across all the projects surfaces

* chore: fix null warning

* chore: fix compilation issues

* fix compilation issues

* samples: upgrade samples to net10.0, Avalonia 12, Terminal.Gui 2.4, NXUI 12

- Bump sample TFMs from net9.0 to net10.0 to match source projects
- Upgrade Avalonia 11.x -> 12.0.5 and drop deprecated Avalonia.Diagnostics package
- Replace deprecated NXUI.FSharp with NXUI 12.0.0 (use NXUI.Extensions + PascalCase methods)
- Upgrade Terminal.Gui to 2.4.11 and drop direct System.Text.Json reference
- Bump CSharp.Data.Adaptive to 1.2.26 to align with FSharp.Data.Adaptive
- Fix FuncUI counter decrement button (was incrementing instead of decrementing)
- Convert Samples.sln to Samples.slnx
- Run fantomas across the repo

* fix: fix the shit ass edit from the llm
Comment thread src/Navs/Router.fs Outdated
Comment thread src/Navs/Router.fs Outdated
Comment thread samples/TGUI/Extensions.fs Outdated
Comment thread src/UrlTemplates/UrlTemplate.fs Outdated
Comment thread src/Navs/Router.fs Outdated
Comment thread .github/workflows/library.yml Outdated
Comment thread .github/workflows/samples.yml Outdated
Comment thread src/Navs.FuncUI/Library.fs Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Resolved Since Last Review
  • src/Navs/Router.fsmaxRedirectDepth renamed to maxCyclicRedirects; depth check now uses visited.Count (distinct redirect pairs) instead of redirectStack.Count (which was always 0 or 1 for linear chains), properly bounding redirect work
  • CHANGELOG.md — updated to reflect the renamed parameter and corrected semantics
  • src/Navs/Router.fsi — XML docs updated to explain maxCyclicRedirects behavior
Files Reviewed (3 files)
  • src/Navs/Router.fs
  • src/Navs/Router.fsi
  • CHANGELOG.md
Previous Review Summaries (3 snapshots, latest commit 7b2396e)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 7b2396e)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/Navs/Router.fs 334 maxRedirectDepth check is ineffective — redirectStack.Count is always 0 or 1 for linear chains, so the depth limit never triggers
Resolved Since Last Review
  • src/Navs/Router.fs — disposables now disposed after activation guards and content resolution pass
  • src/Navs/Router.fs — redirect cycle detection added via visited HashSet
  • src/Navs/Router.fsDictionary replaced with ConcurrentDictionary for thread-safe route cache
  • samples/TGUI/Extensions.fsthis.Title fixed to this.Text in Text cval extension
  • src/UrlTemplates/UrlTemplate.fs — "Requred" typo corrected to "Required"
  • src/Navs.FuncUI/Library.fs — exception now passed to LogError in error handler
  • docs/Navs/Adapters.md — duplicate Router.build call removed
Files Reviewed (7 files)
  • src/Navs/Router.fs - 1 issue
  • src/Navs/Router.fsi
  • src/Navs.FuncUI/Library.fs
  • samples/TGUI/Extensions.fs
  • src/UrlTemplates/UrlTemplate.fs
  • docs/Navs/Adapters.md
  • CHANGELOG.md

Fix these issues in Kilo Cloud

Previous review (commit c9ea8b6)

Status: 6 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 3
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
src/Navs/Router.fs 203 Disposables disposed before activation guards pass — if guards fail, active view's resources are already destroyed
src/Navs/Router.fs 328 No redirect cycle/depth protection in attemptRedirect — infinite loop possible with multi-node redirect cycles
samples/TGUI/Extensions.fs 132 Copy-paste bug: this.Title should be this.Text in Text cval extension

WARNING

File Line Issue
src/Navs/Router.fs 383 Thread-unsafe Dictionary for route cache — concurrent navigations can corrupt state
src/UrlTemplates/UrlTemplate.fs 159 Typo: "Requred" should be "Required" in error message
src/Navs.FuncUI/Library.fs 159 Exception discarded in error handler — not passed to LogError
Resolved Since Last Review
  • .github/workflows/library.yml — now correctly references Navs.slnx and uses .NET 10 SDK
  • .github/workflows/samples.yml — now correctly references Samples.slnx with net10.0 TFM
  • .github/workflows/docs.yml — now uses .NET 10 SDK and dotnet tool restore
Additional Notes
  • docs/Navs/Adapters.md lines 20-22 contain a duplicate Router.build call (leftover from refactor) that would confuse users.
  • Breaking API changes: RouteGuard signature changed from 3-arg function to 2-arg delegate; RouteDefinition.children removed (nested routing eliminated); #Control replaced with Control in Avalonia adapter.
Files Reviewed (57 files)
  • src/Navs/Router.fs - 3 issues
  • src/Navs/Types.fs
  • src/Navs/DSL.fs, src/Navs/DSL.fsi, src/Navs/DSL.Interop.fs, src/Navs/DSL.Interop.fsi
  • src/Navs/History.fs, src/Navs/History.fsi
  • src/Navs/Navs.fsproj
  • src/UrlTemplates/UrlTemplate.fs - 1 issue
  • src/UrlTemplates/RouteMatcher.fs, src/UrlTemplates/RouteMatcher.fsi
  • src/UrlTemplates/UrlParser.fs, src/UrlTemplates/UrlParser.fsi
  • src/UrlTemplates/Parsing.fs, src/UrlTemplates/Parsing.fsi
  • src/UrlTemplates/UrlTemplates.fsproj
  • src/Navs.Avalonia/Library.fs, src/Navs.Avalonia/Library.fsi, src/Navs.Avalonia/Navs.Avalonia.fsproj
  • src/Navs.FuncUI/Library.fs - 1 issue, src/Navs.FuncUI/Library.fsi, src/Navs.FuncUI/Navs.FuncUI.fsproj
  • src/Navs.Terminal.Gui/Library.fs, src/Navs.Terminal.Gui/Library.fsi, src/Navs.Terminal.Gui/Navs.Terminal.Gui.fsproj
  • src/Navs.Tests/DSL.fs, src/Navs.Tests/Main.fs, src/Navs.Tests/Router.fs, src/Navs.Tests/Navs.Tests.fsproj
  • src/UrlTemplates.Tests/Main.fs, src/UrlTemplates.Tests/RouteMatcher.fs, src/UrlTemplates.Tests/UrlTemplates.Tests.fsproj
  • samples/TGUI/Extensions.fs - 1 issue, samples/TGUI/Program.fs, samples/TGUI/TGUI.fsproj
  • samples/FuncUI/Program.fs, samples/FuncUI/FuncUI.fsproj
  • samples/CSharpToo/Program.cs, samples/CSharpToo/CSharpToo.csproj
  • samples/NxuiDeclarative/*, samples/Routerish/*
  • .github/workflows/library.yml, .github/workflows/samples.yml, .github/workflows/docs.yml, .github/workflows/release.yml
  • build.fsx, Navs.slnx, README.md, docs/*
  • src/Directory.Build.props, src/Directory.Packages.props
  • .config/dotnet-tools.json, .devcontainer/Dockerfile, .vscode/*

Fix these issues in Kilo Cloud

Previous review (commit fe0b96c)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 3
WARNING 5
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
src/Navs/Router.fs 203 Disposables disposed before activation guards pass — if guards fail, active view's resources are already destroyed
src/Navs/Router.fs 328 No redirect cycle/depth protection in attemptRedirect — infinite loop possible with multi-node redirect cycles
samples/TGUI/Extensions.fs 132 Copy-paste bug: this.Title should be this.Text in Text cval extension

WARNING

File Line Issue
src/Navs/Router.fs 383 Thread-unsafe Dictionary for route cache — concurrent navigations can corrupt state
src/UrlTemplates/UrlTemplate.fs 159 Typo: "Requred" should be "Required" in error message
.github/workflows/library.yml 28 CI references deleted Navs.sln — build will fail
.github/workflows/samples.yml 31 CI references deleted Samples.sln with wrong TFM (net9.0)
src/Navs.FuncUI/Library.fs 159 Exception discarded in error handler — not passed to LogError
Additional Notes (not inline-commented)
  • All three CI workflows (library.yml, samples.yml, docs.yml) install dotnet-version: 9.0.x but the project now targets net10.0 — the .NET 10 SDK is required to build those targets.
  • docs/Navs/Adapters.md lines 20-22 contain a duplicate Router.build call (leftover from refactor) that would confuse users.
  • Breaking API changes: RouteGuard signature changed from 3-arg function to 2-arg delegate; RouteDefinition.children removed (nested routing eliminated); #Control replaced with Control in Avalonia adapter.
Files Reviewed (57 files)
  • src/Navs/Router.fs - 3 issues
  • src/Navs/Types.fs
  • src/Navs/DSL.fs, src/Navs/DSL.fsi, src/Navs/DSL.Interop.fs, src/Navs/DSL.Interop.fsi
  • src/Navs/History.fs, src/Navs/History.fsi
  • src/Navs/Navs.fsproj
  • src/UrlTemplates/UrlTemplate.fs - 1 issue
  • src/UrlTemplates/RouteMatcher.fs, src/UrlTemplates/RouteMatcher.fsi
  • src/UrlTemplates/UrlParser.fs, src/UrlTemplates/UrlParser.fsi
  • src/UrlTemplates/Parsing.fs, src/UrlTemplates/Parsing.fsi
  • src/UrlTemplates/UrlTemplates.fsproj
  • src/Navs.Avalonia/Library.fs, src/Navs.Avalonia/Library.fsi, src/Navs.Avalonia/Navs.Avalonia.fsproj
  • src/Navs.FuncUI/Library.fs - 1 issue, src/Navs.FuncUI/Library.fsi, src/Navs.FuncUI/Navs.FuncUI.fsproj
  • src/Navs.Terminal.Gui/Library.fs, src/Navs.Terminal.Gui/Library.fsi, src/Navs.Terminal.Gui/Navs.Terminal.Gui.fsproj
  • src/Navs.Tests/DSL.fs, src/Navs.Tests/Main.fs, src/Navs.Tests/Router.fs, src/Navs.Tests/Navs.Tests.fsproj
  • src/UrlTemplates.Tests/Main.fs, src/UrlTemplates.Tests/RouteMatcher.fs, src/UrlTemplates.Tests/UrlTemplates.Tests.fsproj
  • samples/TGUI/Extensions.fs - 1 issue, samples/TGUI/Program.fs, samples/TGUI/TGUI.fsproj
  • samples/FuncUI/Program.fs, samples/FuncUI/FuncUI.fsproj
  • samples/CSharpToo/Program.cs, samples/CSharpToo/CSharpToo.csproj
  • samples/NxuiDeclarative/*, samples/Routerish/*
  • .github/workflows/library.yml - 1 issue, .github/workflows/samples.yml - 1 issue, .github/workflows/docs.yml
  • build.fsx, Navs.slnx, README.md, docs/*
  • src/Directory.Build.props, src/Directory.Packages.props
  • .config/dotnet-tools.json, .devcontainer/Dockerfile, .vscode/*

Fix these issues in Kilo Cloud


Reviewed by mimo-v2.5-pro · Input: 38K · Output: 5.7K · Cached: 232.4K

- add ionide keep a changelog
- add a release workflow
… protection, thread-safe cache

- Router.fs: dispose previous active route's resources only after activation
  guards and content resolution pass (was disposed before, leaving a broken
  view on failed navigations)
- Router.fs: protect redirect chains against cycles (visited-pair tracking)
  and unbounded depth; add optional maxRedirectDepth param to Router.build
  (default 5) forwarded to attemptRedirect
- Router.fs: use ConcurrentDictionary for the route cache so concurrent
  navigations can't corrupt state
- Navs.FuncUI/Library.fs: pass the caught exception to LogError instead of
  discarding it on initial-navigation failure
- TGUI/Extensions.fs: Text cval extension now reads/writes Text, not the
  copy-pasted Title
- UrlTemplates/UrlTemplate.fs: fix 'Requred' typo in error message
- docs/Navs/Adapters.md: remove duplicate Router.build call
- CHANGELOG.md: add Fixed section and maxRedirectDepth entry
Comment thread src/Navs/Router.fs Outdated
The parameter bounds the number of distinct redirect pairs followed, which
guards against redirect cycles (the actual infinite-loop risk). The previous
name implied linear chain capping, which is neither intended nor enforced -
linear chains terminate on their own. Bound the count via visited.Count
instead of the ineffective redirectStack.Count check, and document all
build parameters to clear FS3390 xmldoc warnings.
@AngelMunoz AngelMunoz merged commit cb8b821 into main Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant