Skip to content

Commit dc803d2

Browse files
committed
feat(android): Improve SentryNavEffect by consolidating back stack route mapping (JAVA-274)
Commit improves the yet-to-be-released SentryNavEffect by replacing separate route name and argument extractors with a single BackStackEntryMapper. Doing so lets us spare users from having to create three giant `when` statements mapping all nav entries in their entire app (two for us and one for Nav3's entryProvider). After this commit, users only have to create two. (Future work will allow them to create just one via a forthcoming Sentry entryProvider wrapper.) Commit also uses the term "back stack entry" rather than "back stack route" throughout to avoid developer confusion, given Google's use of "route" to mean (essentially) a navigation destination. By contrast, we need a term that refers solely to an element in the host app's back stack. (In general, Nav3 is careful to distinguish between nav destinations and back stack entries, as a destination may be composed from multiple entries in a back stack.)
1 parent d0843a2 commit dc803d2

16 files changed

Lines changed: 1415 additions & 1256 deletions

‎sentry-android-navigation3/api/sentry-android-navigation3.api‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
public abstract interface class io/sentry/compose/navigation3/BackStackEntryMapper {
2+
public abstract fun map (Ljava/lang/Object;)Lio/sentry/compose/navigation3/SentryBackStackEntry;
3+
}
4+
15
public final class io/sentry/compose/navigation3/BuildConfig {
26
public static final field BUILD_TYPE Ljava/lang/String;
37
public static final field DEBUG Z
@@ -6,16 +10,19 @@ public final class io/sentry/compose/navigation3/BuildConfig {
610
public fun <init> ()V
711
}
812

9-
public abstract interface class io/sentry/compose/navigation3/RouteArgumentsExtractor {
10-
public abstract fun extract (Ljava/lang/Object;)Ljava/util/Map;
11-
}
12-
13-
public abstract interface class io/sentry/compose/navigation3/RouteNameExtractor {
14-
public abstract fun extract (Ljava/lang/Object;)Ljava/lang/String;
13+
public final class io/sentry/compose/navigation3/SentryBackStackEntry {
14+
public static final field $stable I
15+
public fun <init> (Ljava/lang/String;Ljava/util/Map;)V
16+
public synthetic fun <init> (Ljava/lang/String;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
17+
public fun equals (Ljava/lang/Object;)Z
18+
public final fun getArguments ()Ljava/util/Map;
19+
public final fun getName ()Ljava/lang/String;
20+
public fun hashCode ()I
21+
public fun toString ()Ljava/lang/String;
1522
}
1623

1724
public final class io/sentry/compose/navigation3/SentryNavEffectKt {
18-
public static final fun SentryNavEffect (Ljava/util/List;Lio/sentry/compose/navigation3/RouteNameExtractor;Lio/sentry/compose/navigation3/RouteArgumentsExtractor;Lio/sentry/compose/navigation3/SentryNavOptions;Landroidx/compose/runtime/Composer;II)V
25+
public static final fun SentryNavEffect (Ljava/util/List;Lio/sentry/compose/navigation3/BackStackEntryMapper;Lio/sentry/compose/navigation3/SentryNavOptions;Landroidx/compose/runtime/Composer;II)V
1926
}
2027

2128
public final class io/sentry/compose/navigation3/SentryNavOptions {

0 commit comments

Comments
 (0)