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

Make Minify library optional via a theme config setting

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.2
    • Fix Version/s: None
    • Component/s: Performance, Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_38_STABLE

      Description

      It appears that the tree based post-processor can output a minified form of the CSS that it processes. It currently passes that output directly to another Minification library.

      It doesn't make sense to do two minifications where in both the entire file is broken down into small components and outputted again.

      Currently the tree-based post-processor is optional for LTR usage, it only runs if the current language is RTL or there's some post processing defined, like autoprefixer in the Boost theme.

      For Boost, and other themes that always use the autoprefixer, it probably makes sense to enable the minified output  from the post-processor, and then not call the Minifier at all.

      A more extreme option would be to simply switch all themes to use the postprocessor (since that's going to be true most of the time anyway). I'm thinking that probably makes sense as it reduces the number of combinations needed to QA and the Minification library has had a few very obscure bugs, I wouldn't want to debug those if they only showed up in an RTL mode. A test to see if pre-Boost themes are created noticeably faster or slower after switching might be the decider if it's opt-in or opt-out.

      MDL-68219 has the change to use sass output minification, which is related to this, but is at an earlier stage and is probably beneficial on it's own to reduce the size of the working set that is input to the later minification stages.

      We should probably look into the perfomance impacts of running the tree post processor on individual chunks of CSS.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bawjaws David Scotson
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Bas Brands
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: