Adyen / lume

Lume is a component library for visual representations of data, built for Vue with D3.
https://lumedataviz.com
MIT License
37 stars 1 forks source link

Drop event bus approach to propogate Vue 2 internal events #331

Closed govind-srinidhi closed 7 months ago

govind-srinidhi commented 7 months ago

Problem description

The event bus approach to propagate Vue 2 events has certain problems in the way consumers are setup.

Currently Lume tries to access the default Vue instance and then uses it to instantiate event bus. The Vue instance in Lume is accessed in the following way:

const Vue = (await import('vue')).default;

But this way may not be okay for Vue 2 with webpack bundler consumer and it expects the Vue default component to be available as below: const Vue = (await import('vue')).default.default;

To get rid of this all together, its better to not have to use event bus itself and replace it with custom events.

Reproduction URL

No response

Reproduction steps

Access the Lume consumer with Vue 2 webpack bundler - on every hover of bar chart we see the following console error:

Screenshot 2023-11-13 at 11 23 56

Expected behavior

Should be able to listen to the internal events from the root and the console error should no longer occur.

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

Firefox, Chrome, Safari, Microsoft Edge, Opera

OS

Windows, Linux, Mac

Validations