[SE-3401] Updates JakePackage.zip to make JS minification consistent across different machines - #275
Merged
nizarmah merged 4 commits intoOct 18, 2020
Conversation
1 task
nizarmah
force-pushed
the
nizar/update_tinymce_jakeconfig_juniper_3_backport
branch
from
October 11, 2020 11:35
e653767 to
1615ce9
Compare
nizarmah
marked this pull request as draft
October 11, 2020 22:43
nizarmah
force-pushed
the
nizar/update_tinymce_jakeconfig_juniper_3_backport
branch
2 times, most recently
from
October 12, 2020 02:24
7daf6a6 to
4b62249
Compare
Jake clean is updated in order to not delete the plugin.min.js for 'image' and 'media' plugins because these plugins do not have a 'plugin.js' to create the minified file from. Also removes 'outputMinified' for the 'minify' tasks that are included with the 'minify-plugin' so that the minification is done through uglify instead (to keep things uniform and consistent).
nizarmah
marked this pull request as ready for review
October 12, 2020 02:28
… Dependencies Installation
nizarmah
force-pushed
the
nizar/update_tinymce_jakeconfig_juniper_3_backport
branch
from
October 13, 2020 11:55
6a19271 to
c4f2bfd
Compare
nizarmah
deleted the
nizar/update_tinymce_jakeconfig_juniper_3_backport
branch
October 18, 2020 08:56
nizarmah
added a commit
that referenced
this pull request
Oct 18, 2020
…across different machines (#275) * Updates jake Clean task and BuildTools Uglify options Jake clean is updated in order to not delete the plugin.min.js for 'image' and 'media' plugins because these plugins do not have a 'plugin.js' to create the minified file from. Also removes 'outputMinified' for the 'minify' tasks that are included with the 'minify-plugin' so that the minification is done through uglify instead (to keep things uniform and consistent). * Specifies Version of Dependencies and Adds package-lock.json for easy Dependencies Installation * Cleans TinyMCE minified themes javascript files to consistently re-minify them * Adds a new task to Jakefile to clean JS only
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When generating the minified files for the TinyMCE static files using the
vendor_extra/tinymce/JakePackage.zip, there's often a problem that was happening where the files are different after running the following command:This becomes an issue when installing a new TinyMCE plugin on different machines and re-running
jake minify bundle, because the files are not consistent on different machines. This results in a differentcommons.jsfile hash on the different machines, which makes it not possible to use multiple instances with a load balancer.Some of the issues are,
amdlccompiles the minified output for a plugin, and thenuglify-jsdoesn't update the file. Therefore, removed the minification process from theamdlcstep and reverted minification touglify-js.This PR simply adds a specific configuration for
uglify-js, which is:One of the most important is,
sortwhich makes the mangled variable names consistent on different runs. Also,comparisonsandif_returnare specified because they were sometimes applied, while others times, they weren't.JIRA tickets: SE-3401, SE-3101, SE-3381
Upstream PR: edx#25324
Testing instructions:
common/static/js/vendor/tinymce/unzip ../../../../../vendor_extra/tinymce/JakePackage.ziprm -rf node_modulesnpm installnpx jake cleanplugin.min.jswere generated correctly using:grep -Er "^undefined$".Author notes and concerns:
Files changed:
package.json:"repository": { - "type" : "git", - "url" : "https://github.com/tinymce/tinymce.git" + "type": "git", + "url": "https://github.com/tinymce/tinymce.git" }, "description": "TinyMCE rich text editor", "author": "Johan Sörlin <spocke@moxiecode.com>", - "bugs": { "url" : "http://www.tinymce.com/develop/bugtracker.php" }, + "bugs": { + "url": "http://www.tinymce.com/develop/bugtracker.php" + }, "private": true, "engines": { - "node" : ">=0.10.26" + "node": ">=0.10.26" }, "devDependencies": { - "jake": ">= 0.7.0", - "amdlc": ">= 0.0.2", - "jshint": ">= 2.1.4", - "eslint": ">= 0.4.2", - "uglify-js": ">= 2.0.0", - "glob": ">= 3.1.12", - "moxie-zip": ">= 0.0.1", - "less": ">= 1.3.1", - "coverjs": ">= 0.0.14" + "jake": "0.7.10", + "amdlc": "0.1.2", + "jshint": "2.4.4", + "eslint": "0.4.5", + "uglify-js": "2.4.13", + "glob": "3.2.9", + "moxie-zip": "0.0.3", + "less": "1.7.0", + "coverjs": "0.0.14" },package-lock.json+ everything...Jakefile.jstools/BuildTools.jsReviewers