perf(procaptcha-bundle): collapse the i18n stack into one chunk - #2972
perf(procaptcha-bundle): collapse the i18n stack into one chunk#2972HughParry wants to merge 1 commit into
Conversation
Left to split automatically, i18n forms the longest serial chain in the widget's module graph. Measured on a staging demo load: 751 ms translations 877 ms i18nFrontend 919 ms i18next 983 ms translation.json 1029 ms captchaRenderer 1057 ms ProviderApi <- the chunk that issues detector/assign Each level is a round trip, because the browser cannot discover the next module until the previous one has parsed. The widget needs all of i18n before it can render a label, so the split buys nothing and costs four round trips. Note the util-crypto rule immediately below: merging chunks has caused evaluation cycles in this graph before, which present as the widget dying on load rather than as a build error. Cypress exercises the built bundle in a real browser, so it is the gate for this change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XJ7KiTDKiu3mxQ4iuLFK2y
|
Cypress confirms the risk flagged in the description — this change breaks widget load. Moving to draft. All three fail in The measurement motivating this stands — i18n is four serial round trips (751 → 877 → 919 → 983 ms) directly ahead of Next step for whoever picks this up: the merge is almost certainly too broad. Try narrowing it rather than abandoning it — e.g. group only the The other two changes from the same investigation are unaffected and green: #2971 and prosopo/captcha-private#4042. |
Left to split automatically, i18n forms the longest serial chain in the widget's module graph. Measured on a staging demo load with headless Chromium — each level is a round trip, because the browser cannot discover the next module until the previous one has parsed:
The widget needs all of i18n before it can render a label, so splitting it buys nothing and costs four round trips on the critical path. One chunk is one round trip.
This is the third of three changes against the same measurement (staging 4928 ms vs production 1744 ms to a clickable checkbox); the others are #2971 and prosopo/captcha-private#4042.
Verification status — please read
The build succeeds and the chunks collapse as intended (
i18nChunk-*.jsreplacestranslations,i18nFrontend,i18next,translation.json).I have not verified runtime behaviour locally — my static-server harness failed to serve the bundle and I did not get a clean load test. That matters here specifically: the
util-cryptorule immediately below this one documents a previous chunk merge in this graph producing an evaluation cycle, which presented as "init_dist is not a function" and the widget dying on load — not as a build error.Cypress exercises the built bundle in a real browser, so it is the actual gate for this change. If it goes green this is safe; if it fails on widget init, that is the cycle and the merge needs narrowing (e.g. keeping
translation.jsonseparate).🤖 Generated with Claude Code
https://claude.ai/code/session_01XJ7KiTDKiu3mxQ4iuLFK2y