Repository navigation
Conversation
…onfig A library that supports React Native 0.87 must keep its SwiftPM settings in the deprecated react-native.config.js 'spm' block, because 0.87 reads only that block. To support 0.88 too, it also declares them in package.json 'swiftpmConfig'. 0.88 warned about every field in the 'spm' block, so these libraries got a warning they could not fix. Now a field whose value is the same in both places is not warned about. Other fields in the 'spm' block are warned about as before.
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:
A library that supports React Native 0.87 must keep its SwiftPM settings in the deprecated
spmblock ofreact-native.config.js, because 0.87 reads only that block. To support 0.88 too, the library also declares the same settings inswiftpmConfigin itspackage.json. One example is@sentry/react-native, which setsname: "RNSentry"in both places.React Native 0.88 warned about every field in the
spmblock, even whenswiftpmConfighad the same value. Users of these libraries saw the warning on eachspm add,spm updateand Xcode sync. The library author could not fix it without dropping 0.87 support.What changes:
spmblock with the same value inswiftpmConfigis no longer warned about.spmblock, or that has a different value inswiftpmConfig, is still warned about, with the same message as before.swiftpmConfigstill wins over thespmblock, field by field.Changelog:
[IOS] [FIXED] - SwiftPM autolinking no longer warns about a deprecated
spmfield thatswiftpmConfigin package.json sets to the same valueTest Plan:
Three new tests in
packages/react-native/scripts/spm/__tests__/swiftpm-config-test.js: identical copies give no warning, a different value still warns, and the warning names only the fields that are not identical copies.yarn flow-check: 0 errors. ESLint (--max-warnings 0) and Prettier pass on both changed files.