-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update LeakCanary to 2.10 #581
base: main
Are you sure you want to change the base?
Conversation
@@ -141,7 +141,7 @@ protected constructor( | |||
public open fun detachChild(childRouter: Router<*>) { | |||
val isChildRemoved = children.remove(childRouter) | |||
val interactor = childRouter.interactor | |||
ribRefWatcher.watchDeletedObject(interactor) | |||
ribRefWatcher.watchDeletedObject(interactor, "detached child router ${childRouter.javaClass.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made up a description. You might want something different. But it's nice to be able to provide context on what's causing this to be defined as something to be GCed.
@@ -31,24 +29,17 @@ public class SampleApplication extends Application implements HasActivityDelegat | |||
public void onCreate() { | |||
activityDelegate = new SampleActivityDelegate(); | |||
super.onCreate(); | |||
if (!LeakCanary.isInAnalyzerProcess(this)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the separate process deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's optional now. Most apps shouldn't need it as LeakCanary uses a lot less memory, and this complicates the setup.
public open fun watchDeletedObject(objectToWatch: Any?) { | ||
public open fun watchDeletedObject( | ||
objectToWatch: Any?, | ||
description: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be an optional param to avoid being a breaking API change for consumers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done by adding a deprecated overload without the param (that way it signifies clearly that the call should be updated)
objectToWatch: Any?, | ||
) { | ||
watchDeletedObject(objectToWatch, "missing description") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me know if this works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks
Also added the now required "description" parameter when watching instances. Fixes uber#580
Also, a couple of minor fixes: - A small warning on `RibActivity` against importing `android.R`. - Replaces deprecated `String.toLowerCase()` and `String.capitalize()` with the equivalent `String.lowercase()` and `String.replaceFirstChar(Char::titlecase)`.
This allows for a more repeatable, predictable build between different local configurations.
…_binder Deprecate old worker
- Define a dispatchers to be used on the now deprecated WorkerBinder/Worker within RibCoroutineConfig
uber#598 Fixing previous broken link https://eng.uber.com/new-rider-app with https://www.uber.com/blog/new-rider-app-architecture/
Allow overriding default CoroutineDispatcher for WorkerBinder calls
Update README.md
…RIBs into add_rib_monitoring
…tion Deprecate WorkerUnbinder
Expose ribActionEvents stream
…=all` Docs state that: > If you used the @JvmDefault annotation before, you can safely remove it and use one of the new modes. If you already used -Xjvm-default=enable, which generated only the default method implementations, you can now replace it with -Xjvm-default=all.
`List` is not really needed and we restrict the API unnecessarily: all we need is an `Iterable`. For keeping binary compatibility, we also keep the overloads taking in a `List`.
* Set view tree owners in RibActivity#onCreate * Cleanup duplicate setting of view tree owners * Add more assertions
…ibCoroutineWorker.kt Co-authored-by: Patrick Steiger <psteiger@gmail.com>
Add RibCoroutineWorker.bind that receives multiple workers
…cher_to_default Change default CoroutineContext from empty to default for the RibCoroutineWorker<>Worker conversion
…iver. `RibCoroutineWorker` is already a functional interface; the purpose of this builder is to allow consumers to create a `RibCoroutineWorker` with `CoroutineScope` in receiver position. E.g. - Functional interface: ``` RibCoroutineWorker { scope -> scope.launch { ... } } ``` - This factory method: ``` RibCoroutineWorker { launch { ... } } ```
Update coroutines 1.7.3
Also added the now required "description" parameter when watching instances. Fixes uber#580
Also added the now required "description" parameter when watching instances.
Before
After