-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add prebundle
to bundle
command to force update the i18n localization files
#3423
Conversation
prebundle
to bundle
command to force update the i18n localization files
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
@@ -304,7 +304,9 @@ jobs: | |||
- npm-install | |||
- run: | |||
name: Build JavaScript Bundle | |||
command: npm run bundle:android | |||
command: | | |||
npm run core prebundle |
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.
We also have to update the localization files when publishing the bundle for Android.
@@ -61,7 +61,7 @@ | |||
"prern-bundle": "patch-package --patch-dir gutenberg/packages/react-native-editor/metro-patch", | |||
"rn-bundle": "react-native bundle", | |||
"postrn-bundle": "patch-package --reverse --patch-dir gutenberg/packages/react-native-editor/metro-patch", | |||
"bundle": "npm run clean; npm run bundle:js && npm run genstrings", | |||
"bundle": "npm run clean; npm run core prebundle && npm run bundle:js && npm run genstrings", |
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.
Good catch! I suppose the pre scripts we have in place (e.g. prebundle
) were not correctly running because we many of our bundle scripts have suffixes (e.g. :js
, :android
) which causes the pre script to not execute.
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.
Yep, besides the prebundle
command is defined in packages/react-native-editor
and we usually run the bundle
command on the root (GB-mobile).
@fluiddot I did just notice that I did not see the |
I created this PR on |
Yep, that's because we're not tracking the dir |
Thanks for the fix @fluiddot and @dcalhoun !
I wonder if using the |
Possibly. Now that I look at this again, I wonder if there is a way to expose fewer scripts from One thing I do not fully understand currently is why both |
I don't have a strong opinion whether remove or not the I'd like to note that generating the bundle within
I had the same impression but as far as I understand they're generating different bundles. What I also do wonder is how many of them are doing the same and could unified 🤔 .
They're but have a different entry point:
|
Agreed. I believe either approach is reasonable.
Ah, yes. They do appear to be quite different. Likely not worth pursuing alignment or consideration at this time. |
As a cross-reference, I updated the |
Fixes #3422
This PR adds the
core prebundle
command to thebundle
command to force update the i18n localization files. This way we assure that we always bundle the most recent localization files.To test:
npm run bundle
gutenberg/packages/react-native-editor/i18n-cache/data/<LOCALE>.json
bundle/android/raw/gutenberg_packages_reactnativeeditor_i18ncache_data_<LOCALE>.json
bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/cache/<LOCALE>.json
Verify localization files are bundled into the main apps
iOS
The files are referenced via the Gutenberg podspec so in this case, if the files generated in
bundle/ios/assets/gutenberg/packages/react-native-editor/i18n-cache/cache
are ok then they will be bundled into WPiOS.Android
Since now the JS bundle has to be published for injecting it into WPAndroid, we have to verify with an installable build that the localizations are included. For this purpose I created the following PR: wordpress-mobile/WordPress-Android#14535.
PR submission checklist: