v2.5.1 — terser preservation fix for window.__hyperfixi_i18n
[2.5.1] - 2026-05-24
A single-bug patch for a v2.5.0 publishing regression that broke every localized htmx attribute.
Fixed
hyperfixi-hx.js/hyperfixi-hx-v4.js:window.__hyperfixi_i18nlost to terser (@hyperfixi/core). The Phase 8 orchestrator's public-API singleton (window.__hyperfixi_i18n = { register }) was being eliminated by terser in the published v2.5.0 hybrid-hx and hybrid-hx-v4 bundles, silently breaking everyvocab/htmx/{lang}.jsmodule on load with"loaded before the htmx-compat orchestrator". Two layers fixed: (1) the module-levelinstallPublicAPI()invocation is now exported and called explicitly from each bundle entry that includes htmx-compat, so terser'sunused: true, toplevel: truepass can't drop it; (2) the API is exposed via bracket-access (window['__hyperfixi_i18n']) to bypass terser'sproperties.regex: /^_/mangling. Localized htmx attribute names (hx-obtener,hx-取得,hx-احصل, …) now resolve correctly in the published bundles, matching their already-working behavior under the source-aliased vitest suite.
Tests
- Orchestrator public-API gate in pre-publish-check + release-smoke. New 2-test Playwright spec (
packages/core/src/compatibility/browser-tests/i18n-orchestrator-api.spec.ts, ~600 ms) assertstypeof window.__hyperfixi_i18n.register === 'function'in both shipped htmx bundles. Wired into.github/workflows/pre-publish-check.yml(fails the workflow on regression) and the--matrixstage ofexamples/release-smoke/run.mjs(so the gate fires against the registry-installed tarball, not only the locally-built dist). Surgical — no swap-pipeline dependency. The broaderi18n-htmx.spec.tsremains un-wired pending two pre-existing bugs unrelated to this release: a reactivity / notify-hook bug breaking localizedhx-livere-renders, and a swap-pipeline bug stringifyingDocumentFragments infetch ... as html→put it into target.