Open fwbrasil opened 2 weeks ago
@hearnadam wdyt about relocating some of the bounty budget to this? It's also an important cleanup step before we add Scala Native support to kyo-core
.
@fwbrasil Which of these do you think we can remove?
./kyo-scheduler/js/src/main/scala/java/util/concurrent/ThreadFactory.scala
./kyo-scheduler/js/src/main/scala/kyo/scheduler/util/Threads.scala
./kyo-scheduler/js/src/main/scala/kyo/scheduler/InternalClock.scala
./kyo-scheduler/js/src/main/scala/kyo/scheduler/Scheduler.scala
./kyo-scheduler/js/src/main/scala/kyo/scheduler/Coordinator.scala
./kyo-cats/js/src/test/scala/java/util/concurrent/CountDownLatch.scala
./kyo-zio/js/src/test/scala/java/util/concurrent/CountDownLatch.scala
./kyo-core/js/src/main/scala/kyo/AsyncStubs.scala
./kyo-core/js/src/main/scala/kyo/internal/LogPlatformSpecific.scala
./kyo-core/js/src/main/scala/kyo/internal/FiberPlatformSpecific.scala
./kyo-core/js/src/main/scala/kyo/scheduler/IOPromisePlatformSpecific.scala
./kyo-core/js/src/main/scala/kyo/queuesStubs.scala
./kyo-core/js/src/main/scala/kyo/hubsStubs.scala
./kyo-core/js/src/main/scala/kyo/addersStubs.scala
./kyo-core/js/src/main/scala/kyo/timersSubs.scala
./kyo-core/js/src/main/scala/kyo/stats/internal/ServiceLoader.scala
./kyo-stats-registry/js/src/main/scala/java/lang/ref/WeakReference.scala
./kyo-stats-registry/js/src/main/scala/kyo/stats/internal/UnsafeHistogram.scala
./kyo-stats-registry/js/src/main/scala/kyo/stats/internal/StatsRefresh.scala
./kyo-prelude/js/src/main/scala/kyo/kernel/TracePool.scala
./kyo-prelude/js/src/main/scala/kyo/kernel/Platform.scala
./kyo-sttp/js/src/main/scala/kyo/PlatformBackend.scala
Aside from porting some collections to compile for Scala 3, I am not sure how we can avoid some of these stubs. We could however certainly join the jvm + native files that are just duplicated. We can also possibly
I think in many cases it's possible to refactor the code to a PlatformSpecific
impl instead of using the java types directly so we don't need to stub them
/bounty $75
/attempt #808
with your implementation plan/claim #808
in the PR body to claim the bountyThank you for contributing to getkyo/kyo!
I didn't have much discipline when I first introduced JS support and created quick stubs for the necessary types. We should move to a more structured approach with
PlatformSpecific
super types, avoiding stubs for Java types for example.