Releases: freeletics/khonshu
Releases · freeletics/khonshu
0.25.0
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
Navigation
- The
destinationChangedCallback
parameter ofNavHost
now has(NavRoot, BaseRoute) -> Unit
signature, whereNavRoot
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 mainnavigation
artifact. - Removed
navigation-compose
artifact that was based on androidx.navigation.
Codegen
- The generated component for
@NavHostActivity
now contains the Activity'sIntent
instead of
aBundle
. - 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
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 newNavigationExecutor
on re-compositions. - Remove
Experimental
prefix from generated code whenexperimentalNavigation
is `true.
0.23.0
- 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
totrue
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
Codegen
- Fix crash in
StateMachine
collection when lifecycle changes around the same time as the
emission of a new state.
0.22.1
Codegen
- Update
StateMachine
collection to start immediately when the generated composable is
added to the composition. Previously this only happened inonResume
for theNavBackStackEntry
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
Navigation
- Breaking:
NavDestination
,ScreenDestination
,OverlayDestination
,ActivityDestination
andNavigationSetup
have been moved to thecom.freeletics.khonshu.navigation
package inside
navigation
. Previously these were duplicated betweennavigation-compose
andnavigation-experimental
. - Breaking: Moved
navigation-compose
NavHost
tocom.freeletics.khonshu.navigation.androidx
and
navigation-experimental
NavHost
tocom.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
toNavEventNavigator
to replace the current back stack
including the start destination with the givenNavRoot
. Thanks to @hoc081098 for the contribution. - Removed: Deprecated overload of
NavHost
that allowed usingNavRoute
as start destination. - Removed:
navigation-fragment
andFragment
navigation support. - Removed:
navigation-androidx
has been inlined intonavigation-compose
.
Codegen
- Breaking: The
NavDestination
andNavHostActivity
annotations as well asSimpleNavHost
have been moved tocom.freeletics.khonshu.codegen
. - Added:
NavHostActivity
has anexperimentalNavigation
boolean to generate code
with anavigation-experimental
NavHost
. - Added:
ActivityScope
and customActivity
scopes can now be used asparentScope
for
destinations. - Reduce the number of re-compositions in the generated code by remembering the
sendAction
lambda. - Generated code for
NavHostActivity
is now usingNavHostTransitionAnimations.noAnimations()
. - Removed:
@ComposeFragmentDestination
andFragment
codegen support.
0.21.0
- 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 ofNavHost
have been replaced withImmutableSet
to allow the compose compiler to recognize these as immutable. - Breaking: Removed
navController
parameter fromHavHost
. Passing a manually
createdNavHostController
introduced issues like breaking deep link handling. - New:
NavHost
(both the AndroidX and the experimental variant) now supports
optionally passing aNavEventNavigator
. This can be used instead of
navController
to navigate from outside theNavHost
(e.g. for bottom navigation).
TheNavHost
takes care of callingNavigationSetup
for the passed navigator. - New:
NavHost
fromnavigation-experimental
now also supports passing a
Modifier to it. - New: The AndroidX
NavHost
will internally callNavigation.setViewNavController
on the containerView
. This exists primarily for an easier migration fromFragment
navigation to Compose navigation.
Codegen
- New: The
NavHostActivity
codegen now supports passing aModifier
toNavHost
. - New: The
NavHostActivity
codegen automatically provides anImmutableSet
for
destinations, deep link handlers and deep link prefixes.
0.20.0
Navigation
- New Add
Modifier
parameter toNavHost
Composable. - New Add
NavHost
overloaded function that acceptsNavRoute
instead ofNavRoot
- New Add optional
transitionAnimations
parameter toNavHost
Composable functions. Animations
can be overriden withNavHostDefaults.transitionAnimations
or disabled with
NavHostTransitionAnimations.noAnimations
. Default animations are the same as default animations
in AndroidX'sNavHost
.
0.19.0
Navigation
- New: Allow passing an already created
NavController
toNavHost
. 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 anOverlayDestination
(DialogDestination
for
Fragments). - Breaking: Removed
destinationType
in favor of the new interface. - Breaking: Removed support for
@RendererDestination
.