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

rework minify integration

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.6
    • 2.6
    • JavaScript, Libraries
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • w32_MDL-40995_m26_minifyreworked
    • Hide

      1/ run phpunit tests
      2/ enable js cache and disable theme creator mode
      3/ purge caches and verify the js and css served to browser (it should be minified the same way as before)
      4/ delete $CFG->dataroot/localcache and reload page, verify the JS and CSS cache files get recreated properly
      5/ test TinyMCE works
      6/ verify the YUI_config module stuff embedded in pages is minified

      Show
      1/ run phpunit tests 2/ enable js cache and disable theme creator mode 3/ purge caches and verify the js and css served to browser (it should be minified the same way as before) 4/ delete $CFG->dataroot/localcache and reload page, verify the JS and CSS cache files get recreated properly 5/ test TinyMCE works 6/ verify the YUI_config module stuff embedded in pages is minified

    Description

      There are some new problems when minifying CSS and JS:
      1/ js minify is now used from outputrequirementslib file for compression of YUI module info
      2/ the latest minify uses autoloader - it would slow down the rest of moodle
      3/ the unsetting of SERVER variable is a nasty hack that might potentially break some caching
      4/ minify is intended for direct CSS/JS file serving, but we need only the compression of files
      5/ in csslib we first minify and then replace our placeholders, this is wrong; minify works with files only but we do not want to create any temporary files there

      Proposed solution:

      • create new core_minify class
      • with methods ::css(), ::css_files(), ::js(), js_files()
      • use only as little as possible from minify
      • replace minify loader or unregister it after use

      Nota that this does not affect stable branches much, no need to backport.

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Andrew Lyons Andrew Lyons
              Sam Hemelryk Sam Hemelryk
              Michael de Raadt Michael de Raadt
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13