xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

Package size increased a lot

Open Amoki opened this issue 3 years ago • 1 comments

Describe the bug

xeokit-sdk.es.js sizes: 1.9.0: 1.2 MB 2.0.0: 3.6 BM 2.0.13: 4.9BM 2.1.0: 5.2 MB 2.2.0: 5.3 MB

This leads more js to load at page loading, more code parsing. I've seen many new loaders plugins coming with big dependencies and they are loaded even if we don't use them

Amoki avatar Jan 10 '22 13:01 Amoki

Are you really loading the entire xeokit-sdk library into your app though?

When building all into a single library, I had expected users to use include, with tree shaking etc.

In any case, I'll look into separating out the plugins at some point soon.

xeolabs avatar Jan 10 '22 14:01 xeolabs

I discovered https://github.com/btd/rollup-plugin-visualizer and used it on xeokit: image You can unzip and open the stats.html file in your browser to explore stats.zip

Amoki avatar Jun 27 '23 08:06 Amoki

Are you really loading the entire xeokit-sdk library into your app though?

No, but I think there is a conflict between what you say here and the package.json

The package.json doesn't expose src/ files. The tree-shaking doesn't work with the single .js built file. Users must fork xeokit and change the package.json if they don't want to load everything.

Adding src/ to package.json's files would allow doing import {Viewer} from "@xeokit/xeokit-sdk/src/viewer/Viewer.js" to cherry-pick what needs to be embedded in app.

(We do fork xeokit and change the package.json/remove unused stuff, so it's not a priority issue for us)

Amoki avatar Sep 26 '23 12:09 Amoki

See #1151 Released in 2.4.0-alpha-82

xeolabs avatar Oct 02 '23 19:10 xeolabs