Skip to content

v1.5.0 — ESM rollup output + cwm-lint-deprecations

Choose a tag to compare

@bcordis bcordis released this 15 Jun 22:34
· 4 commits to main since this release

Additive, fully backward-compatible.

Added

  • ESM output from the shared Rollup config — unblocks first-class JoomlaDialog. templates/rollup.config.js now picks output format by source suffix: *.es6.js still emits an IIFE bundle (every existing consumer builds exactly as before), while a new *.es6.mjs source emits an ES module (format: 'es'). In module builds, bare joomla.* specifiers (e.g. import JoomlaDialog from 'joomla.dialog') are marked external, so the import survives to the browser and Joomla's import-map resolves it at runtime. An IIFE bundle inlines everything and structurally cannot carry a live external ESM import — which is why consuming JoomlaDialog (or any Joomla JS module API) was previously impossible without hand-writing an unbundled module. Register the built file as a type="module" asset in joomla.asset.json. Extra externals (e.g. vue) via the MODULE_EXTERNALS env var.

  • cwm-lint-deprecations — flags Joomla 6/7 upgrade blockers in source. New CI-gating scanner (composer lint-deprecations) reporting file:line for bootstrap.modal assets, data-bs-toggle="modal" markup, legacy {handler: 'iframe'} modal links, the removed Joomla.Modal JS API, and jQuery globals. Exits non-zero on any finding (or --warn to report without failing). Skips vendor/, node_modules/, build/, dist/, *.min.js. cwm-init now offers to wire it into consumers.

Migration

No action required for existing builds (the old template ignores *.es6.mjs, so adopting it is safe to stage ahead of upgrading). To use JoomlaDialog: name the source <thing>.es6.mjs, import JoomlaDialog from 'joomla.dialog', and register the built <thing>.js as "type": "module". Note JoomlaDialog.confirm()/alert() are Promise-based, not synchronous like native confirm(). Run composer lint-deprecations to find Bootstrap-modal usages to migrate.