-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update gradle plugin: Deprecate experimental configuration for Compose for Web #4796
Conversation
…e for Web Since 1.6.10 Compose for Web goes to Alpha and experimental configuration is not needed anymore. We'll do it by default.
@@ -27,7 +27,6 @@ private val TargetType.gradlePropertyName get() = "org.jetbrains.compose.experim | |||
private val EXPERIMENTAL_TARGETS: Set<TargetType> = setOf( | |||
TargetType("macos", presets = listOf("macosX64", "macosArm64")), | |||
TargetType("jscanvas", presets = listOf("jsIr", "js")), | |||
TargetType("wasm", presets = listOf("wasm", "wasmJs")), |
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.
Note: I keep jscanvas above!
We'll try to support k/js target of CM at least until Safari enables WasmGC. But still, it's better to keep it as an experimental target for now.
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.
Thank you for taking care of this!
…e for Web (#4796) Since 1.6.10 Compose for Web goes to Alpha and experimental configuration is not needed anymore. We'll configure the web targets by default when they're added to projects. ## Testing - I built the plugin to mavenLocal. And used it in a couple of our samples. - After gradle sync completes, I observe the Deprecation warning in build.gradle.kts on `compose.experimental.web` usages (see a screenshot below) <img width="1022" alt="Screenshot 2024-05-10 at 15 41 14" src="https://github.com/JetBrains/compose-multiplatform/assets/7372778/e8ede073-8d34-4dd7-ae74-c83ca0ff5c96"> Then I remove deprecated API usages and test that the project works without it: - run `./gradlew clean` just in case - run the app: `./gradlew wasmJsBrowserRun` and `./gradlew jsBrowserRun` - both run fine - build the production distribution: `./gradlew wasmJsBrowserDistribution` - `cd ..../build/dist/wasmJs/productionExecutable` and run `python -m http.server`, open a browser at `http://localhost:8000` - the app should work the same way it works with gradle tasks above <!-- Optional --> This should be tested by QA ## Release Notes ### Highlights - Web - Compose for Web goes to Alpha! Some experimental Compose Multiplatform Gradle plugin APIs for web app configuration were deprecated. Their usage is not required anymore. (cherry picked from commit 885ea3d)
…ed (#4824) Fixes: #4823 In #4796 we intentionally started to configure the web app for all k/js and k/wasm targets. The configuration involves adding a dependency on skiko-wasm runtime and unpacking it. Some projects don't need skiko-wasm-runtime (like those based on compose.html or just compose.runtime). **Solution:** We check if there is a dependency on org.jetbrains.compose.ui libraries (including transitive dependencies). If we find it, then we enable skikoUnpack task. Otherwise it's disabled. ## Testing - Build the gradle plugin locally (with this change) - Used it in our html landing example: https://github.com/JetBrains/compose-multiplatform/blob/master/examples/html/landing - Run `./gradlew jsBrowserDistribution`, check `.../compose-multiplatform/examples/html/landing/build/dist/js/productionExecutable` and see NO skiko.* files added there - Then add `implementation(compose.foundation)` dependency in build.gradle.jts and run `./gradlew clean jsBrowserDistribution` again - the build/dist contains skiko.* now
…ed (#4824) Fixes: #4823 In #4796 we intentionally started to configure the web app for all k/js and k/wasm targets. The configuration involves adding a dependency on skiko-wasm runtime and unpacking it. Some projects don't need skiko-wasm-runtime (like those based on compose.html or just compose.runtime). **Solution:** We check if there is a dependency on org.jetbrains.compose.ui libraries (including transitive dependencies). If we find it, then we enable skikoUnpack task. Otherwise it's disabled. ## Testing - Build the gradle plugin locally (with this change) - Used it in our html landing example: https://github.com/JetBrains/compose-multiplatform/blob/master/examples/html/landing - Run `./gradlew jsBrowserDistribution`, check `.../compose-multiplatform/examples/html/landing/build/dist/js/productionExecutable` and see NO skiko.* files added there - Then add `implementation(compose.foundation)` dependency in build.gradle.jts and run `./gradlew clean jsBrowserDistribution` again - the build/dist contains skiko.* now (cherry picked from commit 30164c5)
Since 1.6.10 Compose for Web goes to Alpha and experimental configuration is not needed anymore. We'll configure the web targets by default when they're added to projects.
Testing
compose.experimental.web
usages (see a screenshot below)Then I remove deprecated API usages and test that the project works without it:
./gradlew clean
just in case./gradlew wasmJsBrowserRun
and./gradlew jsBrowserRun
- both run fine./gradlew wasmJsBrowserDistribution
cd ..../build/dist/wasmJs/productionExecutable
and runpython -m http.server
, open a browser athttp://localhost:8000
- the app should work the same way it works with gradle tasks aboveThis should be tested by QA
Release Notes
Highlights - Web