Skip to content

test: Speed up suite by prebundling barrel imports - #77

Merged
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/test-suite-perf
Aug 25, 2026
Merged

test: Speed up suite by prebundling barrel imports#77
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/test-suite-perf

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Every test file that renders the grid paid ~7s loading modules. All source files import from the igniteui-webcomponents barrel, which re-exports the full component library. Rollup tree-shakes this in the build, but web-test-runner serves unbundled ESM, so the browser fetched 249 modules per test page - banner, card, carousel and i18n-core included, none of which the grid uses.

Prebundle the barrel with esbuild, tree-shaken to the 8 runtime symbols src/ imports, and resolve the bare specifier to it. lit stays external so no second copy of the runtime enters the graph. The export list is derived by scanning src/ so it cannot drift.

Suite drops from 40.8s to 11.0s.

Every test file that renders the grid paid ~7s loading modules. All
source files import from the igniteui-webcomponents barrel, which
re-exports the full component library. Rollup tree-shakes this in the
build, but web-test-runner serves unbundled ESM, so the browser fetched
249 modules per test page - banner, card, carousel and i18n-core
included, none of which the grid uses.

Prebundle the barrel with esbuild, tree-shaken to the 8 runtime symbols
src/ imports, and resolve the bare specifier to it. lit stays external
so no second copy of the runtime enters the graph. The export list is
derived by scanning src/ so it cannot drift.

Suite drops from 40.8s to 11.0s.
@rkaraivanov
rkaraivanov merged commit acc2473 into master Aug 25, 2026
4 checks passed
@rkaraivanov
rkaraivanov deleted the rkaraivanov/test-suite-perf branch August 25, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant