feat: SPM compatibility - #779
Open
hejsztynx wants to merge 3 commits into
Open
Conversation
hejsztynx
commented
Aug 19, 2026
| mediaType: 'photo', | ||
| selectionLimit: 1, | ||
| }); | ||
| const response: any = undefined; |
Collaborator
Author
There was a problem hiding this comment.
Stripped react-native-image-picker functionalities for testing purposes only. This will be removed before merging
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds Swift Package Manager (SPM) scaffolding support and updates iOS headers/import paths to build cleanly under SPM while keeping CocoaPods compatibility.
Changes:
- Added
Package.swiftand an SPM “prefix header” to emulate CocoaPods’ prefix-header behavior. - Updated iOS header imports to use local and codegen header paths (vs module-style includes).
- Adjusted podspec header search paths to support the new include strategy.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| react-native-spm-prefix.h | Adds a forced-include prefix header for SPM builds (Foundation/UIKit). |
| package.json | Publishes Package.swift and the prefix header in the npm package. |
| ios/internals/EnrichedTextViewShadowNode.h | Switches to local + codegen include paths for SPM compatibility. |
| ios/internals/EnrichedTextInputViewShadowNode.h | Switches to local + codegen include paths for SPM compatibility. |
| ios/internals/EnrichedTextInputViewComponentDescriptor.h | Updates includes to local + codegen paths. |
| ios/internals/EnrichedTextComponentDescriptor.h | Updates includes to local + codegen paths. |
| ios/interfaces/LinkRegexConfig.h | Updates Props include to the generated codegen path. |
| ios/EnrichedTextView.mm | Updates imports to local/component descriptor + generated codegen headers. |
| ios/EnrichedTextInputView.mm | Updates imports to local/component descriptor + generated codegen headers. |
| apps/example/src/hooks/useEditorState.ts | Modifies image-picker logic (currently stubbed). |
| ReactNativeEnrichedHtml.podspec | Expands HEADER_SEARCH_PATHS to include the repo root for quoted includes. |
| Package.swift | Introduces an SPM package definition for the library target. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hejsztynx
marked this pull request as draft
August 19, 2026 10:33
hejsztynx
force-pushed
the
@ksienkiewicz/feat-spm-compatibility
branch
from
August 19, 2026 12:18
e07a47d to
0470f9b
Compare
hejsztynx
marked this pull request as ready for review
August 19, 2026 12:22
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
Mainly, it was needed to change the iOS imports structure, as SPM and CocoaPods have different preferences.
Every change in the
apps/exampleis just for testing purposes and will not be committed in the merge. Thereact-native-image-pickerfunctionality got stripped, as it doesn't support SPM.SPM works with the internal example app. I also simulated a non-local environment by installing the recently published
react-native-enriched-htmlrelease into a fresh RN 0.87 bare-bone example app and applied theioschanges - it works there as well.Test Plan
Run the example app with SPM
In the
apps/exampledirectory:yarn ios, verify it worksreact-native-config.jssetautomaticPodsInstallationtofalsereact-native-image-pickerdependency frompackage.jsonand reinstall dependenciesnpx react-native spm scaffold,Package.swiftshould not be changed by thatPackage.swiftadd"apps"and"docs"to theexcludelist. This is needed as we physically have example apps within the library source code and don't want to try to resolve source there to compile; otherwise SPM would get confused (duplicated resources, infinite symlink loops)npx react-native spm --deintegrateto remove CocoaPods from this appyarn iosMore info: RN blog post
Compatibility