-
Notifications
You must be signed in to change notification settings - Fork 103
Kotlin/Wasm support #1099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Kotlin/Wasm support #1099
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
857fe48
Initial port to Kotlin/WASM
cedrickcooke 0362ab1
Fix compilation
cedrickcooke 8e54da0
Fix web test compilation
cedrickcooke 000d085
Fix import order
cedrickcooke 9b09049
Fix comment on web console interface
cedrickcooke da477f3
Merge branch 'main' into cedrickc/kotlin-wasm-support
cedrickcooke 4216e2b
Optimize imports; use json stringify from library
cedrickcooke 4533cd6
Revert overzealous find and replace
cedrickcooke 20b3ffa
Revert harder
cedrickcooke 9b1fcfc
Merge branch 'main' into cedrickc/kotlin-wasm-support
cedrickcooke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
kable-core/src/jsMain/kotlin/bluetooth/WatchingAdvertisementsSupport.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,6 @@ | ||
| package com.juul.kable.interop | ||
|
|
||
| import kotlin.js.Promise | ||
| import kotlinx.coroutines.await as kotlinxAwait | ||
|
|
||
| internal actual suspend fun <T : JsAny?> Promise<T>.await(): T = kotlinxAwait() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,6 @@ | ||
| package com.juul.kable.interop | ||
|
|
||
| import kotlin.js.Promise | ||
| import kotlinx.coroutines.await as kotlinxAwait | ||
|
|
||
| internal actual suspend fun <T : JsAny?> Promise<T>.await(): T = kotlinxAwait() |
This file contains hidden or 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,27 @@ | ||
| package com.juul.kable | ||
|
|
||
| import com.juul.kable.external.Bluetooth | ||
| import com.juul.kable.external.getBluetooth | ||
| import web.navigator.Navigator | ||
| import kotlin.js.js | ||
| import kotlin.js.undefined | ||
|
|
||
| private val navigator: Navigator = | ||
| js("window.navigator") | ||
cedrickcooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * @return [Bluetooth] object or `null` if bluetooth is [unavailable](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth#browser_compatibility). | ||
| */ | ||
| internal fun bluetoothOrNull(): Bluetooth? = | ||
| getBluetooth(navigator).takeIf { it !== undefined } | ||
|
|
||
| /** | ||
| * @throws IllegalStateException If bluetooth is [unavailable](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth#browser_compatibility). | ||
| */ | ||
| internal fun bluetoothOrThrow(): Bluetooth { | ||
| val bluetooth = getBluetooth(navigator) | ||
| if (bluetooth === undefined) { | ||
| error("Bluetooth unavailable") | ||
| } | ||
| return bluetooth | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, just curious if this bump was needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.2.21 contained some fixes around exception handling for WASM in Safari based browsers