Skip to content

Lazy-load UiBuild to speed up server startup#466

Merged
taylortom merged 2 commits into
adapt-security:masterfrom
taylortom:perf/lazy-load-build-deps
Jun 3, 2026
Merged

Lazy-load UiBuild to speed up server startup#466
taylortom merged 2 commits into
adapt-security:masterfrom
taylortom:perf/lazy-load-build-deps

Conversation

@taylortom

Copy link
Copy Markdown
Contributor

Summary

  • Convert top-level import UiBuild from './UiBuild.js' to dynamic await import('./UiBuild.js') inside build()
  • Defers loading of rollup, babel, less, terser, handlebars, etc. until the first UI build runs
  • Reduces module import time from ~2.6s to ~242ms

Closes #465

Test plan

  • Run npm start and verify server starts without errors
  • Trigger a UI build and verify it completes successfully
  • Test with --watch flag to verify file watching still works

🤖 Generated with Claude Code

taylortom and others added 2 commits April 13, 2026 15:48
UiBuild.js eagerly imports rollup, babel, less, terser, handlebars,
and other build tooling at module level. These are only needed when
actually building the UI, which happens after app.onReady().

Convert the top-level `import UiBuild from './UiBuild.js'` to a
dynamic `await import('./UiBuild.js')` inside the build() method,
deferring the heavy dependency tree until the first build runs.

Reduces this module's import time from ~2.6s to ~242ms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@taylortom taylortom merged commit 080856f into adapt-security:master Jun 3, 2026
2 checks passed
@taylortom taylortom deleted the perf/lazy-load-build-deps branch June 3, 2026 22:29
github-actions Bot pushed a commit that referenced this pull request Jun 3, 2026
## [3.0.5](v3.0.4...v3.0.5) (2026-06-03)

### Build

* Pin Rollup v2 output defaults for v4 upgrade ([a05c407](a05c407))

### Chore

* Add Rollup build integration test for v4 upgrade ([e7a9f68](e7a9f68))

### Fix

* Lazy-load UiBuild to speed up server startup (#466) ([080856f](080856f)), closes [#466](#466)

### Upgrade

* Bump @rollup/plugin-babel from 6.1.0 to 7.1.0 (#472) ([a60b06b](a60b06b)), closes [#472](#472)
* Bump rollup from 2.80.0 to 4.61.0 ([343255b](343255b))
* Bump upath from 2.0.1 to 3.0.7 (#468) ([fb86bf9](fb86bf9)), closes [#468](#468)
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow startup: eager build tooling import adds ~2.6s

1 participant