-
Improvement
-
Resolution: Fixed
-
Blocker
-
3.9.12, 3.10.9, 3.11.5
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
-
MDL-73915-master-terser -
Since September 2018 (MDL-63346):
- This policy will be applied to ALL supported branches, normal and security-only.
- This policy won't update any tool per se, unless strictly needed by nodejs/npm own dependencies/changes. It won't include npm audit changes either. Those are handled apart. So, normally, only changes to .nvmrc and package.json will happen. That will be achieved by:
- update .nvmrc to the new version.
- run nvm install && nvm alias default node && nvm use to install, set it as new default and use it for the next steps.
- update package.json and set engines to the new restriction (>= new version and < next major).
- When needed to bump components or run some audit, a new issue, similar to this, will be created and these steps performed in order to get a renewed npm-shrinkwrap.json file:
- remove node_modules & npm-shrinkwrap.json
- npm cache clear --force
- npm install
- npm shrinkwrap
- In any case, simple update or complete components bump, run grunt and verify that all the generated css/js/map stuff remains the same. If there are differences in the generation... it will need to be analysed and decided if:
- accepted (so everything, shrinkwrap and generated css/js/map) lands [or]
- not accepted (and only change .nvmrc and package.json) instead).
- The resulting branches will be sent to github (or similar), making a peer-review request here so both travis and cibot will verify that all them pass ok.
- Changes will be normally integrated and the NodeJSVersion template and NodeJSExactVersion templates will be updated with latest information in the Docs.
- TODO (MDLSITE-5536): A job @ CI servers will be, daily, using latest lts/current version to detect if there are npm-shrinkwrap.json changes. It will fail when that happens and inform integrators. Jumps to lts/next will be detected manually,.
I'm raising this issue because of some problems with our current build identified in MDL-71708.
Essentially, our current minification options include an option called mangle (on by default) which in some situations can cause broken JS to be generated. We don't know if/when this may crop up, and the relevant project seems to be abandoned.
Unfortunately disabling the mangle option causes minified files to be changed, which is something that we try to avoid because it messes with third-party developers and their build processes.
Given the combination of these things I think that we need to:
- update the Grunt JS config to set the mangle option to false
- update our NodeJS version to the latest LTS (16.14.0)
- update our package versions
This has the following effects:
- updates all built JavaScript (YUI and AMD)
- replace the current babel-minify plugin with a supported minification system (terser)
This combination fixes the issue blocking MDL-71708.
I believe we should apply this to master, and stables so that all versions of Moodle have the same NodeJS version support as per policy.
For master I think we should consider dropping support for IE and adjusting our browser compatibility list accordingly to:
- remove IE
- update the browser usage restriction to cover the top 0.3% instead of 0.25 (this removes support for Android 4.4 released in October 2013)
This combinations of things will:
- drop use of many of the legacy polyfills for things like for...of, and async
- which makes debugging async functions much much easier
This was agreed in MDLSITE-6109 back in August 2020, and was intended to happen in the Moodle 3.10 release. This was not done at the time (due to time constraints).
Because of this change there will be build output changes in third-party plugins. We do try to avoid this wherever possible but sometimes it is unavoidable. We technically can get away with not modifying minified files, but the older our babel packages get the harder it becomes to upgrade in the future. We will be supporting Moodle 3.9 until May 2023, and it makes more sense to make this change to Moodle 3.10 so that all versions from 3.9 to 3.11 have the same build process, and Moodle 4.0 has the same process but with IE support dropped.
- blocks
-
MDL-71708 Upgrade Chart.js to 3.8.0
- Closed
-
MDL-71714 Upgrade VideoJS to latest version
- Closed
- has a clone
-
MDL-75012 Bump nodejs from lts/gallium to stable (>=v18.x.x, now lts/hydrogen)
- Closed
- has to be done before
-
MDL-74301 Upgrade Eslint and audit rules
- Closed
- is a clone of
-
MDL-72623 Bump nodejs from v14.15.0 to current v14.18.0
- Closed
- will help resolve
-
MDLSITE-6109 Drop support for IE11
- Closed
- links to