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

Use EventTarget instead EventEmitter #85

Open
chrisguttandin opened this issue Feb 8, 2022 · 4 comments
Open

Use EventTarget instead EventEmitter #85

chrisguttandin opened this issue Feb 8, 2022 · 4 comments

Comments

@chrisguttandin
Copy link
Collaborator

As of recently Node.js supports the same (or similar) EventTarget as the browser. Since the Web Audio spec is also referring to the EventTarget in various places it might be worth considering to replace the current EventEmitter usage.

https://nodejs.org/dist/latest-v16.x/docs/api/events.html#eventtarget-and-event-api

@dy
Copy link
Member

dy commented Feb 8, 2022

If you'd like to take some features under your control - feel free. There's plenty of work tbd, you have great experience with it. I want to focus on dsp layer - it needs careful thought.

@chrisguttandin
Copy link
Collaborator Author

I gathered some further information. EventTarget is supported since v14.5.0 of Node.js but v12.x is still actively maintained until mid April. Maybe we should at least wait until then.

I discovered that web-audio-api claims to support Node.js v4+. Maybe that should be changed. :-) https://github.com/audiojs/web-audio-api/blob/master/package.json#L36

Should we switch from EventEmitter to EventTarget to implement the spec as close as possible or would you prefer to support both?

@dy
Copy link
Member

dy commented Feb 15, 2022

Nah, totally fine dropping old stuff. Not planning to do any backwards-compat. v1 should be fresh new, with ESM and good architecture.

@chrisguttandin
Copy link
Collaborator Author

I'm happy to hear that. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants