Provider UI minification is a small, explicit build step for the JavaScript files
served by provider.
The provider runtime uses four JavaScript assets from
provider/src/opamp_provider/html/:
web_ui_state.jsweb_ui_functions.jsweb_ui_framework.jsweb_ui_bindings.jsThe minification process generates a matching .mini.js file beside each source
file:
web_ui_state.mini.jsweb_ui_functions.mini.jsweb_ui_framework.mini.jsweb_ui_bindings.mini.jsThe canonical minification entry point is:
python dev-tools/main.py build ui-compactionIt uses npx esbuild --minify --legal-comments=none and writes deterministic
output files next to the source assets.
The canonical asset list is shared in:
provider/src/opamp_provider/ui_assets.pyBoth provider runtime and the minification command read from that shared module so the asset set stays aligned.
Manual usage:
python3 dev-tools/main.py --repo-root . build ui-compaction
Clean-only usage:
python3 dev-tools/main.py --repo-root . build ui-compaction --clean-only
Provider runtime asset selection is controlled by APP_ENABLE_DEV_FEATURES.
APP_ENABLE_DEV_FEATURES is truthy (1, true, yes, on), provider
prefers the readable source files..mini.js files.This behavior is implemented in:
provider/src/opamp_provider/app.pyMinification is expected to run in the main packaging and quality workflows.
scripts/security_checks.py runs provider UI compaction as the first step
before tests and security scans.
It also removes APP_ENABLE_DEV_FEATURES from the check environment so the
checks validate the non-dev asset-selection path.
Both wrapper scripts:
scripts/build_artifacts.shscripts/build_artifacts.cmdrun scripts/security_checks.py, so provider UI compaction is part of the
standard artifact build path.
python dev-tools/main.py build release-assets refreshes the provider UI compact assets
before building wheels unless --skip-ui-compaction is supplied.
Whenever a provider UI JavaScript asset is added, renamed, or removed, update the shared definitions in:
provider/src/opamp_provider/ui_assets.pyIf the runtime serves a new asset route, also update the relevant provider route
or asset-loading call in provider/src/opamp_provider/app.py.
Keeping the shared asset definition current prevents release builds from silently falling back from minified assets to source assets.