Allow out of tree platforms to provide customized saveAssets experiences #2002
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:
Currently the CLI provides logic to
saveAssets
for iOS/Android. -- with some combination of the two implementations working for the basic cases for other platforms. But as other platforms mature, they want to be able to provide more platform specific optimizations similar to how iOS provides logic to generate asset catalogs.This change introduces a new property to react-native config for platform out of tree implementations to optionally provide. This property provides a location for a js module that can be used to call into a platform specific implementation of much of the saveAssets logic.
For example, macos would be able to duplicate the iOS asset catalog behavior. And windows could modify the asset filenames to align with its native scaling logic.
Test Plan:
microsoft/react-native-windows#11839 adds support for the new
saveAssetsPlugin
property to successfully relocate assets.Checklist