-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from copper-leaf/dev
[4.2.0] WasmJS Support
- Loading branch information
Showing
114 changed files
with
1,278 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
copperleaf.description=Ktor websocket server for building Ballast Debugger UI | ||
|
||
copperleaf.targets.android=false | ||
copperleaf.targets.jvm=true | ||
copperleaf.targets.ios=false | ||
copperleaf.targets.js=false | ||
copperleaf.targets.wasm.wasi=false | ||
copperleaf.targets.wasm.js=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
copperleaf.description=Compose UI for Ballast Debugger | ||
|
||
copperleaf.targets.android=false | ||
copperleaf.targets.jvm=true | ||
copperleaf.targets.ios=false | ||
copperleaf.targets.js=false | ||
copperleaf.targets.wasm.wasi=false | ||
copperleaf.targets.wasm.js=false | ||
|
||
copperleaf.compose.splitPane=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ballast-logging/src/wasmJsMain/kotlin/com.copperleaf.ballast.core/WasmJsConsoleLogger.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Taken from https://touchlab.co/wasm-in-kermit | ||
*/ | ||
package com.copperleaf.ballast.core | ||
|
||
import com.copperleaf.ballast.BallastLogger | ||
|
||
@JsFun("(output) => console.log(output)") | ||
internal external fun consoleLog(vararg output: String?) | ||
|
||
@JsFun("(output) => console.info(output)") | ||
internal external fun consoleInfo(vararg output: String?) | ||
|
||
@JsFun("(output) => console.error(output)") | ||
internal external fun consoleError(vararg output: String?) | ||
|
||
/** | ||
* An implementation of a [BallastLogger] which writes log messages to the JavaScript `console`. | ||
*/ | ||
public class WasmJsConsoleLogger(private val tag: String? = null) : BallastLogger { | ||
override fun debug(message: String) { | ||
consoleLog(formatMessage(tag, message)) | ||
} | ||
|
||
override fun info(message: String) { | ||
consoleInfo(formatMessage(tag, message)) | ||
} | ||
|
||
override fun error(throwable: Throwable) { | ||
consoleError(throwable.stackTraceToString()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.