-
Notifications
You must be signed in to change notification settings - Fork 57
Bundle local static React Native assets for Android #3810
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
Conversation
|
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
Now that we are attempting to load local static image assets in the React Native bundle, we must copy those assets to the react-native-bridge app for them to properly show up in the WordPress Android app.
9b8f45c to
0c65190
Compare
|
👋 @dcalhoun ! Tried this PR out from a WPAndroid checkout locally and it works nicely! Good job! Couple of things I noticed:
Is that intentional? Can you check whether this can cause some issue? Thanks! |
|
@hypest thank you for the thorough review.
It would appear
It is intentional in the sense that Metro copies all images that are referenced by the JavaScript bundle. I do not believe it causes issue. I believe the first two images are referenced/provided by the third-party React Navigation. We do not leverage them in our first-party code currently. I do not believe Metro does any "tree shaking," so the third-party reference likely causes the image to be bundled. The last image was added as the Story block preview image used in the web editor while hovering over a block within the inserter. Because the native client uses the same JavaScript file, Metro likely includes the asset in the bundle. We could potentially make the script in this PR more robust, replacing a simple |
Thanks for confirming! I'd suggest augmenting the inline comment to mention that all local images referenced in the JS code will be processed and copied to the app binary, as a quick headups to people. wdyt?
Agreed, I think it would surprising to find that not all images end up in the app binary. Also, if we go ahead and augment the inline comments we can make that clear. |
All local static assets referenced within the JavaScript bundle are copied for inclusion in the bridge bundle.
|
From the nitpicking department: I'm slightly confused by the format of the references at the top of the PR description David 🤔. For one, the description starts with a bullet, making me expect more than one bullets and since it's customary to have the links to both the WPiOS and the WPAndroid PRs, feel like the PR is missing the link to the WPAndroid PR. Maybe I'm too accustomed to past PRs but, can you elaborate on the format? Like, what do you have in mind when sharing the sister PRs first (in a bullet at that) and then actually having the description of what this PR is about? Again, nitpicking but curious at this stage since I see it in a few of your PRs 🤔, thanks! |
hypest
left a comment
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.
LGTM!
I will remove the unused image in a separate PR when I work to finish the Help Section detail view in Gutenberg.
👍, thanks!
@hypest using a list is carry over from the practice of referencing the multiple PRs that are generally required for Gutenberg Mobile work. This particular work happens to only have two total PRs, hence the single bullet. Would avoiding lists when there is a singular item improve communication from your perspective?
Labeling the linked PR as "WPAndroid" is a mistake. The linked PR, in fact, resides in gutenberg-mobile. The work just happens to only relate to integration of WordPress-Android. I will update the description to be more accurate.
I observed and was told during onboarding that including links to sibling work was helpful/expected. The format and placement of those sibling links seems to vary throughout the team. Placing the sibling PRs as the first item in the description was merely an attempt for consistency in the PRs across each repository that has its own template.
Humorously, from my perspective, I have largely formatted my PRs based upon with practices I observed from other PRs. 😄 I suppose I may have missed a nuance or taken too much liberty along the way. Happy to adapt my format if you have a particular preference. Just let me know. 🙇🏻 |
One additional note about lists on GitHub — placing GitHub links in a list causes additional details to unfurl due to the Task List feature. E.g. it displays the title and state instead. |
Ah, I think so. Thanks!
Oh, I see. I guess keeping the important bit first (what's this PR about) is easier to my eyes as a reader, having the links to relevant PRs as part of the context that follows the main description. My understanding is that that's already the typical format around the repos? And yes, thanks for mentioning GitHub's unfurling... I think it does seem to make things slightly worse by adding more words, ending up kinda noisy when the links precede the actual description. |
My perception is the "typical" is not that consistent, and most PR descriptions I see begin with references to sibling PRs. So, I am not too sure of the preference of the team at large.
Personally, I prefer the unfurling. However, I'll avoid them moving forward. |
oh wait, I think I better see what you mean now. That no matter how many the bullets, you still prefer it as it provides the unfurling, right? Please ignore me on that one, I don't see the need for revising since it does provide more context to you 👍 About the what comes first (the bullets or the description of the purpose of the PR) I still consider it a nitpick from my side and now that I have more insight on your goals I'm more than fine with the initiative ✅ so, feel free to develop it further. It might even be helpful to share within the team as an attempt to add consistency where's due. Thanks! |
Now that we are attempting to load local static image assets in the React Native bundle in WordPress/gutenberg#33790, we must copy those assets to the react-native-bridge app for them to properly show up in the WordPress Android app.
To test:
Screenshot of Help Image
PR submission checklist: