ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
635 stars 202 forks source link

[Discussion]: The bundle size is too damn high #1162

Open peterhirn opened 3 days ago

peterhirn commented 3 days ago

What is your idea?

I honestly didn't spent much time investigating why this is happening yet (tbd).

Shipping 5Mb (excl. wasm) for a minimal viewer app is insane, eg. bundled with astro/vite defaults:

bundle

Tree shaking doesn't seem to work. I'm hoping this can be fixed/improved by changing the way the schema-generator works.

References

https://github.com/ThatOpen/engine_web-ifc/issues/495

beachtom commented 23 hours ago

You are right the size is all the schema related information. Because there are about 4 different versions of IFC in circulation at the moment and each has a separate schema. I have reduced the size by several Mb over the last few months - but am out of ideas at this point for reducing it further. Except:

  1. Having the schema downloaded dynamically from a CDN - but I am not sure if this will actually help people that much, because if you are building a general app you will likely encounter all the files anyway.
  2. Again bundling specific versions of the schema seperately - so you can build an app for a specific given version - but I don't think this matches many people use cases