-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
WIP: Modernize howler.js to use native ES modules, export TypeScript definitions, and use a modern build system #1518
base: master
Are you sure you want to change the base?
WIP: Modernize howler.js to use native ES modules, export TypeScript definitions, and use a modern build system #1518
Conversation
…ll tests! TypeScript makes large refactors like this one so much easier!
…! Needs thorough testing for other browsers, but this is a promising start!
sound1.mute(true, id); | ||
|
||
label.innerHTML = 'MUTE'; | ||
setTimeout(fn, 1500); | ||
}, | ||
|
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.
Muting with Web Audio API
doesn't work in Firefox 93 for windows.
Interestingly enough, the 2.x
version of the library + tests doesn't work in Firefox either!
In Chrome 94, both the 2.x
and 3.x
versions work as expected.
Could this be a general bug that is related to the implementation details, rather than the refactoring?
This is great. It seems to me that howler.js is dead, but if you will continue this work, it would be useful to many. It might not get merged into Howler.js, but if not, I personally will make a new fork of howler.js (with many unmerged PR there also merged, but yours especially as starting point). So please continue, your work will help many. |
@profispojka By no means is howler.js dead. It is a mature library that doesn't need lots of changes all the time, but that doesn't mean work isn't continuing on it. |
Thanks for answering my comment, @goldfire. Sorry to make an incorrect assumption about the state of the library. I checked PRs and some of them were waiting for your action for years, so I assumed Howler is dead. Still many great features (for me essential ones) are unmerged, so a new fork might be a way for me. |
@goldfire - Six months later, and Howler still doesn't work properly in modern browsers. It clearly needs a lot of changes at this time. |
Hi @7ombie . I have forked the project and published a npm package called loudest. I have merged some pending pull requests, mainly effects, but any new PRs and overall support would be welcomed. @Greenheart |
Hey @profispojka - Nice work. My issue was the lack of a modern ES6 module. Like many people, I'm a web developer, but not a JavaScript programmer. We don't really use Node, NPM, Webpack or anything like that. It seemed odd for a project that promotes its use in the browser, but can't be |
In case it will be of interest to anyone in this thread: I have my own library called |
@goldfire This feature would still be very useful when using howler in typescript projects, do you think there is any chance of implementing this into the main branch someday? :) |
Hi! Thanks for creating and maintaining this library for so many years! It's clear this has provided immense value to developers all over the world 😄
However, I need native ESM modules for one of my projects, which got me thinking. I didn't want to develop another library like howler.js from scratch (because of all the browser quirks you've already solved and tested here). But I couldn't stick to using the Common JS exports of
[email protected]
.So I spent this entire day refactoring the core
howler.js
library into native ES modules, ES classes, upgraded to a modern build system usingesbuild
, slightly improved the test setup usingvite
, added native TypeScript definition files, and kept the original public API as well as private implementation details almost entirely intact.And... After many many hours, on literally the second test run, I got the full test suite for both
Web Audio
andHTML5
to run successfully!!! This is a extremely promising start 😄This was made possible thanks to the mostly complete TS definitions from @types/howler, the JS Doc comments and good initial structure in the howler.js codebase, and most importantly - the immense value from using the TypeScript compiler to provide hints during refactoring projects like this one. TypeScript provided a clear progress to see what remained to fix, which was really nice.
Next steps
2.x
build output in/dist
.I'd be happy to keep improving this, but I'll need help to test, review and prepare for the 3.0 release. Any feedback and help would be greatly appreciated! :)