Skip to content

Commit 6c23fc9

Browse files
authored
Merge pull request #312 from amirghm/feature/add-wasmjs-support
Feature/add wasmjs support
2 parents 06d3c82 + dec0029 commit 6c23fc9

89 files changed

Lines changed: 7953 additions & 690 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ sample/desktopApp/cache
2121
sample/desktopApp/DawnCache
2222
sample/desktopApp/GPUCache
2323
sample/desktopApp/*.log
24-
site
24+
site
25+
/.kotlin

.run/androidApp.run.xml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="androidApp" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
3+
<module name="compose-webview-multiplatform.sample.androidApp" />
4+
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
5+
<option name="DEPLOY" value="true" />
6+
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
7+
<option name="DEPLOY_AS_INSTANT" value="false" />
8+
<option name="ARTIFACT_NAME" value="" />
9+
<option name="PM_INSTALL_OPTIONS" value="" />
10+
<option name="ALL_USERS" value="false" />
11+
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
12+
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
13+
<option name="CLEAR_APP_STORAGE" value="false" />
14+
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
15+
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
16+
<option name="MODE" value="default_activity" />
17+
<option name="RESTORE_ENABLED" value="false" />
18+
<option name="RESTORE_FILE" value="" />
19+
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
20+
<option name="CLEAR_LOGCAT" value="false" />
21+
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
22+
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
23+
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
24+
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
25+
<option name="DEBUGGER_TYPE" value="Auto" />
26+
<Auto>
27+
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
28+
<option name="SHOW_STATIC_VARS" value="true" />
29+
<option name="WORKING_DIR" value="" />
30+
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
31+
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
32+
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
33+
<option name="DEBUG_SANDBOX_SDK" value="false" />
34+
</Auto>
35+
<Hybrid>
36+
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
37+
<option name="SHOW_STATIC_VARS" value="true" />
38+
<option name="WORKING_DIR" value="" />
39+
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
40+
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
41+
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
42+
<option name="DEBUG_SANDBOX_SDK" value="false" />
43+
</Hybrid>
44+
<Java>
45+
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
46+
<option name="DEBUG_SANDBOX_SDK" value="false" />
47+
</Java>
48+
<Native>
49+
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
50+
<option name="SHOW_STATIC_VARS" value="true" />
51+
<option name="WORKING_DIR" value="" />
52+
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
53+
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
54+
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
55+
<option name="DEBUG_SANDBOX_SDK" value="false" />
56+
</Native>
57+
<Profilers>
58+
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
59+
<option name="STARTUP_PROFILING_ENABLED" value="false" />
60+
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
61+
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
62+
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
63+
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
64+
</Profilers>
65+
<option name="DEEP_LINK" value="" />
66+
<option name="ACTIVITY" value="" />
67+
<option name="ACTIVITY_CLASS" value="" />
68+
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
69+
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
70+
<method v="2">
71+
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
72+
</method>
73+
</configuration>
74+
</component>

.run/desktopApp.run.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
3-
<ExternalSystemSettings>
4-
<option name="executionName" />
5-
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/desktopApp" />
6-
<option name="externalSystemIdString" value="GRADLE" />
7-
<option name="scriptParameters" value="" />
8-
<option name="taskDescriptions">
9-
<list />
10-
</option>
11-
<option name="taskNames">
12-
<list>
13-
<option value="run" />
14-
</list>
15-
</option>
16-
<option name="vmOptions" value="" />
17-
</ExternalSystemSettings>
18-
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19-
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20-
<DebugAllEnabled>false</DebugAllEnabled>
21-
<method v="2" />
22-
</configuration>
2+
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/desktopApp" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="run" />
14+
</list>
15+
</option>
16+
<option name="vmOptions" value="" />
17+
</ExternalSystemSettings>
18+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20+
<DebugAllEnabled>false</DebugAllEnabled>
21+
<method v="2" />
22+
</configuration>
2323
</component>

.run/iosApp.run.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration name="iosApp" CONFIG_VERSION="1" EXEC_TARGET_ID="B611C1CD-2B48-439C-99F1-7D42CFADF467"
3+
XCODE_CONFIGURATION="Debug" XCODE_PROJECT="$PROJECT_DIR$/sample/iosApp/iosApp.xcodeproj"
4+
XCODE_SCHEME="iosApp"
5+
default="false" factoryName="iOS Application"
6+
type="KmmRunConfiguration">
7+
<method v="2">
8+
<option name="com.jetbrains.kmm.ios.BuildIOSAppTask" enabled="true" />
9+
</method>
10+
</configuration>
11+
</component>

.run/wasmJsApp.run.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="wasmJsApp" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$/sample/wasmJsApp" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="wasmJsBrowserDevelopmentRun" />
14+
</list>
15+
</option>
16+
<option name="vmOptions" value="" />
17+
</ExternalSystemSettings>
18+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20+
<DebugAllEnabled>false</DebugAllEnabled>
21+
<method v="2" />
22+
</configuration>
23+
</component>

README.desktop.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Please use the following example as a reference.
2121

2222
```kotlin
2323
fun main() = application {
24+
addTempDirectoryRemovalHook()
2425
Window(onCloseRequest = ::exitApplication) {
2526
var restartRequired by remember { mutableStateOf(false) }
2627
var downloading by remember { mutableStateOf(0F) }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class GreetJsMessageHandler : IJsMessageHandler {
347347
"Greet Handler Get Message: $message"
348348
}
349349
val param = processParams<GreetModel>(message)
350-
val data = GreetModel("KMM Received ${param.message}")
350+
val data = GreetModel("KMP Received ${param.message}")
351351
callback(dataToJsonString(data))
352352
}
353353
}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ subprojects {
1818

1919
// Optionally configure plugin
2020
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
21-
version.set("1.0.1")
21+
version.set("1.6.0")
2222
filter {
2323
exclude("**/generated/**")
2424
include("**/kotlin/**")

docs/communication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MaterialTheme {
3434
onClick = {
3535
webViewNavigator.evaluateJavaScript(
3636
"""
37-
document.getElementById("subtitle").innerText = "Hello from KMM!";
37+
document.getElementById("subtitle").innerText = "Hello from KMP!";
3838
""".trimIndent(),
3939
) {
4040
// handle the result
@@ -89,7 +89,7 @@ class GreetJsMessageHandler : IJsMessageHandler {
8989
"Greet Handler Get Message: $message"
9090
}
9191
val param = processParams<GreetModel>(message)
92-
val data = GreetModel("KMM Received ${param.message}")
92+
val data = GreetModel("KMP Received ${param.message}")
9393
callback(dataToJsonString(data))
9494
}
9595
}

gradle.properties

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@ kotlin.mpp.enableCInteropCommonization=true
99
kotlin.mpp.androidSourceSetLayoutVersion=2
1010
#Android
1111
android.useAndroidX=true
12-
android.compileSdk=34
13-
android.targetSdk=34
12+
android.compileSdk=36
13+
android.targetSdk=36
1414
android.minSdk=21
1515
#Versions
16-
kotlin.version=1.9.23
17-
agp.version=8.1.1
18-
compose.version=1.7.1
19-
coroutines.version=1.8.0
2016
GROUP=io.github.kevinnzou
2117
POM_ARTIFACT_ID=compose-webview-multiplatform
22-
VERSION_NAME=1.9.40
18+
VERSION_NAME=2.0.0
2319
POM_NAME=Compose WebView Multiplatform
2420
POM_INCEPTION_YEAR=2023
2521
POM_DESCRIPTION=WebView for JetBrains Compose Multiplatform

0 commit comments

Comments
 (0)