Use the IIFE source trick instead of hard-coding function sources#5
Use the IIFE source trick instead of hard-coding function sources#5atesgoral wants to merge 2 commits into
Conversation
|
Thanks for styling update! Biggest concern I have here is that, IIRC, in certain WebPack / TS environments and configs, errors will get thrown for Audio Worklets (as they're not available in browser context). The code will also get minified; breaking the functionality of the worklet. The fix is the hardcoded string (or to host the worklet separately as a vendor public file). Can you verify this compiles as expected in e.g. create-react-app / Next.js? If it does I'm cool with it -- much prefer the syntax highlighting, etc. My solution here was only a hack around specific environment setups. |
|
@keithwhor Will check! TBH, I YOLO made these changes without any testing. Was at the brink of throwing in some test config for some rudimentary smoke tests. Or perhaps an examples/kitchen-sink.html file. |
|
Moved styling stuff to #6 |
This is a quality of life improvement that also reduces the size of the minified bundle by ~25%.
Please view white-space-agnostic diff: https://github.com/keithwhor/wavtools/pull/5/files?diff=split&w=1
Hard-coding function sources as strings:
This PR moves worklet code into worklet functions that will get immediately executed (IIFE) within the workers.
Before:
After:
Also, package-lock.json is stuck on an older package.json version. The first commit updates that.
Also updating Prettier rules to enable trailing commas, which seems to be the prevalent convention in this repo.