-
Bug
-
Resolution: Fixed
-
Minor
-
3.8.1
-
MOODLE_38_STABLE
-
MOODLE_39_STABLE
-
MDL-67449-master -
When we run `grunt amd` it is very slow. It should not be. There's a bug:
Every time we call the eslint or dist commands we are generating a list of files to work on. That list uses globstar (*) patterns like /amd/src//.j.
Ultimately these are slow and non-performant. We already have a list of all subsystems, and plugintypes, and we can easily turn that into a list of components (subsystems + plugins + subplugins). From there we can create a smaller list whcih, while still using the globstar format, has a much smaller surface area.
Whilst I discovered this with babel:dist, I also discovered that it applies to several other places, and there was some confusing behaviours too:
- eslint:amd suffered the same/similar issue
- eslint:yui suffered the same/similar issue
- stylelint:css suffered the same/similar issue
- stylelint:scss suffered the same/similar issue
- in a directory [path/to/component] the grunt command had different behaviours:
- grunt builds the whole of Moodle
- grunt watch watches just the current directory
- in a directory [path/to/component/amd] the grunt command had different behaviours:
- grunt builds only the current directory
- grunt watch claims to watch just the current directory but does nothing
Therefore I've taken the liberty of fixing these issues too. They all had a similar root cause and similar fix.