Migrate IDE event bus to mitt
- Epic: &3172 (closed)
- Closes #216021 (closed)
What does this MR do?
As per our recommendations to prepare to migration to Vue 3, this removes the Vue event bus from the IDE code in favor of a mitt
-based solution.
This MR lays the groundwork for other migrations by providing an event hub factory to create a mitt
event bus that exposes the same methods as Vue-based event busses ($on
, $off
and $emit
). This makes migrating to the new approach as easy as changing the module that exports the event bus:
-import Vue from 'vue';
+import createEventHub from '~/helpers/event_hub_factory';
-export default new Vue();
+export default createEventHub();
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+.
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Paul Gascou-Vaillancourt