Skip to content

feat: add experimental SPM support - #955

Open
krozniata wants to merge 6 commits into
mainfrom
fet/experimental-spm-support
Open

krozniata wants to merge 6 commits into
mainfrom
fet/experimental-spm-support

Conversation

@krozniata

@krozniata krozniata commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds an experimental --experimental-spm flag that generates a Package.swift for Turbo Modules and Fabric views, targeting React Native 0.87's Swift Package Manager support

When passing flag it adds Package.swift file to library to support SPM and also disables automatic pod installation in example app

Also adds CI workflows that create such library and build app that uses SPM package ('npx react-native spm --deintegrate`)

image

Test plan

  1. Generate example lib
  2. connect to RN87 app e.g. via tarball
  3. Run npx react-native spm --deintegrate
  4. Build app

Also CI GREEN

@krozniata
krozniata marked this pull request as ready for review October 6, 2026 07:01
@satya164

satya164 commented Oct 6, 2026

Copy link
Copy Markdown
Member

@krozniata regarding nitro, can you reach out to @mrousavy on slack to see what's the plan?

@mrousavy

mrousavy commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

I'm already actively working on it :)

@krozniata
krozniata requested a review from atlj October 9, 2026 09:09
# Conflicts:
#	packages/create-react-native-library/templates/objc-view-new/ios/{%- project.name %}View.mm
Comment thread .github/workflows/build-templates.yml Resolved
project: {
ios: {
automaticPodsInstallation: true,
automaticPodsInstallation: <%- experimentalSpm ? 'false' : 'true' %>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via Claude: Once the example is moved to SwiftPM, the generated CI and turbo config still assume CocoaPods:

  • ci.yml runs pod install, but after --deintegrate the Podfile doesn't parse anymore (React Native 0.88.0 removes use_react_native!( and leaves its arguments behind).
  • A fresh checkout needs npx react-native spm before building, since everything it generates is gitignored (docs). React Native suggests a postinstall script for this.
  • turbo.json lists *.podspec in the build:ios inputs but not Package.swift, so changes to the manifest don't invalidate the cache.

The CI and turbo templates need to handle the SwiftPM case too.

Comment thread docs/pages/create.md Resolved
Comment thread docs/pages/create.md Resolved
Comment thread .github/workflows/build-templates.yml Resolved
Comment thread .github/workflows/build-templates.yml Resolved
Comment thread docs/pages/create.md Resolved
Comment thread .gitignore Resolved
@mrousavy

Copy link
Copy Markdown
Contributor

JFYI Nitro V1 is now on SPM. It dropped CocoaPods support.
V1 is still in alpha (v1.0.0-alpha.nightly.84.gc5ad5050ce94 is out now) but I think it'd be fair to support that in Bob

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants