Skip to content

Releases: raamcosta/compose-destinations

2.1.0-beta12

11 Sep 08:38
c731ff9
Compare
Choose a tag to compare
2.1.0-beta12 Pre-release
Pre-release

Changes

  • Update dependencies to Compose 1.7 and Compose Navigation 2.8 by @extmkv in #680

Full Changelog: 2.1.0-beta11...2.1.0-beta12

1.11.6

11 Sep 08:36
52399eb
Compare
Choose a tag to compare

Changes

  • Update dependencies to Compose 1.7 and Compose Navigation 2.8. With this, we depend on stable versions only.

Full Changelog: 1.11.5-beta...1.11.6

2.1.0-beta11

25 Jul 11:45
bde0293
Compare
Choose a tag to compare
2.1.0-beta11 Pre-release
Pre-release

Changes

Full Changelog: 2.1.0-beta10...2.1.0-beta11

2.0.0-beta11

25 Jul 11:41
3d9764d
Compare
Choose a tag to compare

2.1.0-beta10

21 Jul 01:21
d19a66a
Compare
Choose a tag to compare
2.1.0-beta10 Pre-release
Pre-release

Changes

  • DestinationsNavHost start destination can now also have mandatory navigation arguments! 🙌
    • ⚠️ Small breaking change, rename startRoute to start, for more, read below 👇
  • Result back feature now supports all types that normal navigation supports! 🚀
  • Dependencies update - (navigation now used is 2.8.0-beta05)
  • New debug mode
  • Fixes #653
  • Fixes #661 (related with NavHost now accepting initial nav arguments)
  • Small improvements

DestinationsNavHost start destination can now also have mandatory navigation arguments! 🙌

If you were passing a startRoute parameter when calling DestinationsNavHost, you'll now need to update it to just start and the parameter type is now a Direction (same type navigate method receives). So you can pass arguments here, like:

DestinationsNavHost(
    start = MyStartDestination(someArgs),
    // ....
)

Besides, in order for Compose Destinations to be sure you won't get a runtime exception, if your start route has mandatory arguments, then you'll need to either make them non mandatory (by adding defaults to them or making them null), or if you don't want to do that (let's say that Destination is also navigated to in a lot of other places, and the defaults in those cases are not ideal), you can:

@NavHostDefaultStartArgs<RootGraph> // for a RootGraph which has a ...
val defaultRootStartArgs = GreetingScreenNavArgs( //  ...`GreetingScreen` has its start destination, with `GreetingScreenNavArgs`
    strArgument = "oneArgument",
    idArgument = 0
)

These arguments will be automatically "sent" to GreetingScreenDestination (taking the above example) when the NavHost is first called!

Result back feature now supports all types that normal navigation supports! 🚀

