591 Commits

Author SHA1 Message Date
psteiger 4282ac47f7 Add explicit visibility to Android libraries. 2024-10-14 06:43:21 -04:00
psteiger d2711d8e69 Prepare next development version 2024-07-19 15:26:40 -04:00
psteiger a7e9232597 Prepare for release 0.16.3 v0.16.3 2024-07-19 15:20:55 -04:00
Patrick Steiger df056a0ab5 Add test asserting Rx subscription is disposed after RibCoroutineWorker.asWorker() is unbound. 2024-07-08 17:26:52 -04:00
Ty Smith 5aafed43f9 Merge pull request #635 from RahulDMello/feature/increase_rib_event_buffer_size
Increase buffer capacity for mutableRouterEvents flow within RibEvents
2024-07-02 19:08:14 -07:00
Rahul DMello a7b33ad4ee Revert the version bump 2024-06-24 19:07:16 -04:00
Rahul DMello 19d6e1e658 Increase buffer capacity for mutableRouterEvents flow within RibEventsIncrease buffer capacity for mutableRouterEvents flow within RibEvents 2024-06-22 03:53:47 +00:00
Fran Aguilera ff46554421 Merge pull request #629 from psteiger/rrw-converters-fix
Support classes that are both `Worker` and `RibCoroutineWorker` in co…
2024-04-15 15:11:27 -07:00
Ty Smith 4cec42fcb8 Merge pull request #630 from mamykin-andrey/issues-499-fix-flipper-plugin-memory-leak
Fix Flipper Ribtree Plugin memory leak
2024-03-20 16:54:19 -07:00
Andrey Mamykin 11096f68c8 Store RouterInfo instead of Router for FlipperPayload 2023-12-13 18:59:17 +01:00
Patrick Steiger 3ca704ab57 Support classes that are both Worker and RibCoroutineWorker in converters.
`Worker.asRibCoroutineWorker` and `RibCoroutineWorker.asWorker` converters now return the instance unchanged if the class already implements the target interface.

This is important for correctness. For example:

```
class DualWorker : Worker, RibCoroutineWorker {
  fun onStart(lifecycle: WorkerScopeProvider) {
    doX()
  }

  suspend fun onStart(scope: CoroutineScope) {
    doY()
  }
}
```

Binding this `worker.asWorker()` should call `doX()`, not `doY()`, and binding this `worker.asRibCoroutineWorker()` should call `doY()`, not `doX()`.
2023-12-05 14:01:40 -03:00
Patrick Steiger 9b5cff6e97 Prepare next development version v0.16.2 2023-11-28 23:58:06 -03:00
Patrick Steiger 83f9c1c6f8 Prepare for release 0.16.2 2023-11-28 23:58:06 -03:00
Patrick Steiger 43db2962e6 [RibCoroutineWorker] In asWorker(), keep scope alive until lifecycle completion.
This fixes Rx subscriptions using `autoDispose(CoroutineScope)` immediately terminating.

In order to properly support `autoDispose(CoroutineScope)` subscriptions, we must keep the `CoroutineScope` received in `onStart` alive as long as the `WorkerScopeProvider` lifecycle.

