598 Commits

Author SHA1 Message Date
Patrick Steiger 9caff12076 Remove Java 8 for building the project.
Java 8 is really old and unsupported on macOS ARM64.

This commit bumps remaining Java 8 usages to Java 11. Source/target compatibility is still Java 8.
2025-09-11 11:38:31 -04:00
Rubin Yoo 134394c4bf For Interactor, replace the shared flow with the stateflow to improve the ANR stacktraces and reduce ANRs 2025-08-13 18:05:30 -04:00
Ty Smith 4a9bbbc9f4 Merge pull request #647 from uber/ribs-ios-link-fix
fix url typo for ribs-ios
2024-11-21 12:02:03 -08:00
Ty Smith 609e7dcd6c fix url typo for ribs-ios 2024-11-01 14:15:06 -07:00
Ty Smith 6af95eefb2 Merge pull request #646 from uber/remove-ios
Remove ios to prep for separate repos
2024-11-01 14:10:32 -07:00
tys fdac93cc76 Fixing gh actions root dir reference 2024-10-31 15:23:11 -07:00
tys ee6f53a451 Remove ios to prep for separate repos 2024-10-31 13:58:43 -07:00
Patrick Steiger 08b95b6d0e Remove intrinsics usage in RibCoroutineWorker
This commit changes dispatching logic to a much simpler one that does not require usage of intrinsics.

In order to synchronously get an instance of `bindJob`, we start the `unbindJob` coroutine undispatched (`bindJob` is a child of `unbindJob`, so we need an instance of `unbindJob` to create an instance of `bindJob`).

After saving `bindJob`, we properly dispatch in a cancellable way by simply `launch`ing a new coroutine.
2024-10-14 05:34:32 -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