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

Request for opting out of generating skiko wasm / js resources in latest compose plugin (1.6.10-rc03) #4823

Closed
bitspittle opened this issue May 17, 2024 · 0 comments · Fixed by #4824
Labels
enhancement New feature or request submitted

Comments

@bitspittle
Copy link

bitspittle commented May 17, 2024

I'm using Compose HTML, and it seems like the most recent version of Compose started generating skiko wasm and js as part of the build process. This seems to be because "Compose for Web" is now enabled by default.

I have my own resource processing task, and now I'm getting:

Reason: Task ':site:kobwebxMarkdownProcess' uses this output of task ':site:unpackSkikoWasmRuntimeJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Of course, I can hook my task up to the skiko task, but if I don't need the skiko resources, I would much rather skip over generating them in the first place.

@bitspittle bitspittle added enhancement New feature or request submitted labels May 17, 2024
@bitspittle bitspittle changed the title Request for opting out of generating skiko wasm / js resources in latest compose plugin (1.6.0-rc03) Request for opting out of generating skiko wasm / js resources in latest compose plugin (1.6.10-rc03) May 17, 2024
eymar added a commit that referenced this issue 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 issue 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
enhancement New feature or request submitted
Projects
None yet
1 participant