-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: develop
Are you sure you want to change the base?
Enable WasmJs target #822
Conversation
In wasmJs generated code have to handle: Calls to 'js(code)' should be a single expression inside a top-level function body or a property initializer in Kotlin/Wasm.
Develop 0.24.5
# Conflicts: # gradle/libs.versions.toml # gradle/moko.versions.toml # resources-build-logic/src/main/kotlin/multiplatform-library-convention.gradle.kts # resources-compose/build.gradle.kts # resources/build.gradle.kts # samples/compose-resources-gallery/gradle.properties
@@ -1,5 +1,5 @@ | |||
[versions] | |||
resourcesVersion = "0.24.5" | |||
resourcesVersion = "0.24.6" |
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.
we have new feature (wasm support) and updated requirements (kotlin 2.1), so we should set 0.25.0 version
// For https://youtrack.jetbrains.com/issue/KT-61573 | ||
targets.configureEach { | ||
compilations.configureEach { | ||
compileTaskProvider.get().compilerOptions { |
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.
instead of eager resolve task use lazy configuration please.
compileTaskProvider.configure {
..
}
): Font? { | ||
val bytes: ByteArray? by produceByteArray(url = fileUrl) | ||
|
||
return remember(fileUrl, bytes?.size ?: 0) { |
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.
i think better use key bytes, weight, style (it's all outside dependencies).
is fileUrl + bytes.size better in perfomance than using bytes?
import dev.icerock.gradle.utils.flatName | ||
import java.io.File | ||
|
||
internal class WasmJsFontResourceGenerator( |
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.
is it some differences between wasm and js generators? looks like they identical. maybe we will just use single implementation for both targets?
@@ -42,7 +42,7 @@ import platform.darwin.UInt8Var | |||
import kotlin.native.internal.ObjCErrorException | |||
|
|||
actual class FontResource( | |||
val fontName: String, | |||
val fontName: String = "", |
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.
why we need this?
@@ -29,6 +29,9 @@ dependencyResolutionManagement { | |||
mavenLocal() | |||
} | |||
versionCatalogs { | |||
create("libs") { | |||
from(files("../../gradle/libs.versions.toml")) |
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.
samples not use same versions as library to check potential conflicts, please revert this
@@ -9,6 +9,9 @@ dependencyResolutionManagement { | |||
mavenLocal() | |||
} | |||
versionCatalogs { | |||
create("libs") { | |||
from(files("../../gradle/libs.versions.toml")) |
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.
samples not use same versions as library to check potential conflicts, please revert this
@@ -30,6 +31,9 @@ dependencyResolutionManagement { | |||
} | |||
|
|||
versionCatalogs { | |||
create("libs") { | |||
from(files("../../gradle/libs.versions.toml")) |
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.
samples not use same versions as library to check potential conflicts, please revert this
@@ -9,6 +9,9 @@ dependencyResolutionManagement { | |||
mavenLocal() | |||
} | |||
versionCatalogs { | |||
create("libs") { | |||
from(files("../../gradle/libs.versions.toml")) |
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.
samples not use same versions as library to check potential conflicts, please revert this
@@ -9,6 +9,9 @@ dependencyResolutionManagement { | |||
mavenLocal() | |||
} | |||
versionCatalogs { | |||
create("libs") { | |||
from(files("../../gradle/libs.versions.toml")) |
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.
samples not use same versions as library to check potential conflicts, please revert this
This is a continuation of the pool request: #724. Issue: #582
The main goal of this pull request: enabling the WasmJs target. What has been done:
2.1.21
, along with updates to several dependency versionswasmJs
support inresources
andresources-generator
compose-resources-gallery