-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Replace eventBus with mitt.js [CW-3275] #9539
Conversation
Refactor code to replace usages of the deprecated `bus.$emit` with the new `this.$emitter.emit` method for better event handling and consistency across the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Can you please replace all the 'newToastMessage' with the alert mixin?
I am replacing showing toasts with alertMixin instead of bus emits, however skipped these two files, added comments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny change, the rest is good to go.
Some issues with showAlert running in loops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fayazara there are instances where we have potential infintie loops, where showAlert
is already a function defined in the component, and then the mixin is added which calls showAlert
again. PTAL
@scmmishra this was a really good catch. Some of these methods were doing more than just showing alerts, hence renamed them to showAlertMessage. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Replace the deprecated
eventBus
with mitt.jsDescription
Since eventBus and it's respective methods are deprecated and removed from all future releases of vue, this was blocking us from migrating. This PR replaces eventBus with mitt. I have created a wrapper mitt.js to simulate the same old event names so it's backwards compatible, without making a lot of changes.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: