-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
4.0
-
None
-
MOODLE_400_STABLE
After discussion with huongn@moodle.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).
I'm going to loop in timhunt and toanlam here who have been working on MDL-72136.
Essentially we have several places now where we need to be able to load JS and WASM content which is not suitable for any of our existing loaders (i.e. requirejs, YUI, javascript.php) because they must not be modified and/or they are not JS files (e.g. WASM).
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:
- WASM
- 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.