Skip to content
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] #9455

Closed
wants to merge 6 commits into from

Conversation

fayazara
Copy link
Contributor

@fayazara fayazara commented May 13, 2024

Replace the deprecated eventBus with mitt.js

Description

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  1. Made sure all the places we're listening to bus events are working as expected.
  2. Respective specsf or the events from mitt.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@fayazara fayazara self-assigned this May 13, 2024
@scmmishra scmmishra changed the title chore: Replace eventBus with mitt.js chore: Replace eventBus with mitt.js [CW-3275] May 15, 2024
Copy link

linear bot commented May 15, 2024

app/javascript/packs/mitt.js Outdated Show resolved Hide resolved
@fayazara fayazara marked this pull request as ready for review May 15, 2024 06:22
@fayazara fayazara requested a review from scmmishra May 15, 2024 06:30
@fayazara fayazara added the frontend Involves working with javascript ( Vue JS / CSS ) label May 15, 2024
@pranavrajs
Copy link
Member

@fayazara A couple of thoughts.

1/ Can we remove the usage of window.bus from the code? I don't think it is good to use the same interface anymore.
2/ Please check the widget side code as well. It is not updated there.

Copy link
Member

@pranavrajs pranavrajs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comment above.

@vishnu-narayanan vishnu-narayanan temporarily deployed to chatwoot-pr-9455 May 16, 2024 05:21 Inactive
@pranavrajs pranavrajs closed this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Involves working with javascript ( Vue JS / CSS )
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants