I deleted and reposted as a snippet, I hoped it mi...
# javascript
i
I deleted and reposted as a snippet, I hoped it might be nicer in the main feed.. I'm sorry, I'm still getting used to slack. I finally got my entire converted library to compile successfully overnight.... but it took 1 hour and 41 minutes.... anybody have some suggestions on gradle/build settings that might be able to improve this for me? I am converting an existing generated library so I have to use the
@JSName
annotations unfortunately, or leave the names all messed up.... The library is about 210k lines of hardcore this:
so far these are the settings I'm using:
Copy code
// gradle.properties

kotlin.version=1.9.0
gradle.version=8.2.1
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xms2g -Xmx4g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
kotlin.mpp.stability.nowarn=true
kotlin.incremental.js.klib=false
kotlin.js.compiler=ir
kotlin.js.stdlib.dom.api.included=false
Copy code
// build.gradle.kts (relevant code)

    js {

        compilations.all {
            kotlinOptions {
                metaInfo = false
                moduleKind = "commonjs"
                sourceMap = false
                noStdlib = true
                sourceMapEmbedSources = null
                sourceMapPrefix = null
            }
        }

        useCommonJs()
        browser()
        binaries.executable()

    }
going to try to divide it up into multiple packages to compile them separately unless any secrets are shared in the meantime
t
Is it 1 file or multiple?
i
its across 5 and then one for the generated interfaces
66.8k lines 65.2k lines 62.2k lines 60.2k lines 58.4k lines 4.2k lines and my generated file is 4.4k lines ... so i guess quite a bit more than my original estimate
t
“1 type = 1 file” strategy can improve situation
i
thousands of files would be okay?
t
i
😅
I will try this and see how that goes before getting too deep into trying to sort out reasonable packages
t
Also fine check - GitHub actions
i
Do any of those huge packages you've done take a long time to compile?
t
Less then 1 hour 🙂
i
do you see anything in my gradle stuff you think i should change? I just need to be able to use the library to compile new code i write using the library to executable .js files
t
MUI Icons - 1m 13s on my machine
😨 1
i
goal is to have the declarations in a project, then make projects that use those, and then i just build those and take their .js file and drop it in where i need it
t
kotlin.incremental.js.klib=false
- you can check incremental mode AFAIK it’s stable now
👍 1
i
9166 files generated 😅 lets hope for better than an hour and 10 mins lol
t
Speedup expected in K2 🤞
😃 1