Skip to content
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

Merged
merged 1 commit into from May 13, 2024

Conversation

eymar
Copy link
Collaborator

@eymar eymar commented May 10, 2024

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)
Screenshot 2024-05-10 at 15 41 14

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

This should be tested by QA

Release Notes

Highlights - Web

  • Some experimental Compose Multiplatform Gradle plugin APIs for web app configuration were deprecated. Their usage is not required anymore.

…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.
@eymar eymar requested review from igordmn and Schahen May 10, 2024 14:04
@@ -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")),
Copy link
Collaborator Author

@eymar eymar May 10, 2024

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.

Copy link
Collaborator

@Schahen Schahen left a 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!

@eymar eymar merged commit 885ea3d into master May 13, 2024
12 checks passed
@eymar eymar deleted the ok/remove_experimental_cfw_configuration branch May 13, 2024 09:33
eymar added a commit that referenced this pull request May 13, 2024
…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)
eymar added a commit that referenced this pull request May 17, 2024
…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
eymar added a commit that referenced this pull request May 17, 2024
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants