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

Allow YUI modules to support loading of submodules

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      These are mostly a rehash of the instructions in MDL-40477, but submodules should now be correctly pathed:

      Note: You must check this with both jsrev = -1; and jsrev unset in your config file.

      Note: Have your JS console open for ALL testing here and be on the look out for any related errors

      • Generally check pages in Moodle
      • Confirm that there were no (new) JS errors on the page
      • Confirm that there all JS was correctly loaded by the YUI loader
      • Check the results of calls to theme/yui_combo.php
        • Confirm that the results had content
      • In the JS console run a few additional calls and check that the output in the Network console is appropriate:

        YUI().use('MODNAME');
        

        where modname is in:

      • moodle-core-notification
      • moodle-core-chooserdialogue
      • moodle-course-modchooser
      • moodle-calendar-eventmanager
      • moodle-calendar-eventmanager-skin
        And the following should be retrieved with an appropriate path (though no content yet):
      • moodle-core-notification-withsubmodule
      • moodle-core-notification-withsubmodule-skin

      Note, appropriate path should be in the format:

      Show
      These are mostly a rehash of the instructions in MDL-40477 , but submodules should now be correctly pathed: Note: You must check this with both jsrev = -1; and jsrev unset in your config file. Note: Have your JS console open for ALL testing here and be on the look out for any related errors Generally check pages in Moodle Confirm that there were no (new) JS errors on the page Confirm that there all JS was correctly loaded by the YUI loader Check the results of calls to theme/yui_combo.php Confirm that the results had content In the JS console run a few additional calls and check that the output in the Network console is appropriate: YUI().use('MODNAME'); where modname is in: moodle-core-notification moodle-core-chooserdialogue moodle-course-modchooser moodle-calendar-eventmanager moodle-calendar-eventmanager-skin And the following should be retrieved with an appropriate path (though no content yet): moodle-core-notification-withsubmodule moodle-core-notification-withsubmodule-skin Note, appropriate path should be in the format: http://tangerine.local/moodle/theme/yui_combo.php?moodle/-1/core/notification/notification-withsubmodule-debug.js http://tangerine.local/moodle/theme/yui_combo.php?moodle/1372617447/core/notification/notification-withsubmodule-min.js http://tangerine.local/moodle/theme/yui_combo.php?moodle/-1/core/notification/notification-withsubmodule.css http://tangerine.local/moodle/theme/yui_combo.php?moodle/1372617447/core/notification/notification-withsubmodule.css
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:

      Description

      To facilitate breaking up a few YUI modules into smaller, more manageable components, it would be really helpful to properly support submodules properly within our loader.

      This will enable us to break apart things like:

      • moodle-core-notification into:
        • moodle-core-notification
        • moodle-core-notification-alert
        • moodle-core-notification-confirm
        • moodle-core-notification-chooser
        • moodle-core-notification-tooltip
      • moodle-core-dock into:
        • moodle-core-dock
        • moodle-core-dock-loader
      • moodle-course-dndupload into:
        • moodle-course-dndupload
        • moodle-course-dndupload-loader

      And other similar changes. This will help us to make some modules accessible more easily in smaller chunks. For example: We rarely make use of moodle-core-notification-alert, but it is a type of notification. The notification module is used in almost every page of Moodle (e.g. for help tooltips). Breaking it apart would allow us to selectively load it reducing our bandwidth potential massively.

      It also allows for easier provision of a tiny loader which can check functionality before loading the full module. Sam Hemelryk has proposed such a design in his conversion of the dock to YUI. I have a similar plan in mind for the conversion of course dndupload. Rather than loading the full 13k of minified js, we load 300bytes which load the full content only if required on that page. This will help us to not download large amounts of content for devices which simply cannot support the functionality - e.g. mobile devices where displaying the dock makes little to no sense and don't typically support any drag and drop upload.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13