Skip to content

Conversation

@matt-goldman
Copy link
Owner

This release is a comprehensive update and includes some breaking changes. As mentioned previously, the minimum version will increase to .NET 10 in keeping with .NET LTS releases. Additionally two breaking changes are included:

  1. The library is getting renamed to Plugin.Maui.SmartNavigation. This is for a few reasons: it is aligned with plugin naming in the .NET MAUI ecosystem, and is more aligned with what the library actually does, providing better clarity and discoverability for users.
  2. The source generator is now opt-in rather than opt-out. This was probably a design decision that should have been taken earlier, but as this is a major version update, it's a good time to introduce breaking changes.

Aside from that, there are QoL improvements, both to the code and to the library from a consumer perspective.

  • Adds modular, type safe routing with a new Route record type
  • Includes a custom DI friendly INavigationManager service (but you can still do it yourself as in previous versions)
  • Adds async ViewModel initialization and base pages and ViewModels (completely optional)
  • Additional analysers to help enforce strong navigation

- Removed the Resolver and StartupExtensions classes from the Maui.Plugins.PageResolver namespace and integrated them into the Plugin.Maui.SmartNavigation namespace.
- Introduced new attributes: IgnoreAttribute, NoAutoDependenciesAttribute, SingletonAttribute, and TransientAttribute for better dependency management.
- Implemented MopupExtensions for enhanced popup navigation capabilities.
- Added source generators for automatic dependency registration and view model mapping.
- Created MarkupExtensions for resolving view models directly in XAML.
- Enhanced NavigationExtensions to support both parameterless and parameterized navigation.
- Established a new project structure with appropriate project files and dependencies.
- Updated Directory.Build.props and Directory.Packages.props for centralized package management.
Updated `Plugin.Maui.SmartNavigation.MopupsExtensions.csproj` to:
- Conditionally include `Plugin.Maui.SmartNavigation` package in `Release`.
- Add `ProjectReference` to `Plugin.Maui.SmartNavigation.csproj` in `Debug`.
- Add `PackageReference` for `Microsoft.Maui.Controls`.

Updated `Plugin.Maui.SmartNavigation.csproj` to:
- Add `PackageReference` for `Microsoft.Maui.Controls` to ensure explicit dependency.
Refactored the `AutoDependencies` source generator to use `IIncrementalGenerator` for improved performance and modern Roslyn practices. Introduced `UseAutoDependenciesAttribute` to replace `NoAutoDependenciesAttribute` for marking classes for auto-dependency registration. Updated `MauiProgram` to use the new attribute.

Replaced the `_dependencies` field with a local `dependencies` dictionary, improving code clarity and reducing reliance on class-level state. Enhanced error handling and logging for better diagnostics. Updated source generation logic to use the new `dependencies` dictionary, supporting automatic registration of pages, view models, and services with appropriate lifetimes (`Singleton` or `Transient`).

Removed redundant code, including `NoAutoDependenciesAttribute` and the old `Initialize` method. Improved attribute handling with null-safe checks and replaced hardcoded strings with robust logic. General code cleanup for better readability and maintainability.
The `Plugin.Maui.SmartNavigation` package version was downgraded from `2.5.4` to `0.0.1-preview1` in the `Directory.Packages.props` file. This change transitions the project to a preview version, possibly for testing or compatibility purposes.
- Enforced block-scoped namespaces in `.editorconfig`.
- Added `LangVersion` preview for partial properties in `DemoProject.csproj`.
- Refactored `BaseViewModel` and derived view models:
  - Introduced `partial` classes and nullable auto-properties.
  - Replaced `ICommand` with `[RelayCommand]` attributes.
- Updated namespaces for consistency (`Plugin.Maui.SmartNavigation.Extensions`).
- Added `INavigationManager` interface and `NavigationManager` class.
- Refactored `Resolver` to use private fields and improve null safety.
- Reformatted `Plugin.Maui.SmartNavigation.csproj` and added `SourceGenerators` DLL.
- Updated solution structure in `Plugin.Maui.SmartNavigation.slnx`.
@matt-goldman matt-goldman added this to the .NET 10 milestone Nov 1, 2025
- Added `.vscode/settings.json` to `.gitignore` to exclude VS Code settings from version control.
- Marked Issue #3 as completed in `net10-milestone.md` and updated its priority, estimate, and sprint plan.
- Removed `SmartBackAsync` and `wrapInNav` parameter from `PushModalAsync` to simplify the API.
- Added XML documentation to `INavigationManager.cs` for improved clarity.
- Implemented priority-based navigation in `GoBackAsync` and enhanced exception handling in `GoToAsync`.
- Streamlined the navigation API to align with project goals of simplicity, testability, and framework-agnostic design.
- Improved code readability and maintainability across the navigation manager.
Removed `IRouteRegistry` interface, simplifying route management.
Added `RouteKind` enum to categorize navigation routes.
Enhanced `Route` record with improved `Build` methods:
- Supports query strings and dictionary-based parameters.
- Constructs URLs with optional query parameters.
Added XML documentation for improved code clarity.
Shifted to a more self-contained and extensible routing design.
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.

2 participants