Skip to content

Allow some minification through the source urls #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2015

Conversation

Martii
Copy link
Member

@Martii Martii commented Dec 23, 2015

  • EXPERIMENTAL ES5 minification via url ... Uses same routes but .min prefix on extension. If ES6 is encountered it should just not minify.

NOTES

  • ES6 minification isn't supported/stable yet but will probably request an experimental branch on express-minify (NFR: Experimental branch for *UglifyJS2*  breezewish/express-minify#42) or something else
  • This is on a trial basis to see how much interest and possible clobbering happens... UglifyJS2 claims stable support with ES5 ... this will test that. Authors should recommend debugging against original source but with a notation that minified may or may not work.
  • Fix installName vs installNameSlug references #819 followup with renaming external urls
  • Debug mode of course won't use express-minify currently so nothing should happen on these routes.. this is being reevaluated.
  • BUG fix for libraries sharing same S3 storage space (as userscripts) when ending in a reserved extension from (same) script name
  • BUG fix for the regular expression allowing some urls without 404

Applies to #432

* **EXPERIMENTAL**  ES5 minification via url ... Uses same routes but `.min` prefix on extension. If ES6 is encountered it should just not minify.

**NOTES**
* ES6 minification isn't supported/stable yet but will probably request an experimental branch on *express-minify* or something else
* This is on a trial basis to see how much interest and possible clobbering happens... *uglifyjs2* claims stable support with ES5 ... this will test that. Authors should recommend debugging against original source but with a notation that minified may or may not work.
* OpenUserJS#819 followup with renaming external urls
* Debug mode of course won't use *express-minify* currently so nothing should happen on these routes.. this is being reevaluated.

* BUG fix for libraries sharing same S3 storage space when ending in a reserved extension from script name
* BUG fix for the regular expression allowing some urls without 404

Applies to OpenUserJS#432
@Martii Martii added bug You've guessed it... this means a bug is reported. enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. UI Pertains inclusively to the User Interface. CODE Some other Code related issue and it should clearly describe what it is affecting in a comment. needs mitigation Needs additional followup. labels Dec 23, 2015
Martii added a commit that referenced this pull request Dec 23, 2015
Allow some minification through the source urls

Auto-merge
@Martii Martii merged commit 0f10fc3 into OpenUserJS:master Dec 23, 2015
@Martii Martii deleted the Issue-432trialES5 branch December 23, 2015 00:57
@Martii
Copy link
Member Author

Martii commented Dec 23, 2015

Some misc mass storage stats for script(s) that minify:

script name raw uglified defaults percentage
oujs - Meta View 29881 B 17332 B ~41% smaller
oujs - JsBeautify 5429 B 3593 B ~33% smaller
GM_config Unit Test 11453 B 6729 B ~41% smaller
GM_config 25225 B 15004 B ~40% smaller
SaveTube 72014 B 39466 ~45% smaller

If a script has a bunch of comments it won't minify much currently... since those should be currently kept... an option in the future could be to not keep the comments and then regenerate the captured metadata blocks... just a thought.

Martii pushed a commit to Martii/OpenUserJS.org that referenced this pull request Dec 23, 2015
…es but .min prefix on extension. If ES6 is encountered it should just not minify.

* Pluralization fix on comment
* Will add url to library homepage after trial... haven't thought that far ahead on that part of the UI.

Followup for OpenUserJS#858 and applies to OpenUserJS#432
Martii pushed a commit to Martii/OpenUserJS.org that referenced this pull request Dec 24, 2015
* New dep for HTML5 copy to clipboard
* Serve this dep statically to the DOM
* Add button for Copy raw *(native)* URL to clipboard button
* **EXPERIMENTAL** Copy minified URL to clipboard button ... same color as label for .user.js denoting experimental for now
* Tint the `input-group` class a little darker for better distinction when inputs are disabled
* BUG FIX: Disable editing in the input box for the library URL
* Add missing "X" mustache objects to accommodate all of this from OpenUserJS#858

**NOTES**
* TODO: Finish off the jQuery notifications... having issues with *jQuery* and *bootstrap* not reassigning tooltip text dynamically... will get to this after the holidaze.
* Linux Opera Presto does **not** support HTML5 Copy to Clipboard structures... however one can still copy the text and type `// @require`
* This is needed to potentially avoid possibly hazardous flash scripts that are already in use... also Adobe deprecated Flash.
* Icon sets are limited on choices... also have some other "copy" icons which may give a better distinction but need to ponder some on this... in the meantime use **first** glyphicon from *bootstrap* and *octicons* clipboard icons
* Not sure when an `error` will occur but disable both of these if it happens... will need to have someone report if problematic.

Applies to OpenUserJS#432
@Martii Martii removed the needs mitigation Needs additional followup. label May 15, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug You've guessed it... this means a bug is reported. CODE Some other Code related issue and it should clearly describe what it is affecting in a comment. enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. UI Pertains inclusively to the User Interface.
Development

Successfully merging this pull request may close these issues.

1 participant