Previously, only these result types were allowed:

  • String, Boolean, Float, Int, Long, Serializable, or Parcelable.
  • Type cannot have type arguments itself (f.e you can't use Array even though it is Serializable)

Now it allows all of these (same as normal navigation):

For Boolean, Int, Float, Long, you'll need to use BooleanArray, IntArray, FloatArray, LongArray instead of Array, Array, Array, Array.

⚠️ If you were manually calling a Composable Destination which receives either a ResultBackNavigator or a ResultRecipient you will need to update those calls to pass in a DestinationsNavType corresponding to your result type.
You can check the corresponding generated Destination and see how it calls your Composable, and do the same, or you can just start typing your result class type name (lower case) and IDE will help you.

For example, if your Destination receives a:

  • ResultBackNavigator<Boolean> you'll want to pass in resultBackNavigator(booleanNavType) (booleanNavType is a top level field you can import from core library)
  • ResultBackNavigator<MyParcelableClass> you'll pass resultBackNavigator(myParcelableClassNavType) (myParcelableClassNavType is a top level field you can import from generated code).

If not calling it manually, then generated code will do this for you, so no need to change anything in that case.

New debug mode

This is mainly to help me understand users' setup when there's a reported issue so that I can find the root cause and fix it quicker.
New ksp configuration added:

ksp {
    arg("compose-destinations.debugMode", "$rootDir")
}

When set, it will write some debug files to a folder on $rootDir/composeDestinationsDebug (taking above example).
Please make sure to:

  • add this configuration for all modules that use compose destinations ksp
  • do ./gradle clean and delete previous debug folder
  • run the app or build the project
  • share the files with me somehow (ex: through the github issue, DM on Kotlin slack, etc).
  • remove the configuration and delete the debug folder
    DO NOT leave the configuration ON as it may slow down builds for no reason, just remove it after sending me the files.

Full Changelog: 2.1.0-beta09...2.1.0-beta10

2.0.0-beta10

21 Jul 01:05
adba1d4
Compare
Choose a tag to compare
2.0.0-beta10 Pre-release
Pre-release

Changes

  • Result back feature now supports all types that normal navigation supports! 🚀
  • New debug mode
  • Small improvements

Result back feature now supports all types that normal navigation supports! 🚀

Previously, only these result types were allowed:

  • String, Boolean, Float, Int, Long, Serializable, or Parcelable.
  • Type cannot have type arguments itself (f.e you can't use Array even though it is Serializable)

Now it allows all of these (same as normal navigation):

For Boolean, Int, Float, Long, you'll need to use BooleanArray, IntArray, FloatArray, LongArray instead of Array, Array, Array, Array.

⚠️ If you were manually calling a Composable Destination which receives either a ResultBackNavigator or a ResultRecipient you will need to update those calls to pass in a DestinationsNavType corresponding to your result type.
You can check the corresponding generated Destination and see how it calls your Composable, and do the same, or you can just start typing your result class type name (lower case) and IDE will help you.

For example, if your Destination receives a:

  • ResultBackNavigator<Boolean> you'll want to pass in resultBackNavigator(booleanNavType) (booleanNavType is a top level field you can import from core library)
  • ResultBackNavigator<MyParcelableClass> you'll pass resultBackNavigator(myParcelableClassNavType) (myParcelableClassNavType is a top level field you can import from generated code).

If not calling it manually, then generated code will do this for you, so no need to change anything in that case.

New debug mode

This is mainly to help me understand users' setup when there's a reported issue so that I can find the root cause and fix it quicker.
New ksp configuration added:

ksp {
    arg("compose-destinations.debugMode", "$rootDir")
}

When set, it will write some debug files to a folder on $rootDir/composeDestinationsDebug (taking above example).
Please make sure to:

  • add this configuration for all modules that use compose destinations ksp
  • do ./gradle clean and delete previous debug folder
  • run the app or build the project
  • share the files with me somehow (ex: through the github issue, DM on Kotlin slack, etc).
  • remove the configuration and delete the debug folder
    DO NOT leave the configuration ON as it may slow down builds for no reason, just remove it after sending me the files.

Full Changelog: 2.0.0-beta09...2.0.0-beta10

1.11.5-beta

21 Jul 00:38
38fded8
Compare
Choose a tag to compare
1.11.5-beta Pre-release
Pre-release

Changes

  • Dependency updates
  • Small issue fixes

Full Changelog: 1.11.4-alpha...1.11.5-beta

2.1.0-beta09

31 May 13:41
343bd18
Compare
Choose a tag to compare
2.1.0-beta09 Pre-release
Pre-release

Changes

  • Fixes #648
  • Fixes issue with module name being prefixed on the NavGraphs module object fields.

Full Changelog: 2.1.0-beta08...2.1.0-beta09

2.0.0-beta09

31 May 13:41
734a75a
Compare
Choose a tag to compare
2.0.0-beta09 Pre-release
Pre-release

Changes

  • Fixes #648
  • Fixes issue with module name being prefixed on the NavGraphs module object fields.

Full Changelog: 2.0.0-beta08...2.0.0-beta09

2.1.0-beta08

29 May 22:26
dca44f5
Compare
Choose a tag to compare
2.1.0-beta08 Pre-release
Pre-release

Changes

  • Fixes #638 by @extmkv in #641
  • Module names will now prefix all routes when set
    • Should help avoid duplicate routes on bigger projects

Full Changelog: 2.1.0-beta07...2.1.0-beta08