fix: resolve asset registry on React Native 0.87 - #54
Open
huytdps13400 wants to merge 1 commit into
Open
huytdps13400 wants to merge 1 commit into
huytdps13400 wants to merge 1 commit into
Conversation
React Native 0.87 moved AssetRegistry into core and no longer installs the standalone registry package. Prefer the core registry while preserving the standalone fallback for older React Native versions.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #53.
React Native 0.87 moved
AssetRegistryintoreact-nativecore and stopped installing@react-native/assets-registry. The static standalone import therefore prevents Metro from bundling consumers on React Native 0.87.This resolves the core registry first and retains the standalone registry as a fallback for React Native 0.86 and older, matching the compatibility approach already merged in oblador/react-native-vector-icons#1924. It adds no dependency and does not change the public API or asset payload.
Verification
yarn jest src/getAssetByID.spec.js --runInBand— 3 passedyarn test --runInBand— 5 suites, 13 tests, 2 snapshots passedyarn test:plugin— 2 suites, 2 tests passednode_modules/@react-native/assets-registrywas absent, and successfully produced an iOS bundle with Metro 0.87.0The full unit suite used the repository LFS JAR downloaded from the official GitHub media URL and verified against the checked-in SHA-256 pointer.