Hi all, i am working on a common library targeting...
# ktor
l
Hi all, i am working on a common library targeting js, android and ios targets. without ktor library my js bundle size is around
383K
and with ktor my bundle size goes to around
617K
increasing bundle size by
234K
. I have found some old you track tickets around similar issues, but not able to find if there is any way around this size increase. Is this something which is expected or can it be improved ?
b
if you are only using client core and no other artefacts like websockets or something that you don't actually need. and you are also bundling with production mode (not development) that cranks up dead code removal and minimization and all that. the only thing left is to change the gradle settings to a per-file granularity (which will also ensure per dependency granularity, if i am not mistaken!) and make 2 or more bundles that you will send over to the client app.
or keep per-module granularity but first consume and bundle the ktor dependency in a separate module.
basically look at ways to chop up your bundle. and maybe leverage caching. you can maybe make it so clients agressively cache the ktor dependency since it doesn't change
ya, bummer, they probably chopped up the ktor library for the same reason, its too big. and you will have to respect this and serve your lib in a similar fashion.
l
i see, i would be needing websocket as well in addition to http client. and yes, the sizes i mentioned are for bundling in production mode using rollup. separate module bundle is good idea, thanks for that, for now we might decide to go diy route by using
web.fetch
for js target atleast.
👍 1