XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: As always, recommend having the developer toolset open
      Note: This must be tested with developer modes ($CFG->debug) both enabled and disabled

      • Open various pages
        • Confirm that all JS resources are loaded correctly through yui_combo.php
      • When developer mode is disabled:
        • Confirm that the URL for all moodle JS loaded through yui_combo.php have -min.js on the end of the filename
        • Confirm that non-shifted files (everything but tooltip) are *not minified (there is no minified version)*
        • Confirm that tooltip *is minified*
      • When developer mode is enabled:
        • Confirm that the URL for all moodle JS loaded through yui_combo.php do not have -min.js on the end of the filename
        • Confirm that none of the JS loaded through yui_combo.php is minified
      • Navigate to a course enrolment page
      • Open your Network tab and clear the current state (to make your life easier)
      • Open the role quick add page
        • Confirm that the popup was displayed correctly
        • Confirm that a call to yui_image.php was made and returned with a 200 error code, and a valid image
        • Confirm that the [X] icon in the top-right corner was displayed correctly
      • Restrict the Network tab to JavaScript
      • Log out and navigate to the Login page
        • Confirm that moodle-core-tooltip loaded successfully in your browser
        • Confirm that a minified version was loaded if debugging was not enabled
        • Confirm that a non-minified version was loaded if debugging was enabled
        • Confirm that clicking on the [?] icon brings up the help popup correctly
      Show
      Note: As always, recommend having the developer toolset open Note: This must be tested with developer modes ($CFG->debug) both enabled and disabled Open various pages Confirm that all JS resources are loaded correctly through yui_combo.php When developer mode is disabled: Confirm that the URL for all moodle JS loaded through yui_combo.php have -min.js on the end of the filename Confirm that non-shifted files (everything but tooltip) are *not minified (there is no minified version)* Confirm that tooltip *is minified* When developer mode is enabled : Confirm that the URL for all moodle JS loaded through yui_combo.php do not have -min.js on the end of the filename Confirm that none of the JS loaded through yui_combo.php is minified Navigate to a course enrolment page Open your Network tab and clear the current state (to make your life easier) Open the role quick add page Confirm that the popup was displayed correctly Confirm that a call to yui_image.php was made and returned with a 200 error code, and a valid image Confirm that the [X] icon in the top-right corner was displayed correctly Restrict the Network tab to JavaScript Log out and navigate to the Login page Confirm that moodle-core-tooltip loaded successfully in your browser Confirm that a minified version was loaded if debugging was not enabled Confirm that a non-minified version was loaded if debugging was enabled Confirm that clicking on the [?] icon brings up the help popup correctly
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:

      Description

      As raised in discussion on the General Developer Forum at https://moodle.org/mod/forum/discuss.php?d=217450, shifter has some great benefits that I feel we should explore.

      In summary these benefits include:

      • minification of JS;
      • metadata creation which we can use for dependency management to inform loader configuration and reduce page waterfalls;
      • linting of JS code using the same tools as the YUI team use themselves;
      • the ability to run JS tests and code coverage; and
      • the ability to leave various logging in place within debug versions of code to aid debugging.

      Of course, all of this is not free and it does require that developers install the shifter tool on their machines. This itself requires [node.js](http://nodejs.org), though nodejs can be installed using [composer](https://packagist.org/packages/nervo/node).

      Also, unfortunately the change prevents direct use of the source JS files without them going through some form of build process. This can be achieved easily with shifter which has a --watch function to build files as they change. Additionally, it is possible to perform the basic build process within the YUI loader to allow users to make some basic changes if they wish (but only in jsrev = -1 mode).

      Such a change would not be mandated for non-core modules, but I believe that we should try and get all core modules to move to the new system ASAP. The major benefit here is Linting which would likely improve our computability with some older browsers. Through changes to the YUI combo loader, it's possible to support both methods with the new YUI module method being used in preference.

      We would of course need to update our documentation to support developers, though this is something that we really need to do for JS anyway.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13