Hey, I am working on upgrading <https://github.com...
# webassembly
s
Hey, I am working on upgrading https://github.com/kowasm/kowasm to Kotlin 2.1 and do some cleanup. When targeting the browser, it looks like the filename of the generated
.wasm
file referenced in
build/dist/wasmJs/productionExecutable/client.js
changed from a predictable
kowasm-samples-fullstack-sample-client-wasm-js.wasm
file to something like
fe1cfb79fdc95318bb10.wasm
. Is there a Gradle configuration that allows to bring back a predictable filename?
Also when upgrading from Kotlin
2.1.10
to
2.1.20-Beta2
, the size of
client.js
grows from 7K to 291K!, see this related warning:
Copy code
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (291 KiB)
      client.js
Any chance you could restore a more accurate JS code removal (my app is pretty small)?
s
@Ilya Goncharov [JB] do you know if there is a way to control filenames?
b
@sdeleuze did you get the warning for dev or prod build?
i
When targeting the browser, it looks like the filename of the generated
.wasm
file referenced in
build/dist/wasmJs/productionExecutable/client.js
changed from a predictable
kowasm-samples-fullstack-sample-client-wasm-js.wasm
file to something like
fe1cfb79fdc95318bb10.wasm
While using webpack, it processes main js file, and processes wasm file with changing of its name. It is done for browser caching (no overlaps of name when sources are changed). This output name can be changed via webpack configuration. Why is it important for you how wasm file is called? We have JS file and it loads all necessary wasm file. If you want to run specifically wasm file, maybe you don’t need webpack at all?
s
@bashor Prod, I only changed the version and the size increased. Looks like a Kotlin
2.1.20-Beta2
regression.
Copy code
> Task :samples:fullstack-sample:client:wasmJsBrowserProductionWebpack
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  client.js (291 KiB)
@Ilya Goncharov [JB] Pretty specific need, I want to serve this file with a for now pretty basic Wasm HTTP server when I have not yet implemented advanced predicates. I will implement that, should be fine.
i
But are you going to work with our js file or do you have your own? Maybe you need only wasm file and in this case you don’t need webpack? Actually all that webpack does is process js file, renaming of wasm file is the process of changing logic of loading of wasm file
s
I think I need the js but I will have a deeper look to be sure.
b
@sdeleuze could you please share the project to take a look on size issue? Or even better - to file an issue?
s
@bashor KT-75295 Footprint regression in JS file with Kotlin/Wasm 2.1.20-Beta2
🙏 1
👍 1
b
@sdeleuze FYI, the size related regression is fixed in
2.1.20-RC
s
Cool thanks for the update
Is it released already ?
i
Yes, you can check it with your sample https://kotlinlang.org/docs/whatsnew-eap.html
🎉 1