-
Notifications
You must be signed in to change notification settings - Fork 137
Enable WasmJs target #822
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
Enable WasmJs target #822
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8825f5d
Add wasmJs target (not working)
luca992 29b4834
Merge pull request #804 from icerockdev/develop
Alex009 50c6982
up to kotlin 2.1.21
Tetraquark 83b2437
setup wasmjs target
Tetraquark bd4b70e
Merge remote-tracking branch 'origin-2/wasmJs' into target-wasmjs
Tetraquark 72807de
support of wasm-js in resources, resources-generator
Tetraquark 392e5cf
add wasm-js target in compose-resources-gallery sample
Tetraquark bbdba0b
move wasmjs sample from resources-gallery to compose-resources-gallery
Tetraquark 7716c00
cleanup, fix checks
Tetraquark 25baa04
checks fix
Tetraquark 1438da0
checks fix
Tetraquark 1d99309
checks fix
Tetraquark 1d99f0e
#582 remove code duplication from generator
Alex009 f99683d
#582 remove duplication from runtime
Alex009 05fb285
set kotlin version 1.9.25, fix detekt and checks
Tetraquark 685493f
toJsonElement functions impl for js and wasmjs
Tetraquark 934a2d1
review fixes
Tetraquark 6334ba0
some cleanup, review fixes
Tetraquark bdfdded
#582 commonization of compose and test modules for js
Alex009 378f409
#582 fix inferred type is ByteArray but Nothing? was expected
Alex009 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ local.properties | |
| local.gradle | ||
| moko-resources-generated.js | ||
| .fleet | ||
| .kotlin | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #Tue Jul 25 10:40:31 NOVT 2023 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip | ||
| networkTimeout=10000 | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Large diffs are not rendered by default.
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
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
2 changes: 1 addition & 1 deletion
2
...oko/resources/compose/FontResource.ios.kt → ...ck/moko/resources/compose/FontResource.kt
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
File renamed without changes.
File renamed without changes.
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
16 changes: 16 additions & 0 deletions
16
resources-compose/src/jsMain/kotlin/dev/icerock/moko/resources/compose/StringResource.js.kt
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,16 @@ | ||
| /* | ||
| * Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
| */ | ||
|
|
||
| package dev.icerock.moko.resources.compose | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.produceState | ||
| import dev.icerock.moko.resources.desc.StringDesc | ||
|
|
||
| @Composable | ||
| internal actual fun localized(stringDesc: StringDesc): String { | ||
| return produceState(initialValue = "", stringDesc) { | ||
| value = stringDesc.toLocalizedString() | ||
| }.value | ||
| } |
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
17 changes: 17 additions & 0 deletions
17
resources-compose/src/wasmJsMain/kotlin/dev/icerock/moko/resources/compose/AssetResource.kt
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,17 @@ | ||
| /* | ||
| * Copyright 2023 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
| */ | ||
|
|
||
| package dev.icerock.moko.resources.compose | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.State | ||
| import androidx.compose.runtime.produceState | ||
| import dev.icerock.moko.resources.AssetResource | ||
|
|
||
| @Composable | ||
| actual fun AssetResource.readTextAsState(): State<String?> { | ||
| return produceState<String?>(null, this) { | ||
| value = getText() | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
resources-compose/src/wasmJsMain/kotlin/dev/icerock/moko/resources/compose/ColorResource.kt
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,23 @@ | ||
| /* | ||
| * Copyright 2023 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
| */ | ||
|
|
||
| package dev.icerock.moko.resources.compose | ||
|
|
||
| import androidx.compose.foundation.isSystemInDarkTheme | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.graphics.Color | ||
| import dev.icerock.moko.resources.ColorResource | ||
|
|
||
| @Composable | ||
| actual fun colorResource(resource: ColorResource): Color { | ||
| // TODO https://github.com/icerockdev/moko-resources/issues/442 | ||
| // web isSystemInDarkTheme not works now | ||
| val mokoColor: dev.icerock.moko.graphics.Color = if (isSystemInDarkTheme()) { | ||
| resource.darkColor | ||
| } else { | ||
| resource.lightColor | ||
| } | ||
|
|
||
| return Color(mokoColor.argb) | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.