Repository navigation
Conversation
Vue 3 removes $on/$off/$once, so Text and Slug can no longer talk over $root. They now use a typed mitt bus, which works the same on Vue 2.7 and Vue 3. Events and payloads are unchanged. Both components now unsubscribe before they are destroyed; the $root listeners were never removed.
Mounts Slug and Text side by side over the real event bus, so the link between them is covered end to end: a new record's slug follows its title, and so does a localised record's while its title is empty. An existing one does not until it is generated, Edit or Locked stops it, and generating again resumes it. A slug built from several fields joins them, and removing a text field elsewhere, as a collection re-render does, leaves the link intact.
Vondry
force-pushed
the
refactor/mitt-event-bus
branch
from
October 26, 2026 09:59
ff7930e to
64ae3cd
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Next step in splitting #3751 towards Vue 3.
Why
The Text and Slug fields keep the slug in step with the title by sending events over
this.$root.$emit/$on. Vue 3 removes$on/$off/$once, so this link breaks on upgrade whatever else is ready.Why mitt
What changed
assets/js/app/eventBus.tsholds the bus, with the same events and payloads as before. Behaviour is unchanged.$rootlisteners were never removed.SlugTextIntegration.spec.tscovers the slug ⇄ title flows end to end, as a baseline for the Vue 3 port.Afterwards, the only bus change left for #3751 is
beforeDestroy→onBeforeUnmount.Note for extensions: a script emitting these events on the editor's
$rootno longer reaches the fields. Vue 3 removes$root.$emitanyway.Testing