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

jQuery/requirejs should not be minified when cachejs is disabled

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.7
    • 3.7
    • JavaScript
    • MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-64684-master
    • Hide
      1. Open up browser dev tools
      2. Open the Network tab
      3. Ensure that $CFG->cachejs is set to true
      4. Open any page in Moodle
      5. Find the jquery-3.2.1 file in the Network tab (filter by JS files only, or just search)
        1. Confirm that the filename includes .min.js
        2. Confirm that the content is minified, and is difficult to read
      6. Find the requirejs file in the Network tab (filter by JS files only, or just search)
        1. Confirm that the filename includes .min.js
        2. Confirm that the content is minified, and is difficult to read (you can check the content by clicking the filename, then opening the Response tab for the fille)
      7. Update $CFG->cachejs and set it to false
      8. Refresh the page
      9. Find the jquery-3.2.1 file in the Network tab (filter by JS files only, or just search)
        1. Confirm that the filename does not include .min.js
        2. Confirm that the filename does not include .js
        3. Confirm that the content is not minified, and is readable
      10. Find the requirejs file in the Network tab (filter by JS files only, or just search)
        1. Confirm that the filename does not include .min.js
        2. Confirm that the filename does not include .js
        3. Confirm that the content is not minified, and is readable
      Show
      Open up browser dev tools Open the Network tab Ensure that $CFG->cachejs is set to true Open any page in Moodle Find the jquery-3.2.1 file in the Network tab (filter by JS files only, or just search) Confirm that the filename includes .min.js Confirm that the content is minified, and is difficult to read Find the requirejs file in the Network tab (filter by JS files only, or just search) Confirm that the filename includes .min.js Confirm that the content is minified, and is difficult to read (you can check the content by clicking the filename, then opening the Response tab for the fille) Update $CFG->cachejs and set it to false Refresh the page Find the jquery-3.2.1 file in the Network tab (filter by JS files only, or just search) Confirm that the filename does not include .min.js Confirm that the filename does not include .js Confirm that the content is not minified, and is readable Find the requirejs file in the Network tab (filter by JS files only, or just search) Confirm that the filename does not include .min.js Confirm that the filename does not include .js Confirm that the content is not minified, and is readable

    Description

      Right now if I need to debug my JS I set cachejs to 0. This stops minification and caching of those files. Great!

      But... jQuery and requireJS are still minified, which can make debugging rather tricky.

      This issue seeks to stop minifying jquery, jquery-ui, and requirejs when cachejs is disabled, inline with everything else.

      Attachments

        Activity

          People

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Michael Hawkins Michael Hawkins
            Jun Pataleta Jun Pataleta
            Anna Carissa Sadia Anna Carissa Sadia
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              20/May/19

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m