-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Build: Use .min.js
suffix for bundled JavaScript
#23926
Conversation
Size Change: -1.02 MB (89%) 🏆 Total Size: 1.14 MB
ℹ️ View Unchanged
|
The size bot seems to be confused by the renames. For some reason the "new" (.min.js) packages don't offset the "removed" (.js) packages. The min versions do appear if you expand the "View Unchanged" section. |
I'd love thoughts from @WordPress/gutenberg-core about whether this is an acceptable tradeoff. |
I did wonder if folks use the presence of So, ya I think it's an acceptable tradeoff. I'm assuming none of this work impacts the build process when things land in WP core (and that's a separate build process)? |
Yes, I believe that's a separate process handled here: https://github.com/WordPress/wordpress-develop/blob/b00172339467889b736cf0a8d0a7bc5a502b1158/tools/webpack/packages.js |
Looks good to me 👍 |
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.
Ok let's do this.
Thanks, everyone! |
* Revert "Build: Use .min.js extension for bundled JavaScript (#23926)" (#24239) This reverts commit 40c6c8f. * Remove deprecated blockType.context support (#24155) Co-authored-by: Jon Surrell <[email protected]> Co-authored-by: Riad Benguella <[email protected]>
Description
The webpack-bundled packages intended for consumption via WordPress scripts in
build/
are shipped with the Gutenberg plugin as minified sources.Contrary to WordPress convention, these minified sources use the
.js
extension rather than.min.js
.Use the
.min.js
extension for bundled sources.Note:
The
.min.js
extension is hard-coded in a few places. This is optimized for the most common use case — when the scripts are used as part of the Gutenberg plugin.This is not accurate in development (
npm run dev
) where the scripts are not minified. I consider this to be an acceptable tradeoff. Developers are unlikely to be confused by the.min.js
extension containing readable source.How has this been tested?
The Gutenberg plugin enqueues
.min.js
frombuild
and their dependencies correctly.Build (
npm run build:plugin-zip
) and install the plugin on a site. The editor works correctly.Types of changes
Internal.
Checklist: