refactor(page): ES modules in src/page/, bundled with ECharts by esbuild into one page #11
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor-page-modules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The page was one
index.htmlof 1,491 lines. Its sources are now ES modules insrc/page/, built into one self-contained page.Build
scripts/build_page.mjs(npm run build): esbuild bundles the modules frommain.jswith the parts of ECharts they import (tree-shaken: the seven chart types and four components the views use) and inlines the bundle andstyle.cssintoindex.htmlat its build markers.build-mkpbuilds the page first. The MKP shipsindex.htmland the three license files;echarts.min.jsis gone. The web part shrinks from 1.19 MB to 663 KiB.Modules (the README has the table)
config.js(the parameters, checked first),states.js,tree.js,changes.js(no browser globals),api.js,load.js,ui.js(the shared state),chart.js,paint.js,tips.js,arcs.js,views/*.js(one per view),render.js,legend.js,list.js,main.js.Unchanged behavior
ui.*, the legend'sselect/fadepassed in,depthan argument ofsankeyGraph/sankeyColumns, and an optionalnowon the change tracking.window.biCharts.items()and the query parameters are the same. All 86 unit tests, including every browser test, pass against the built page (run locally in a container).Tests and CI
tests/js/tree.test.js(npm test, 13 tests): the BI trees, problems only, the flow graph (hosts as its leaves, a shared host as one node), impact, the state order. The unit job runs it.test_package.pychecks that the page is self-contained.test_checkmk.pychecks the inline script and the licenses served beside the page.tools/screenshots.pybuilds the page first.refactor:, so the release bot makes this a patch release. The integration tests are left to this PR's CI.🤖 Generated with Claude Code
Tests of CI / unit: passed
99 passed, 0 failed, 0 skipped (99 tests, 58.1 s)
Of
44d8e56172, the run, updated by every run.Tests of CI / integration (Checkmk 2.4): passed
18 passed, 0 failed, 0 skipped (18 tests, 245.4 s)
Of
44d8e56172, the run, updated by every run.Tests of CI / integration (Checkmk 2.5): passed
18 passed, 0 failed, 0 skipped (18 tests, 244.9 s)
Of
a35e2738af, the run, updated by every run.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.