Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm working on performance improvements to my site and created a minified version of extlink.js. This saves a bit of bandwidth for users. I've attached a patch for this against the latest D7 dev release.
Comment | File | Size | Author |
---|---|---|---|
#9 | extlink-minified-js-2038235-9.patch | 4.05 KB | attheshow |
#1 | extlink-minified-js-2038235-1.patch | 3.1 KB | attheshow |
Comments
Comment #1
attheshow CreditAttribution: attheshow commentedComment #2
elachlan CreditAttribution: elachlan commentedThis is a good idea. In principle +1.
Comment #3
elachlan CreditAttribution: elachlan commentedChanging status to test patch.
Comment #4
elachlan CreditAttribution: elachlan commentedWill wait until the rest of the issues are completed, unless we can find an automated way to minify the javascript.
Comment #5
attheshow CreditAttribution: attheshow commentedThere are a number of tools that can do this. The one my team uses is just a web app. http://jscompress.com/
Comment #6
elachlan CreditAttribution: elachlan commentedWhen I meant automated way, I meant in our code. I used the same site for the 8.x branch.
The problem is, at the moment there are lots of changes being made to the javascript. Which results in more work if a minified js is added. So I am likely to wait until we are ready for the next version and do it then.
Comment #7
elachlan CreditAttribution: elachlan commentedComment #8
attheshow CreditAttribution: attheshow commentedI just wanted to note that the suggestion of the best practice to minify shipped JS comes from Matt Farina. He talks about it on his blog here: http://engineeredweb.com/blog/why-minify-javascript/
And a couple of years ago at DrupalCon Denver here: http://www.youtube.com/watch?v=wBkzjPT8_Mw
He uses a tool called "uglify" to minify the JS in the Speedy module which a lot of people (including us) use.
I've recently started using a Coda plugin called YUICompress (http://bedrichrios.com/coda2-plugins/). Basically when you make a change to your JS file, you just run the plugin from a menu and it automatically builds the minified version of that JS for you in a couple of seconds. Very easy to use. This is what we use for contrib modules that we maintain as well as custom internal modules. Just thought I'd share.
Comment #9
attheshow CreditAttribution: attheshow commentedAttached updated patch against 7.x-1.8.
Comment #10
DamienMcKennaNeeds to be rerolled, and probably a way of controlling which version is used.
Comment #11
elachlan CreditAttribution: elachlan commented