Content
View differences
Updated by Alexander Coles 1 day ago
`@xeokit/*` (~6.9 MB) was hoisted into the eager JS bundle: the IFC/BIM viewer's `IFCViewerService` `~6.9 MB` extra is reachable from the eager module graph (`WorkPackages → BCF → IFCViewerService → xeokit`), so `main` statically imported it and present in every page paid the cost.
**Fix:** defer the `xeokit-sdk` and `xeokit-bim-viewer` imports in `IFCViewerService#newViewer` to a dynamic `import()`, so esbuild splits them into on-demand chunks loaded only when a BIM viewer opens.
**Impact** (esbuild metafile): eager JS 22.93 MB → 16.38 MB (≈ −6.55 MB raw, ~1.5–2 MB gzipped). The static `main → xeokit` edge is gone; xeokit is reached only via dynamic import.
PR: https://github.com/opf/openproject/pull/23925 build!
**Fix:** defer the `xeokit-sdk` and `xeokit-bim-viewer` imports in `IFCViewerService#newViewer` to a dynamic `import()`, so esbuild splits them into on-demand chunks loaded only when a BIM viewer opens.
**Impact** (esbuild metafile): eager JS 22.93 MB → 16.38 MB (≈ −6.55 MB raw, ~1.5–2 MB gzipped). The static `main → xeokit` edge is gone; xeokit is reached only via dynamic import.
PR: https://github.com/opf/openproject/pull/23925