Skip to content

feat(events): add layout listener overrides - #307

Draft
wpoortman wants to merge 6 commits into
mainfrom
feat/layout-listener-overrides
Draft

wpoortman wants to merge 6 commits into
mainfrom
feat/layout-listener-overrides

Conversation

@wpoortman

@wpoortman wpoortman commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve the original Portman-owned SupportEvents registration unchanged
  • register an independent SupportMagewireEvents adapter immediately after core events
  • support per-placement additions, handler replacements, and keyed false / null removals through magewire:listeners
  • keep all Magento layout and resolver knowledge outside Portman-owned files

Architecture

Active layout handlers are contributed during the adapter boot hook, before server calls and dehydration. Tombstoned dispatches are rejected by a pre-call guard, and the adapter later filters the initial browser listener effect during dehydration.

A dehydration-only overlay is insufficient because it changes browser subscriptions after SupportEvents has already authorized and resolved server dispatches. The ordered adapter preserves both sides without extending or replacing SupportEvents. If core events are disabled, the adapter skips itself.

Listener precedence remains component listeners, then On attributes, then the layout overlay. Tombstones are resolved before dynamic placeholders are expanded. Whole-map clearing and live post-mount reconciliation remain out of scope.

Verification

  • PHPUnit: 28 tests, 78 assertions
  • Playwright events spec: 5 tests
  • Magento dependency-injection compilation
  • Portman build with no SupportEvents diff
  • Mago lint and formatting checks
  • XML and PHP syntax checks

@wpoortman wpoortman added the V3 label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant