Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72832

Create new JS loader for WASM and related JS


    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.0
    • JavaScript
    • None

      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.

      1. 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)
      2. I think we need to be able to intelligiently serve:
        1. WASM
        2. JS related to WASM
        3. JS which must not be modified for some other reason
        4. Possibly other related content? I'm not sure what, but dependencies such as images may need to be considered
      3. Caching and cache busting is a must - note: This is likely just etag, and server-side caching may not be required.

            Unassigned Unassigned
            dobedobedoh Andrew Lyons
            2 Vote for this issue
            3 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.