Ship the Gutenberg JS bundle once instead of twice (−7.7 MB) - #25965
Draft
jkmassel wants to merge 1 commit into
Draft
Ship the Gutenberg JS bundle once instead of twice (−7.7 MB)#25965jkmassel wants to merge 1 commit into
jkmassel wants to merge 1 commit into
Conversation
The React Native runtime loads main.jsbundle from the app bundle root, but a byte-identical copy (~7.7MB) also ships inside Gutenberg.framework/App.js where it is never loaded — the framework resolves the bundle via RCTBundleURLProvider from the main bundle, not from itself (App.js is referenced zero times in the framework binary). Strip App.js from the framework at dependency-download time so it isn't embedded and code-signed into the app, and source the app-root main.jsbundle from the standalone react-native-bundle-source-map/main.jsbundle that already ships alongside the XCFramework. Removes ~7.7MB from the app bundle, no runtime change.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 34117 | |
| Version | PR #25965 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | d626c7e | |
| Installation URL | 67umn87p41i58 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 34117 | |
| Version | PR #25965 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | d626c7e | |
| Installation URL | 0m79oh9s7gs9o |
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
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.


Summary
Root Cause
The RN runtime loads the JS bundle via
RCTBundleURLProvider/jsBundleURLForBundleRoot:— i.e.main.jsbundlefrom the app bundle root, placed there by theCopyGutenbergJSbuild phase. An identical copy (md5 fdfce7…, confirmed byte-for-byte) also ships inside the embeddedGutenberg.framework/App.js, but the framework binary referencesApp.jszero times — it is never loaded at runtime. It existed only as the build-time copy source.Fix
download-gutenberg-xcframeworks.sh: stripApp.jsfrom theGutenberg.frameworkslices after they're copied intoWordPress/Frameworks/, so it isn't embedded into (and code-signed with) the app.CopyGutenbergJS.sh: source the app-rootmain.jsbundlefrom the byte-identical standalonereact-native-bundle-source-map/main.jsbundlethat already ships alongside the XCFramework.CopyGutenbergJS.inputs.xcfilelist: repoint the phase input (also fixes a pre-existing dangling input path).Measured on a clean unsigned Release archive: −7.7 MB uncompressed, no runtime change (same
main.jsbundle, same path, same bytes).Test Plan
App.jsis gone, so a working editor proves the rootmain.jsbundleis what the runtime loads.rake dependencies(CI bootstraps fresh, so green CI covers the pipeline change).bash -n.md5 fdfce7…).Notes
Local devs must re-run
rake dependenciesto pick up the strip (cheap — no re-download). The RN editor is being replaced by GutenbergKit; this doesn't touch that migration, it just stops shipping the RN bundle twice in the meantime.