FooIbar / EhViewer

EhViewer overhauled with Material Design 3 and more, forked from https://github.com/Ehviewer-Overhauled/Ehviewer
GNU General Public License v3.0
2.3k stars 89 forks source link

Update compose.destinations to v2.1.0-beta10 #1435

Closed renovate[bot] closed 2 months ago

renovate[bot] commented 2 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
io.github.raamcosta.compose-destinations:ksp 2.1.0-beta09 -> 2.1.0-beta10 age adoption passing confidence
io.github.raamcosta.compose-destinations:core 2.1.0-beta09 -> 2.1.0-beta10 age adoption passing confidence

Release Notes

raamcosta/compose-destinations (io.github.raamcosta.compose-destinations:ksp) ### [`v2.1.0-beta10`](https://togithub.com/raamcosta/compose-destinations/releases/tag/2.1.0-beta10) [Compare Source](https://togithub.com/raamcosta/compose-destinations/compare/2.1.0-beta09...2.1.0-beta10) ##### 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](https://togithub.com/raamcosta/compose-destinations/issues/653) - Fixes [#​661](https://togithub.com/raamcosta/compose-destinations/issues/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: ```kotlin 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: ```kotlin @​NavHostDefaultStartArgs // 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): - String - Boolean - Int - Long - Float - Parcelable - Serializable - Enums - [@​kotlinx.serialization.Serializable](https://togithub.com/Kotlin/kotlinx.serialization) annotated types - [Custom navigation types](https://composedestinations.rafaelcosta.xyz/destination-arguments/navigation-arguments/#custom-navigation-argument-types) (Types for which the user has defined a serialization to and from string) - Array and ArrayList of the above types > 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` you'll want to pass in `resultBackNavigator(booleanNavType)` (`booleanNavType` is a top level field you can import from core library) - `ResultBackNavigator` 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: ```kotlin ksp { arg("compose-destinations.debugMode", "$rootDir") } ``` When set, it will write some debug files to a folder on `$rootDir/composeDestinationsDebug` (taking above example). Then the idea is to share them with me somehow (ex: through the github issue). DO NOT leave it on as it may slow down builds for no reason, just remove it after sending me the files. **Full Changelog**: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta09...2.1.0-beta10

Configuration

πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• Ignore: Close this PR and you won't be reminded about these updates again.



This PR has been generated by Mend Renovate. View repository job log here.