Repository navigation
Conversation
1 of 2 tasks
1 of 2 tasks
b-l-i-n-d
force-pushed
the
build/minifier-compression
branch
from
October 27, 2026 17:14
4c92827 to
3ce05e4
Compare
b-l-i-n-d
marked this pull request as ready for review
October 28, 2026 05:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClickUp ticket link: https://app.clickup.com/t/9018365849/z8zyy1prfm
Description
This PR forms Layer 2 of the build stack. It enables SWC minifier compression passes while ensuring 100% compatibility with WordPress's internationalization and translation system.
How WordPress Handles Translations & Why This Solution Does Not Break
wp i18n make-potto build official translation catalogs (see WordPress Internationalization Handbook). Its AST parser expects translation functions (__,_x,_n, etc.) to receive static string literals.conditionals: true) merges ternary expressions calling the same function:cond ? ...), the WordPress parser cannot statically extract either string, dropping them from translate.wordpress.org.compress: { conditionals: false }prevents the minifier from merging conditional branches into dynamic arguments, keeping literal string calls completely intact for GlotPress. All other compression passes (dead-code elimination, tree-shaking, scope flattening) remain fully active, maintaining maximum bundle reduction.Key Changes
compress: { conditionals: false }, reserved['__', '_x', '_n', '_nx'], and preserved translator comments (format: { comments: /translators/i }).Minifier Compression Stats (Before vs After)
compress: false)conditionals: false)tutor-course-builder.jstutor-order-details.jstutor-payment-settings.jstutor-tax-settings.jstutor-import-export.jstutor-coupon.jstutor-addon-list.jstutor-core.jstutor.jsStack
build/dependencies->devbuild/minifier-compression->build/dependenciesreact-compiler->build/minifier-compressionTesting
rspack --mode=productionruns cleanly.wp i18n make-pot, successfully verifying all 3,538 strings (including 1,451 from built JS bundles) are parsed and extracted cleanly without skipped expressions.Use of AI Tool
Used: Yes
Used for:
Benchmarking SWC minifier compression passes and verifying translation string extraction via
wp i18n make-pot.