Skip to content

[SE-3401] Updates BuildTools UglifyJS configuration to be consistent on different machines - #274

Closed
nizarmah wants to merge 4343 commits into
masterfrom
nizar/update_tinymce_jakeconfig_juniper_3_backport
Closed

[SE-3401] Updates BuildTools UglifyJS configuration to be consistent on different machines#274
nizarmah wants to merge 4343 commits into
masterfrom
nizar/update_tinymce_jakeconfig_juniper_3_backport

Conversation

@nizarmah

Copy link
Copy Markdown

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:

jake minify bundle[themes:modern,plugins:advlist,anchor,autolink,charmap,code,codemirror,contextmenu,image,insertdatetime,link,lists,media,paste,print,save,searchreplace,table,textcolor,visualblocks]

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 different commons.js file hash on the different machines, which makes it not possible to use multiple instances with a load balancer.

There are other reasons why the commons.js file hash is different, which are mentioned in PR edx#24972
Therefore, this is a follow-up PR to openedx#24972.

This PR simply adds a specific configuration for uglify-js, which is:

mangle : {
	toplevel: false,
	sort: true
},
no_functions : false,
ascii_only: true,
compress: {
	cascade: false,
	comparisons: false,
	if_return: true
}

One of the most important is, sort which makes the mangled variable names consistent on different runs. Also, comparisons and if_return are 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:

  1. Change your directory to common/static/js/vendor/tinymce/
  2. Once you are there, run unzip ../../../../../vendor_extra/tinymce/JakePackage.zip
  3. Clear the existing using rm -rf node_modules
  4. Install the npm dependencies using npm install
  5. Run the jake command, mentioned below.
  6. Commit the changes since I didn't update the existing minified files.
  7. Run the jake command, mentioned below, again.
  8. Make sure no changes have been made to the files.
jake minify bundle[themes:modern,plugins:advlist,anchor,autolink,charmap,code,codemirror,contextmenu,image,insertdatetime,link,lists,media,paste,print,save,searchreplace,table,textcolor,visualblocks]

Author notes and concerns:

  1. Do you think it is better to update the minified files and commit those changes? Please let me know.

Reviewers

regisb and others added 30 commits May 6, 2020 18:39
The XBlockPackageStorage used to return offset-naive datetime objects
which were compared to offset-aware objects when we ran static asset
collection:

    ./manage.py lms collectstatic

Close CRI-191
* Fix all stylelint errors

For any errors that fixing would require changing the output of the css disable stylelint for that line instead of modifying.

* Update quality.py

Make stylelint quality check pass when there are no errors

* Delete empty selectors
…static-assets

Fix naive offset-naive/aware error in asset compilation [CRI-191]
…rollment-sync-support-tool

MST-181: Add the ability to unlink and relink Program Enrollments via Support Tool to Address SSO Issues
…querade-on-dates-tab

Enable masquerade on dates tab
…lated-text

Missing translation function call
Allows user to type in phone number in whichever
format they prefer.
Apply same username restrictions during SSO pipeline as we have user registeration flow to avoid SSO flow breakage at the time of user creation.
ENT-2730

Code quality fixes
Strip non-numeric characters from phone number
Constrain ddt<1.4.0 until this issue is fixed:
- datadriventests/ddt#83
…38-banner-debug

Revert "add logs for debugging"
* Commits:
  Revert "Add logging to Learning MFE iframe, temporarily"
…ring - removal happens post static validation
ENT-2730: Apply same username restrictions during SSO pipeline
SaadYousaf and others added 28 commits September 18, 2020 09:50
(cherry picked from commit 0631b4b)
(cherry picked from commit 4cbccce)
(cherry picked from commit e6a080e)
(cherry picked from commit 5157762)
(cherry picked from commit 71322bb)
(cherry picked from commit b5cee96)
(cherry picked from commit a36904e)
(cherry picked from commit e65874c)
(cherry picked from commit 893a01f)
Sustaining/security fixes 4

(cherry picked from commit e637704)
Sustaining/security fixes 5

(cherry picked from commit f87e1d2)
This is required to stop get_course_about_section
html content from using the edxnotes version of
get_html, which injects the edxnotes html into it.
We don't want this injected into the html here,
because these are snippets meant to be displayed
in original form on the course about page.
This fixes the error thrown when trying to download the list of all
users, staff and instructors from the Sysadmin dashboard
Jira ticket: SE-3248
Upstream pull request: openedx#25038
…vents

[SE-3248] Add progress_video event and update tests

Upstream pull request: edx#25038
* docs(lms and studio): Replace all .(lms|cms).(\w+|_)?\.json to .(lms|cms).(\w+|_)?\.yml
* refactor(lms): Update migrations to use lms.yml in the help text
…tion-juniper

SE-3243 Use original get_html for AboutBlock
…ashboard-csv-download-fix

[BB-3057] Use BytesIO as unicodecsv expects a bytestream, not unicode
…vents

[SE-3248] Update video progression events to 5-range instead of decade
Cherry pick fix for Studio file upload issues
@nizarmah nizarmah closed this Oct 10, 2020
@nizarmah

Copy link
Copy Markdown
Author

This is embarrassing 😳 I thought I updated the branch, but I guess my internet connection is too slow. Sorry everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.