Repository navigation
Conversation
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
React Native 0.88 can build iOS libraries with Swift Package Manager (SwiftPM) instead of CocoaPods. react-native-reserved-regions has no
Package.swift, so apps that use SwiftPM cannot use it.This PR adds SwiftPM support. CocoaPods users see no change, and no source file changes.
Package.swift: the manifest that React Native's SwiftPM autolinking uses. It builds theios/folder and definesRCT_NEW_ARCH_ENABLED=1, because CocoaPods gets that define frominstall_modules_dependencies.spm-headers/RCTFabricComponentsPlugins.h: a one-line header that re-exports<React/RCTFabricComponentsPlugins.h>.ios/ReservedRegionsView.mmimports it with quotes. CocoaPods finds it through its header search paths, but SwiftPM does not.package.json: the Swift package name (swiftpmConfig.name,ReservedRegions, the same as the podspec) and the new files infiles.We sent the same kind of change to react-native-safe-area-context, which merged it.
Test plan
npx react-native spm add --deintegrate, with react-native-reserved-regions from this branch.spm addfails:Package.swift is missing for library "react-native-reserved-regions".xcodebuildDebug and Release, iOS simulator: both BUILD SUCCEEDED.yarn lint,yarn typecheckand the Jest tests pass.