Skip to content

v0.2.0 — @AutoRegister only

Latest

Choose a tag to compare

@Alims-Repo Alims-Repo released this 09 Sep 10:28
· 1 commit to development since this release

NavEase 0.2.0 reduces the library to a single way of declaring a navigation graph — @AutoRegister — and fixes the defects found in what remains.

Breaking changes

Removed, along with everything that supported them:

  • @NavEaseScreen, @NavEaseArgs, @NavEaseResult and their route-string code generation
  • the navEaseGraph { } DSL — NavEaseGraph, NavEaseEntry, NavEaseGraphBuilder
  • the NavEaseHost(start) { add(Screen()) } manual-registration overload
  • NavEaseNavGraph, AppNavGraph and the NavScreen factory type
  • the whole runtime.presentation package of deprecated typealiases
  • NavEaseAutoRegistry.generatedClassHint and navEaseInit()

Migration. Annotate each screen with @AutoRegister, extend ActivityScreen<K> directly, and host with NavEaseHost<Root>(start = ...). Screens must now be constructible with no arguments — take dependencies inside Content() instead. If you imported LocalNavAnimatedContentScope from the internal package, switch to LocalNavEaseAnimatedContentScope in runtime.composition.

Fixes

Multi-module builds could not link. NavEaseHostOverloads.kt was written to a fixed name in the runtime's package, so two modules produced the same class. The file name now carries the module's generated package.

Keys with the same simple name across roots broke code generation. Generated code referenced keys and roots by simple name over flat imports, so two roots each declaring a Detail produced conflicting imports and a duplicate serializer object. Every reference is now fully qualified.

A stale generated overload failed silently. A call that missed it fell through to the runtime's generic host, which never bootstrapped the registry — so the app worked on Android and died on iOS. It now fails on every platform with a message naming the cause.

Deserialization. A missing element left a null that was cast to a non-null type, giving a ClassCastException with no field name; an unknown element threw. Missing elements are now named in the exception, and unknown ones are skipped, so removing a key parameter no longer breaks restore.

Keys under an intermediate sealed layer resolved to the wrong root, and their host reported no screens. Resolution now walks to the outermost NavEaseRoot ancestor.

Screens were shared between hosts. One instance per screen was constructed at bootstrap and shared by every host. Screens are now registered as factories and built per host.

Non-deterministic output. Generated files changed between builds because KSP returns symbols in an unspecified order. Entries are sorted.

Gradle plugin. No longer writes source files during configuration, which made it configuration-cache hostile. Applying it to a module with no screens no longer breaks the build. A failure to add the processor now fails the build instead of logging a warning and generating nothing. Module names are sanitised into legal package segments. addNavigation3Dependency, navigation3Dependency and forceNavigation3Version are gone — they were documented at length but their implementation was commented out.

Also

  • New build-time checks: a screen must be concrete and constructible with no arguments, and all duplicate keys are reported in one build.
  • 37 tests across the processor, the codegen, the registry and the plugin. The processor previously had none.
  • The vendored AndroidX Navigation 3 sources now carry their Apache-2.0 attribution, with a NOTICE naming the upstream project.
  • The public API dump was regenerated; it still described the pre-fork API and apiCheck was not catching it. CI now runs tests, apiCheck and a sample build on every push and pull request.
  • README and the documentation site rewritten around the single path, with new sections on multi-module layout and troubleshooting.

Known constraint

All screens for a given sealed root must live in one module: that root's host overload is generated by the module owning those screens. A root per feature module is the intended shape.