-
Notifications
You must be signed in to change notification settings - Fork 815
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
Minify more JS #8076
Minify more JS #8076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great so far! I understand that it's still in development. When it's ready to ship we need to make sure we're not shipping unminified code anymore. Can you update the .svnignore
file accordingly when you're done please?
gulpfile.babel.js
Outdated
@@ -75,6 +75,17 @@ function onBuild( done ) { | |||
} ); | |||
} | |||
|
|||
// uglify some other random files | |||
gulp.src( [ '_inc/*.js', '!_inc/*.min.js' ] ) | |||
.pipe( sourcemaps.init() ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make sure we only generate sourcemaps when it's a development, and not a production build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we also eliminate all the CSS .map files too? We already output those for production builds.
This PR doesn't minify all files, so I don't think we're ready to do this project wide. But, I think we could ignore all non-minified files in |
I tested several things such as Masterbar, Facebook embeds, etc., and they all seem to work. @zinigor made a good point about not shipping sourcemaps in production and making sure we minimize shipping unminified scripts to production as well. |
@zinigor none of the files being minified are already minified. I have added code which only compiles sourcemaps if the environment is not production. I think this is good to go. |
735c1e2
to
2ce0183
Compare
To test:
Further, I also commented out a bit of the logic in |
2ce0183
to
08e093c
Compare
After rebasing against master again, everything is now working as expected. Testing instructions are in the previous comment. I'm going to go ahead and approve this since my changes were minor. I'll leave it to someone from pit or crew to merge though. |
LGTM! 👍 |
I ❤️ this! Thanks for working on it. Or maybe just need to include a comment where to find the full human readable version of the code. |
@oskosk and I chatted a bit about this in Slack today and I think we're going to move forward with shipping the minified and non-minified versions, and using |
I'm currently working on a similar PR to start addressing modules in #8153. |
* Changelog 5.6: create base for changelog. * Update changelog with 5.5.1 info. * Changelog: add #7930 and #8238 * Changelog: add #8076 * Changelog: add #8100 * Changelog: add #8117 * Changelog: add #8141 * Changelog: add #8143 * Changelog: add #8147 * Changelog: add #8149 * Changelog: add #8153 * Changelog: add #8173 * Changelog: add #8184 * Changelog: add #8196 * Changelog: add #8199 * Changelog: add #8093 * Changelog: add #8171 * Changelog: add #8182 * Changelog: add #8202, #8222 * Changelog: add #8228 * Changelog: add #8240 * Changelog: add #8251 * remove AL card change
Minifies all the JS files in _inc into _inc/build, with sourcemaps, and modifies existing code to point to those files.
This is factored out of our larger experimental #7963 branch.