Improve documentation for AssetSourceResolver (#48532)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48532

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D67942309

fbshipit-source-id: 0f3901bfcd58863adf6dc8466bb5d587438e0d2c
This commit is contained in:
Peter Abbondanzo
2025-01-08 14:54:17 -08:00
committed by Facebook GitHub Bot
parent 6feb90bb29
commit dc5535cf88
@@ -55,6 +55,17 @@ function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
/**
* Returns true if the asset can be loaded over the network.
*
* This prevents an issue loading XML assets on Android. XML asset types like
* vector drawables can only be loaded from precompiled source. Android does
* not support loading these over the network, and AAPT precompiles data by
* breaking path data and resource information apart into multiple files,
* stuffing it all into the resource table. As a result, we should only attempt
* to load resources as we would in release builds: by the resource name.
*
* For more information, see:
* https://issuetracker.google.com/issues/62435069
* https://issuetracker.google.com/issues/68293189
*/
function assetSupportsNetworkLoads(asset: PackagerAsset): boolean {
return !(asset.type === 'xml' && Platform.OS === 'android');