aolsenjazz / libsamplerate-js

Resample audio in node or browser using a web assembly port of libsamplerate.
Other
31 stars 8 forks source link

Lazy Load the glue module #120

Closed aolsenjazz closed 1 year ago

aolsenjazz commented 1 year ago

The big glue js module should be loaded lazily.

Lazy loading was added, then remove again in #119 because it cause the library to break when loaded via <script> tag. Can't imagine too many people are loading via script tag but this change isn't justified imo.

Problem was, ts was transpiling the async imports into requires, cause it to break in the above scenario. Shouldn't be too difficult to not-transpile that way, but I can't find it at the time of this writing.

aolsenjazz commented 1 year ago

This library now bundles the glue code with all of the other transpiled ts into two version: one for umd context and one for AudioWorklet contexts. As such, glue module cannot be lazy loaded anymore. Rip. Closing