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

jQuery/requirejs should not be minified when cachejs is disabled

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.7
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-64684-master

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19

                Time Tracking

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