Closed IlyaGulya closed 10 months ago
Thanks! I've been working on this, and been waiting for stable coroutines version. Could you please sync with my branch? https://github.com/badoo/Reaktive/compare/master...arkivanov:Reaktive:wasm
Sure =)
@arkivanov I've cherry-picked changes from your branch which were relevant:
kotlin-stdlib
and kotlin-test
dependencies from sourceSet-specific onesRepeatWhenTest
changesAsyncTestResult
and relevant changes to testAwait
extension as well as TestAwaitTest
.Detekt seems failing.
> Task :sample-mpp-module:detekt FAILED
/home/runner/work/Reaktive/Reaktive/sample-mpp-module/src/commonMain/kotlin/com/badoo/reaktive/samplemppmodule/Counter.kt:40:1: Needless blank line(s) [NoConsecutiveBlankLines]
/home/runner/work/Reaktive/Reaktive/sample-mpp-module/src/commonMain/kotlin/com/badoo/reaktive/samplemppmodule/Feature.kt:7:1: Unused import [NoUnusedImports]
/home/runner/work/Reaktive/Reaktive/sample-mpp-module/src/commonMain/kotlin/com/badoo/reaktive/samplemppmodule/Counter.kt:42:78: This expression contains a magic number. Consider defining it to a well named constant. [MagicNumber]
@arkivanov WDYT about merging/releasing? Merge now or later when coroutines are not RC? The same for the release process.
@arkivanov WDYT about merging/releasing? Merge now or later when coroutines are not RC? The same for the release process.
I think we could merge now and release 2.1.0-beta01
.
wasmJsBrowserTest
task hangs on my system (macOS). Looks like the same is happening on CI.
jsBrowserTest
at least says Please make sure that you have installed browsers.
.
Should we also enable nodejs()
for WASM too? wasmJsNodeTest
does not hang but throws CompileError: WebAssembly.Module(): invalid value type 0x71 @+389
.
You can debug CI by creating sub-bracnch from yours and opening PR to master of your fork.
wasmJsBrowserTest
task hangs on my system (macOS). Looks like the same is happening on CI.
jsBrowserTest
at least saysPlease make sure that you have installed browsers.
.Should we also enable
nodejs()
for WASM too?wasmJsNodeTest
does not hang but throwsCompileError: WebAssembly.Module(): invalid value type 0x71 @+389
.You can debug CI by creating sub-bracnch from yours and opening PR to master of your fork.
I think for now we don't need nodejs
, Wasm with nodejs is trickier. There must be an issue with tests, as I have Wasm browser running on CI successfully in other projects.
I will take a look soon
Follow up: I'm still fixing this. Linux build hangs on jsNodeTest
task and I haven't figured out why yet. 🙂
UPD: Seems that it's an issue with MainScheduler periodic task test
I'm able to reproduce it locally, I can take a look.
@arkivanov I've fixed all issues
@arkivanov Please take a look at my changes inside of MainScheduler.
There was a bug (as far as I can tell, maybe I'm wrong 🙂 ) - interval and timeout ids were removed from list of interval ids/timeout ids immediately after task is executed first time. That's a strange logic, I've removed it.
@arkivanov Please take a look at my changes inside of MainScheduler.
There was a bug (as far as I can tell, maybe I'm wrong 🙂 ) - interval and timeout ids were removed from list of interval ids/timeout ids immediately after task is executed first time. That's a strange logic, I've removed it.
It appears that a Node test hangs if there are any pending task (that are not executed yet). I was able to fix the test by just removing this line. Looks like this is an actual bug, as we are removing the interval (periodic) task id after the first execution, and so later it can't be cancelled. What do you think?
I think we can revert the rest of the unrelated changes after the commit f37282e?
I think we can revert the rest of the unrelated changes after the commit f37282e?
Are you sure it's unrelated?
timeout id
types. WASM does not support dynamic
type, so I have to use JsAny
instead. Int
is not correct and works only because of dynamic nature of JS. On NodeJS setTimeout
and setInterval
returns Timeout
object instead of Int
.I can squash some commits to make history cleaner, if you want
Hmm, I will refactor the MainThreadExecutor
once again in a moment
@arkivanov I once again refactored a bit.
Now there's only platform-specific TimeoutId
class and js functions implementations. MainThreadExecutor is now common as before.
Sorry, I will fix detekt complaints in a moment
Fixes #767
In this PR:
js
sources withwasmJs
by introducing thejsWasmJsCommon
sourceSets.