Skip to content
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

Remove unused JSON asset files #4401

Merged
merged 1 commit into from Jan 25, 2022
Merged

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Dec 22, 2021

The static JSON file assets are not the sourced by the app. Instead, the data found within the JavaScript bundle itself is utilized. The unnecessary static JSON files should now no longer be exported when bundling the JavaScript thanks to a bug fix in React Native.

To test:

Verify the bundle command does not generate JSON assets
  1. Switch to this branch.
  2. npm run bundle
  3. Verify new JSON assets are not generated within the bundle directory.
Verify the correct translation strings display
  1. Switch to this branch.
  2. Switch the testing device to a non-English language.
  3. Launch the block editor.
  4. Verify UI strings display in the correct language.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

The static JSON file assets are not the sourced by the app. Instead, the
data found within the JavaScript bundle itself is utilized. The
unnecessary static JSON files should now no longer be exported when
bundling the JavaScript thanks to a bug fix in React Native.

- #4329 (comment)
- facebook/metro#593
@dcalhoun dcalhoun force-pushed the chore/remove-unused-json-assets branch from a281611 to f088e34 Compare January 24, 2022 15:41
@peril-wordpress-mobile
Copy link

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@dcalhoun dcalhoun marked this pull request as ready for review January 24, 2022 20:55
Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎊 ! Thanks @dcalhoun for addressing this 🙇 .

I verified that running npm run bundle doesn't generate JSON assets, as well as testing that translations are present. Additionally, I double-checked that content of JSON files could be found in the latest bundle (bundle/App.js).

Tested on Simulator - iPhone 12 Pro Max (iOS 15.0).

@dcalhoun dcalhoun merged commit 8556826 into develop Jan 25, 2022
@dcalhoun dcalhoun deleted the chore/remove-unused-json-assets branch January 25, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants