Skip to content

Releases: freeletics/khonshu

0.25.0

17 May 07:24
03910e2
Compare
Choose a tag to compare

Navigation

  • Internal improvements on how the back stack is managed.

Codegen

  • Remove the need to do a lookup for the current destination on the back stack.
  • Improve reliability of finding the parent scope on the back stack.

0.24.0

14 May 08:04
f21e096
Compare
Choose a tag to compare

Navigation

  • The destinationChangedCallback parameter of NavHost now has (NavRoot, BaseRoute) -> Unit
    signature, where NavRoot is the current root. If that root is the current destination both
    parameters are the same.
  • Khonshu's own navigation implementation has been moved from navigation-experimental
    into the main navigation artifact.
  • Removed navigation-compose artifact that was based on androidx.navigation.

Codegen

  • The generated component for @NavHostActivity now contains the Activity's Intent instead of
    a Bundle.
  • Removed experimentalNavigation option and @UseExperimentalNavigation. The generated
    code will now always use Khonshu's built-in navigation instead of androidx.navigation.
  • Updated Anvil to v2.5.0-beta09.

0.23.1

08 Mar 12:54
e95cfe3
Compare
Choose a tag to compare

Navigation

  • Fix an issue where SaveableStateHolder would not be properly cleared when the destination
    is removed from the back stack after configuration changes. Thanks to @hoc081098 for the contribution.

Codegen

  • Add remember for the set of destinations, deep link handlers and deep link prefixes obtained
    from the generated component, to avoid creating a new NavigationExecutor on re-compositions.
  • Remove Experimental prefix from generated code when experimentalNavigation is `true.

0.23.0

01 Mar 11:12
19eef64
Compare
Choose a tag to compare
  • Update Compose to 1.6.0

Codegen

  • Update to Anvil 2.5.0-beta03 and use new GeneratedFileWithSources to support incremental
    compilation.
  • When setting experimentalNavigation in @NavHostActivity to true the generated code
    will contain both the setup for androidx.navigation and experimental navigation. This allows
    switching between them at runtime. For this it's required to provide a boolean to the
    NavHostActivity.scope that uses @UseExperimentalNavigation as qualifier.

StateMachine

  • Add wasmJs target.

0.22.2

19 Feb 09:35
279f5be
Compare
Choose a tag to compare

Codegen

  • Fix crash in StateMachine collection when lifecycle changes around the same time as the
    emission of a new state.

0.22.1

16 Feb 12:19
e6c159f
Compare
Choose a tag to compare

Codegen

  • Update StateMachine collection to start immediately when the generated composable is
    added to the composition. Previously this only happened in onResume for the NavBackStackEntry
    that the composable is tied too which caused a visible delay in the content being shown.
    Whenever the lifecycle is paused afterwards the collection is stopped until the next
    resume.

0.22.0

02 Feb 09:13
e99c374
Compare
Choose a tag to compare

Navigation

  • Breaking: NavDestination, ScreenDestination, OverlayDestination, ActivityDestination
    and NavigationSetup have been moved to the com.freeletics.khonshu.navigation package inside
    navigation. Previously these were duplicated between navigation-compose and navigation-experimental.
  • Breaking: Moved navigation-compose NavHost to com.freeletics.khonshu.navigation.androidx and
    navigation-experimental NavHost to com.freeletics.khonshu.navigation. This now allows to use
    the AndroidX based and the experimental navigation implementation in the same app and switch between
    them with a feature flag.
  • New: Added replaceAll to NavEventNavigator to replace the current back stack
    including the start destination with the given NavRoot. Thanks to @hoc081098 for the contribution.
  • Removed: Deprecated overload of NavHost that allowed using NavRoute as start destination.
  • Removed: navigation-fragment and Fragment navigation support.
  • Removed: navigation-androidx has been inlined into navigation-compose.

Codegen

  • Breaking: The NavDestination and NavHostActivity annotations as well as SimpleNavHost
    have been moved to com.freeletics.khonshu.codegen.
  • Added: NavHostActivity has an experimentalNavigation boolean to generate code
    with a navigation-experimental NavHost.
  • Added: ActivityScope and custom Activity scopes can now be used as parentScope for
    destinations.
  • Reduce the number of re-compositions in the generated code by remembering the
    sendAction lambda.
  • Generated code for NavHostActivity is now using NavHostTransitionAnimations.noAnimations().
  • Removed: @ComposeFragmentDestination and Fragment codegen support.

0.21.0

07 Dec 17:10
09d741c
Compare
Choose a tag to compare
  • Note: Fragment navigation and codegen have been deprecated and will be
    removed in the next release.
  • Updated Kotlin to 1.9.21.

Navigation

  • Breaking: navigateBackTo<...>(...) is now an extension method and might need
    to be explicitly imported.
  • Breaking: The Set parameters of NavHost have been replaced with ImmutableSet
    to allow the compose compiler to recognize these as immutable.
  • Breaking: Removed navController parameter from HavHost. Passing a manually
    created NavHostController introduced issues like breaking deep link handling.
  • New: NavHost (both the AndroidX and the experimental variant) now supports
    optionally passing a NavEventNavigator. This can be used instead of
    navController to navigate from outside the NavHost (e.g. for bottom navigation).
    The NavHost takes care of calling NavigationSetup for the passed navigator.
  • New: NavHost from navigation-experimental now also supports passing a
    Modifier to it.
  • New: The AndroidX NavHost will internally call Navigation.setViewNavController
    on the container View. This exists primarily for an easier migration from Fragment
    navigation to Compose navigation.

Codegen

  • New: The NavHostActivity codegen now supports passing a Modifier to NavHost.
  • New: The NavHostActivity codegen automatically provides an ImmutableSet for
    destinations, deep link handlers and deep link prefixes.

0.20.0

17 Nov 09:57
3d07822
Compare
Choose a tag to compare

Navigation

  • New Add Modifier parameter to NavHost Composable.
  • New Add NavHost overloaded function that accepts NavRoute instead of NavRoot
  • New Add optional transitionAnimations parameter to NavHost Composable functions. Animations
    can be overriden with NavHostDefaults.transitionAnimations or disabled with
    NavHostTransitionAnimations.noAnimations. Default animations are the same as default animations
    in AndroidX's NavHost.

0.19.0

09 Nov 12:54
d557847
Compare
Choose a tag to compare

Navigation

  • New: Allow passing an already created NavController to NavHost. This allows controlling
    the navigation from outside the host, for example from a bottom bavigation or navigation drawer.
  • Fixed: A crash that happened in NavHost on re-compositions.
  • Improved how nav events are collected internally.

Thanks to @hoc081098 and @hoangchungk53qx1 for the contributions.

Codegen

  • New: Added an Overlay marker interface that can be added to routes to indicate
    to the code generation that this should use an OverlayDestination (DialogDestination for
    Fragments).
  • Breaking: Removed destinationType in favor of the new interface.
  • Breaking: Removed support for @RendererDestination.