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 feature is opt-in via the RCTUseAssetCatalog Info.plist key, which is the
single source of truth: the native loader reads it (a build-time constant,
read once) and react-native-xcode.sh reads the same key to decide whether to
bundle images into the catalog, so build and runtime cannot disagree on where
image assets live. Enabling the key without an RNAssets.xcassets in the app
fails the build with an actionable error. Apps that have not migrated are
unaffected.
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.
rn-tester and private/helloworld are both migrated: the 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 targets to avoid a dependency cycle with that step).
helloworld's bundle phase now also substitutes REACT_NATIVE_PATH in
CONFIG_JSON, which any bundling build requires.
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