compose-destinations

Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate.

APACHE-2.0 License

Stars
3.1K

Bot releases are hidden (Show)

compose-destinations - 2.1.0-beta08 Latest Release

Published by raamcosta 5 months ago

Changes

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta07...2.1.0-beta08

compose-destinations - 2.0.0-beta08

Published by raamcosta 5 months ago

Changes

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

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-beta07...2.0.0-beta08

compose-destinations - 2.1.0-beta07

Published by raamcosta 5 months ago

Changes

  • Fixes #638 by @extmkv in https://github.com/raamcosta/compose-destinations/pull/640
  • Fixes #611
  • Improved wrong nav graph args configuration reporting
  • When generating docs to specific directories set with gradle ksp configs, it creates missing directories if any.
  • Added API for adding deep links at runtime (Fixes #639)

Example:

DestinationsNavHost(
    //...
) {
    MyDestination addDeepLink { uriPattern = "schema://${MyDestination.route}" }
}

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta06...2.1.0-beta07

compose-destinations - 2.0.0-beta07

Published by raamcosta 5 months ago

Changes

  • Fixes #638
  • Fixes #611
  • Improved wrong nav graph args configuration reporting
  • When generating docs to specific directories set with gradle ksp configs, it creates missing directories if any.
  • Added API for adding deep links at runtime (Fixes #639)

Example:

DestinationsNavHost(
    //...
) {
    MyDestination addDeepLink { uriPattern = "schema://${MyDestination.route}" }
}

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta06...2.0.0-beta07

compose-destinations - 2.1.0-beta06

Published by raamcosta 5 months ago

Changes

  • Dependency updates
  • Fixes #624
  • Fixes #638
  • Fixes #636

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-beta05...2.0.0-beta06

compose-destinations - 2.0.0-beta06

Published by raamcosta 5 months ago

Changes

  • Fixes #624
  • Fixes #638
  • Fixes #636

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-beta05...2.0.0-beta06

compose-destinations - 1.11.4-alpha

Published by raamcosta 6 months ago

  • Fixes issue with not importing AnimatedVisibilityScope with new shared transition elements ways of providing it.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/1.11.3-alpha...1.11.4-alpha

compose-destinations - 2.1.0-beta03

Published by raamcosta 6 months ago

  • Fixed #625
  • Fixes issue with not importing AnimatedVisibilityScope with new shared transition elements ways of providing it.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta02...2.1.0-beta03

compose-destinations - 2.1.0-beta02

Published by raamcosta 6 months ago

Breaking Changes 😱

  • Most of our NavController extension functions were removed. Instead, if you want to use the type safe Compose Destinations friendly APIs, you'll need to use DestinationsNavigator.
    There are two new APIs to get this navigator from NavController: (you can also just receive DestinationsNavigator on your annotated Composables)

    • If you are inside a Composable, use navController.rememberDestinationsNavigator()
    • If not, use navController.toDestinationsNavigator()

Keep in mind you can still use NavController directly by adding .route. For example: navController.navigate(Destination(args).route).

We were forced to do this since new navigation versions introduced a new member function of NavController class that would shadow our extension functions (i.e, users of the lib would start calling it silently instead of our extension functions - the result would be a runtime crash). By removing the APIs on our side, it forces users of Compose Destinations to go handle this change and avoid runtime issues that way.

  • Parameter onlyIfResumed removed from navigate APIs. (including navigating back with result).
    Users should replace it with the new APIs dropUnlessResumed:
onClick = dropUnlessResumed {
    navigator.navigate(SomeDestination)
}

// BEFORE

onClick = {
    navigator.navigate(SomeDestination, onlyIfResumed = true)
}

Here it was just a timing thing. Given that we were forced into other breaking changes, might as well do this too. It also made it easier to provide functions to get DestinationsNavigator (see above) since it no longer depends on the NavBackStackEntry.

Improvements

  • Changes to help send SharedTransitionScope and AnimatedVisibilityScope.

Here is the recommended way to implement shared transition elements with the library:

//...
    SharedTransitionLayout {
        DestinationsNavHost(
           //...
            dependenciesContainerBuilder = {
                dependency(this@SharedTransitionLayout) // provide SharedTransitionScope to screens that need it
            }
        )
    }

// On screens:

@Destination<MyGraph>//...
@Composable
fun SharedTransitionScope.MyScreen(
    animatedVisibilityScope: AnimatedVisibilityScope //no need to do anything, it will be provided
) {
    Box( // just an example ofc
         modifier = Modifier
            .sharedElement(
                state = rememberSharedContentState(key = "whatever id"),
                animatedVisibilityScope = animatedVisibilityScope
            )
    )
//....
}

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-beta01...2.1.0-beta02

compose-destinations - 1.11.3-alpha

Published by raamcosta 6 months ago

Breaking Changes 😱

  • Most of our NavController extension functions were removed. Instead, if you want to use the type safe Compose Destinations friendly APIs, you'll need to use DestinationsNavigator.
    There are two new APIs to get this navigator from NavController: (you can also just receive DestinationsNavigator on your annotated Composables)

    • If you are inside a Composable, use navController.rememberDestinationsNavigator()
    • If not, use navController.toDestinationsNavigator()

Keep in mind you can still use NavController directly by adding .route. For example: navController.navigate(Destination(args).route).

We were forced to do this since new navigation versions introduced a new member function of NavController class that would shadow our extension functions (i.e, users of the lib would start calling it silently instead of our extension functions - the result would be a runtime crash). By removing the APIs on our side, it forces users of Compose Destinations to go handle this change and avoid runtime issues that way.

  • Parameter onlyIfResumed removed from navigate APIs. (including navigating back with result).
    Users should replace it with the new APIs dropUnlessResumed:
onClick = dropUnlessResumed {
    navigator.navigate(SomeDestination)
}

// BEFORE

onClick = {
    navigator.navigate(SomeDestination, onlyIfResumed = true)
}

Here it was just a timing thing. Given that we were forced into other breaking changes, might as well do this too. It also made it easier to provide functions to get DestinationsNavigator (see above) since it no longer depends on the NavBackStackEntry.

Improvements

  • Changes to help send SharedTransitionScope and AnimatedVisibilityScope.

Here is the recommended way to implement shared transition elements with the library:

//...
    SharedTransitionLayout {
        DestinationsNavHost(
            dependenciesContainerBuilder = {
                dependency(this@SharedTransitionLayout) // provide SharedTransitionScope to screens that need it
            }
        )
    }

// On screens:

@Destination<MyGraph>//...
@Composable
fun SharedTransitionScope.MyScreen(
    animatedVisibilityScope: AnimatedVisibilityScope //no need to do anything, it will be provided
) {
    Box( // just an example ofc
         modifier = Modifier
            .sharedElement(
                state = rememberSharedContentState(key = "whatever id"),
                animatedVisibilityScope = animatedVisibilityScope
            )
    )
//....
}

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/1.11.2-alpha...1.11.3-alpha

compose-destinations - 2.1.0-beta01

Published by raamcosta 7 months ago

Changes

  • Fixed issue with nested classes as nav argument types
  • Small performance improvement
  • Generated mermaid graphs generated on default location no longer have clicks to another graph files (since we cannot easily know where those other files are in this case). If you define directories to generate these in (which is recommended), it will still work.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-alpha06...2.1.0-beta01

compose-destinations - 2.0.0-beta01

Published by raamcosta 7 months ago

Changes

  • Fixed issue with nested classes as nav argument types
  • Small performance improvement
  • Generated mermaid graphs generated on default location no longer have clicks to another graph files (since we cannot easily know where those other files are in this case). If you define directories to generate these in (which is recommended), it will still work.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-alpha07...2.0.0-beta01

compose-destinations - 1.11.2-alpha

Published by raamcosta 7 months ago

Changes

  • Dependency updates to 1.7 alpha04
  • No longer using Accompanist! Instead we're using the new material navigation for bottom sheet support!
  • Added sizeTransform to DestinationStyle.Animated to match the new official API

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/1.11.1-alpha...1.11.2-alpha

compose-destinations - 2.0.0-alpha07

Published by raamcosta 7 months ago

Changes

  • Fixed an issue specifically with 2.0.0 where nav graphs were not generated if they didn't contain destinations in the same module

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-alpha06...2.0.0-alpha07

compose-destinations - 2.1.0-alpha06

Published by raamcosta 7 months ago

compose-destinations - 2.0.0-alpha06

Published by raamcosta 7 months ago

compose-destinations - 2.1.0-alpha05

Published by raamcosta 7 months ago

Changes

  • Fixed an issue where the start destination of a NavHostGraph was not allowed non mandatory nav args. (Start destinations of nav graphs meant to be passed to NavHost cannot have mandatory args, but they can have non mandatory ones, but this wasn't working on v2).
  • Fixed an issue that was causing a lot of unneeded imports on generated NavGraphs.
  • Added JavaActivityDestination annotation to allow for navgraph setting on Java Activities.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-alpha03...2.1.0-alpha05

compose-destinations - 2.0.0-alpha05

Published by raamcosta 7 months ago

Changes

  • Fixed an issue where the start destination of a NavHostGraph was not allowed non mandatory nav args. (Start destinations of nav graphs meant to be passed to NavHost cannot have mandatory args, but they can have non mandatory ones, but this wasn't working on v2).
  • Fixed an issue that was causing a lot of unneeded imports on generated NavGraphs.
  • Added JavaActivityDestination annotation to allow for navgraph setting on Java Activities.

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-alpha03...2.0.0-alpha05

compose-destinations - 2.1.0-alpha03

Published by raamcosta 7 months ago

Changes

  • Added testing related TestDestinationsNavigator to bridge TestNavHostController into DestinationsNavigator
  • Fixes #597

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.1.0-alpha02...2.1.0-alpha03

compose-destinations - 2.0.0-alpha03

Published by raamcosta 7 months ago

Changes

  • Added testing related TestDestinationsNavigator to bridge TestNavHostController into DestinationsNavigator
  • Fixes #597

Full Changelog: https://github.com/raamcosta/compose-destinations/compare/2.0.0-alpharc02...2.0.0-alpha03

Package Rankings
Top 12.66% on Repo1.maven.org
Badges
Extracted from project README
Maven metadata URL License Apache 2.0 Android API kotlin
Related Projects