After discussion with email@example.com over on
MDL-65943, I'm going to add some discussion now regarding making a broader wasm loading mechanism, given the introduction of lib/wasmlib.php in that issue and the existence of MDL-72136. Such a change would be master-only and probably not for 4.0 (though perhaps should be).
Rather than creating a loader mechanism (like ogvloader.php introduced in
MDL-65943) for each implementation, in the future I feel that we probably need some shared loader. I'm not sure whether this is WASM-specific, or whether we need a more general JS format, capable of loading these files (including wasm).
I'll suggest a few basics, and if there's enough interest we should look to take it further and update the ogvloader in videojs too.
- I think we need to put all such files into a js directory within the component. That may be further sub-dired into js/wasm. Really this should have been done with amd and perhaps we should migrate all amd directories to js/amd too (not too tricky to do this)
- I think we need to be able to intelligiently serve:
- JS related to WASM
- JS which must not be modified for some other reason
- Possibly other related content? I'm not sure what, but dependencies such as images may need to be considered
- Caching and cache busting is a must - note: This is likely just etag, and server-side caching may not be required.