`autoDispose` does *not* create a children coroutine: instead it installs a completion handler. Hence, outer scope will not have children to wait for completion and will terminate immediately.
2023-11-21 17:26:40 -03:00
Patrick Steiger cbd11f7927 Make suspend functions callable inside test(worker) { }
We don't need `crossinline` for `testBody`. Usage of cross-inline makes suspend functions non-callable in the test body, which forbids patterns like:
```
test(worker) {
  sharedFlow.emit(someValue)
  // assert worker processed it
}
```
2023-11-09 16:54:35 -03:00
James Barr 6847098360 Prepare next development version 2023-11-04 12:53:58 -07:00
James Barr c9b4c012ef Prepare for release 0.16.1 v0.16.1 2023-11-04 12:49:08 -07:00
Patrick Steiger 14d1822cff Prepare next development version 2023-11-03 23:43:19 -03:00
Patrick Steiger dfb2dc5176 Prepare for release 0.16.0 2023-11-03 23:43:19 -03:00
James Barr 69903fd0d8 Refactor internal methods to avoid duplicate JVM signature (#621)
* Rename internal method to avoid duplicate JVM signature
* Use core-annotated method approach instead of renaming
2023-10-31 11:42:21 -07:00
Patrick Steiger 73a5958831 Introduce TestScope.test(RibCoroutineWorker) test helper utility.
This helper utility is meant to be used in tests inside `runTest { }` blocks
and should facilitate `RibCoroutineWorker` testing by automatically binding
and unbinding the worker in the scope of the lambda.

```
@Test fun test() = runTest {
  test(worker) {
    // Worker is bound. Make assertions
  }
  // Worker is unbound.
}
```
v0.16.0
2023-10-06 15:10:49 -03:00
Patrick Steiger adc3b0df53 Get rid of suppressions for "invisible_reference" and "invisible_member"
For accessing internal declarations from other modules (e.g. access `rib-base` internals from `rib-test`), we are currently suppressing compiler errors with `@file:Suppress("invisible_reference", "invisible_member")`

A better approach is to:
1. Create an `internal` opt-in annotation.
2. Make the "accessible to friend modules" component `public`
3. Mark the (now public) component with the opt-in annotation.
4. Opt-in to the annotation from `build.gradle`.

Because the new annotation is `internal`, it cannot be normally accessed from external modules. But Gradle can see it if it's part of the source set.

This makes the internal visibility of those friend-modules APIs even stricter, since consumers now cannot just suppress `"invisible_reference"` and `"invisible_member"` to directly access the friend-module API. Plus, we get rid of the hacky suppressions in our codebase.
2023-09-21 21:20:42 -03:00
James Barr 0043217d35 Prepare next development version 2023-09-20 13:36:50 -04:00
James Barr bd3b063d23 Prepare for release 0.15.4 v0.15.4 2023-09-20 13:33:10 -04:00
James Barr 891865cfd3 Revert JVM version to 1.8 (#616)
* Revert JVM version to 1.8
* Add tools jar
2023-09-20 13:30:48 -04:00
James Barr 00753bba2e Set view tree owners in parent class (#615) 2023-09-11 18:24:38 -07:00
idanakav 1b2927b79f Merge pull request #613 from idanakav/plugin-0.1.5
IntelliJ plugin 0.1.5
2023-08-30 19:11:11 -07:00
idanakav 5896b25af1 Prepare for IntelliJ plugin 0.1.5 release 2023-08-29 21:33:59 -07:00
idanakav 9a7c0be9ad Update intellij dependencies
- Bump gradle IntelliJ plugin
- Build against 23.2
- Refactor deprecated methods which are scheduled for removal
2023-08-29 21:33:57 -07:00
idanakav 5d5e2cd4c3 Remove redundant invoke later call 2023-08-29 21:32:33 -07:00
tys be134db532 Prepare next development version 2023-08-28 14:28:10 +02:00
tys 374af8ac31 Prepare for release 0.15.3 v0.15.3 2023-08-28 14:22:21 +02:00
Patrick Steiger 85cf3b3c8a Bump kotlinx.coroutines.test to 1.7.3 2023-08-22 23:42:27 -03:00
Ty Smith f88e1fe1c6 Merge pull request #609 from uber/tys/coroutines-1.7
Update coroutines 1.7.3
2023-08-22 17:59:05 -07:00
Patrick Steiger 31f4984632 Add RibCoroutineWorker factory method with CoroutineScope as receiver.
`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 { ... }
}
```
2023-08-22 20:13:56 -03:00
tys fa39761edb Spotless 2023-08-22 15:07:08 -07:00
tys a6e2109c29 addressing feedback 2023-08-22 15:06:23 -07:00
tys 25b8aaf276 Setting worker dispatcher in test rule 2023-08-22 14:33:16 -07:00
tys 24e3ae7871 Fix spotless 2023-08-22 14:10:46 -07:00
tys 09a08e634d Fixing test and removing ignore 2023-08-22 14:10:02 -07:00
tys c0bf8a8113 Update coroutines 1.7.3 2023-08-22 14:03:01 -07:00
Fran Aguilera 1f8839ba9a Merge pull request #608 from FranAguilera/change_as_worker_dispatcher_to_default
Change default CoroutineContext from empty to default for the RibCoroutineWorker<>Worker conversion
2023-08-10 11:52:40 -07:00
Fran Aguilera e6f98bd602 Merge pull request #607 from FranAguilera/rib_coroutine_bind
Add RibCoroutineWorker.bind that receives multiple workers
2023-08-10 11:52:17 -07:00
Fran Aguilera 6ff90ff9a2 Update android/libraries/rib-base/src/main/kotlin/com/uber/rib/core/RibCoroutineWorker.kt
Co-authored-by: Patrick Steiger <psteiger@gmail.com>
2023-08-10 10:39:40 -07:00
Francisco Aguilera 94fffa83e9 Change dispatcher from empty to default for the Worker<>RibCoroutine conversion 2023-08-10 10:20:57 -07:00
Francisco Aguilera d719af07de Add RibCoroutineWorker.bind receiving multiple workers 2023-08-10 09:48:02 -07:00
James Barr 484a476c99 Prepare next development version 2023-08-07 15:14:04 -07:00
James Barr 0ea5c5c715 Prepare for release 0.15.2 v0.15.2 2023-08-07 15:09:24 -07:00
James Barr 9f6a21520a Set view tree owners (#606)
* Set view tree owners in RibActivity#onCreate
* Cleanup duplicate setting of view tree owners
* Add more assertions
2023-08-07 15:05:24 -07:00
Patrick Steiger 0d87f610e9 Add WorkerBinder.bind overloads that take in an Iterable.
`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`.
2023-07-25 21:58:51 -03:00