New: Added server-diff and --cacheage (fixes 3547)
fixes #3547
Speed up AAT compilation by only compiling when necessary and allowing javascript compilation caches to live for longer.
New
- Added
grunt server-diff:devwhich will only compile less, handlebars and javascript if those files are newer than their output and will only copy most files if they are also newer than their output - Allow the age of the javascript compilation cache to be changed from the command line using a millisecond integer at
grunt server-diff:dev --cacheage=1000000000000
Fixes
- Expanded newer configuration in javascript config to improve glob accuracy and increase speed
- Allowed schema and data load caching for schema-defaults task to increase processing speed
- Allowed the diff tasks to force build when switching from production to development and back
- Improved
grunt diffalong the same lines asgrunt server-diff
Notes
- The copy task is split so that the
replacetask always has a fresh@@directives to string replace https://github.com/adaptlearning/adapt_framework/blob/58340235b8bb2f401dfa4a24d4c131bd765deec3/grunt/tasks/server-diff.js#L11-L18 - The javascript caching seems stable enough to extend the life of the files beyond one week, this is now configurable at the terminal only. Each cached file can be 2.5mb+ in size, there is one per course and they will live on the system for the defined length of time.
Testing
- Setup
git clone https://github.com/adaptlearning/adapt_framework/ 3547-diff
cd 3547-diff
git checkout issue/3547
adapt devinstall && npm install
mkdir build/
cp -r src/course/ build/course/
grunt server-diff:dev --cacheage=2419200000
- Rediff no changes
grunt server-diff:dev --cacheage=2419200000
- Rediff with changes
grunt server-diff:dev --cacheage=2419200000
- Switch from development to production
grunt server-diff:build --cacheage=2419200000
Caveats
- A full rebuild
grunt server-buildis required for:- Files copied into the build output from plugins that are subsequently removed will not be cleared up
- Files copied in by spoor at scorm 1.2 will not be cleared when switching to scorm 2004
Looks slick 👍 @oliverfoster just remind me what was the reason for not using newer: on required files?
Looks slick 👍 @oliverfoster just remind me what was the reason for not using
newer:onrequiredfiles?
Ensuring that the @@ string replacement directives for the replace task work properly every time. Replace can only function on freshly copied original files where the directives haven't yet been replaced.
Like: https://github.com/adaptlearning/adapt-contrib-spoor/blob/df90b8dacbe8c20e12e1d57dfd1cdfc37de82903/required/index.html#L2
:tada: This PR is included in version 5.39.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: