You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load packager image assets from an iOS asset catalog (RNAssets.xcassets)
instead of loose files in the app bundle. The CLI bundler emits imagesets
into the catalog at build time (via --asset-catalog-dest, already in
@react-native/community-cli-plugin); Xcode compiles them into Assets.car and
the native image loader resolves them by name with [UIImage imageNamed:].
The catalog path is gated on the RCTUseAssetCatalog Info.plist key, a
build-time constant read once. Apps that have not migrated are unaffected and
the catalog path is a single lookup with no filesystem fallback; a mis-bundled
asset logs an RCTLogError instead of failing silently. The native side only
resolves catalog names for what the CLI actually emits into the catalog
(png/jpg/jpeg under main-bundle assets/, mirroring isCatalogAsset), so
gif/webp packager assets, sub-bundles and OTA assets outside the main bundle
fall through to the existing loader. jpeg is also added to
RCTIsImageAssetsPath so jpeg assets are routed to the bundle-asset loaders.
react-native-xcode.sh passes --asset-catalog-dest when an RNAssets.xcassets
exists next to the app's Info.plist. In rn-tester the "Build JS Bundle" phase
is ordered before Resources and declares the catalog as an output so the new
Xcode build system compiles it after it is populated (asset symbol generation
is disabled on the target to avoid a dependency cycle with that step).
Cold image loads in RNTester are ~15x faster (median 47us vs 719us) and Apple
app thinning can strip unused scales.
Copy file name to clipboardExpand all lines: packages/rn-tester/RNTester/Info.plist
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,8 @@
48
48
<string>You need to add NSPhotoLibraryUsageDescription key in Info.plist to enable photo library usage, otherwise it is going to *fail silently*!</string>
0 commit comments