airbnb / airbnb/DeepLinkDispatch

Using intent provider instead of reflection to generate intent

Open
#206 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
4.4k
Forks
414
PR merge metrics
No merged PRs in 30d

Description

Reflection is currently used to generate the intent in `DeepLinkDelegate`.

```java
new DeepLinkEntry("http://example.com/deepLink/{id}/{name}/{place}", DeepLinkEntry.Type.METHOD, MainActivity.class, "intentForTaskStackBuilderMethods"),
```

Why not use a cache of IntentProvider?
```java
public interface IntentProvider {
Intent get(Context context);
}
```

`DeepLinkEntry` can then use provider instead of the method name.

Contributor guide

Open the contributing guide

Research direction

Start by reading the reflection path in DeepLinkDelegate and how DeepLinkEntry currently stores the target class and method name. Compare that flow with the proposed IntentProvider interface and determine the required API changes. Done means intent generation no longer depends on reflective method lookup while preserving the existing deep-link behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.