Repository navigation
[INTER-2397] SPM Support - #269
Conversation
Coverage report
Test suite run success85 tests passing in 5 suites. Report generated by 🧪jest coverage report action from 6f19b44 Show full coverage report
|
83eeb67 to
a89648b
Compare
f53e561 to
65d7264
Compare
924d36b to
b61e973
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The central SPM integration lacks a consuming Xcode build, and the CocoaPods dependency constraint is unintentionally narrowed.
Pull request overview
Adds experimental Swift Package Manager support for React Native 0.87 while adopting React Native’s strict TypeScript API and raising minimum supported versions.
Changes:
- Adds a two-target SwiftPM manifest and autolinking configuration.
- Migrates codegen types to the public
CodegenTypesAPI. - Updates dependencies, compatibility matrices, documentation, and release notes.
File summaries
| File | Description |
|---|---|
sdk/tsup/esbuild-plugin-license.d.ts |
Adds plugin typings. |
sdk/tsconfig.sdk.json |
Enables bundler resolution for SDK sources. |
sdk/tsconfig.json |
Enables bundler resolution for project references. |
sdk/src/specs/NativeRNFingerprintjsPro.ts |
Uses public codegen types. |
sdk/src/FingerprintClient.ts |
Uses public UnsafeObject type. |
sdk/RNFingerprintjsPro.podspec |
Excludes the SPM shim and adjusts dependency constraints. |
sdk/README.md |
Updates requirements and formatting. |
sdk/react-native.config.js |
Pins the SPM module name. |
sdk/Package.swift |
Defines the SwiftPM package and targets. |
sdk/package.json |
Publishes SPM files and updates dependencies. |
sdk/ios/turbomodule/RNFingerprintjsPro.mm |
Adjusts TurboModule glue imports. |
sdk/ios/turbomodule/react-native-spm-prefix.h |
Adds the SPM Objective-C prefix header. |
sdk/ios/RNFingerprintjsPro.swift |
Imports React for SwiftPM builds. |
README.md |
Updates minimum supported versions. |
pnpm-lock.yaml |
Locks updated React Native dependencies. |
eslint.config.mjs |
Uses the SDK-specific TypeScript project. |
e2e-app/scripts/compatibility.mjs |
Drops React Native 0.79 compatibility data. |
contributing.md |
Updates the untested-version list. |
.github/workflows/e2e-tests.yml |
Removes React Native 0.79 from CI. |
.changeset/spm-support.md |
Documents experimental SPM support. |
.changeset/new-architecture-support.md |
Updates migration requirements. |
Review details
- Files reviewed: 19/21 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…spm-support # Conflicts: # sdk/src/FingerprintClient.ts
…nto feature/INTER-2397-spm-support
…spm-support # Conflicts: # README.md # sdk/README.md
…spm-support # Conflicts: # sdk/RNFingerprintjsPro.podspec
🚀 Following releases will be created using changesets from this PR:@fingerprintjs/fingerprintjs-pro-react-native@4.0.0-rc.1Major Changes
Minor Changes
|
kevinmia
left a comment
There was a problem hiding this comment.
lgtm! Let me know if re-approval is needed later
SPM support
Experimental Swift Package Manager autolinking for iOS, targeting RN 0.87's
react-native spmworkflow.#270 introduces a bare RN app that can be used for testing the SPM support.
SPM manifest (
sdk/Package.swift)react-native spm scaffoldskips this library becauseios/mixes Swift and Objective-C++, and a single SwiftPM target can't contain both. The manifest is hand-written with a two-target split:RNFingerprintjsProSwift- pure Swift, all business logic and Fingerprint iOS SDK calls.RNFingerprintjsPro- thin ObjC++ glue that registers the TurboModule and returns the codegen'd C++ JSI spec. Depends on the Swift target.Module name pinning (
sdk/react-native.config.js)spm.name: 'RNFingerprintjsPro'pins the autolinker's module name to match the CocoaPods pod and native module name. Without it the autolinker derives a different name from the npm package.Podspec (
sdk/RNFingerprintjsPro.podspec)react-native-spm-prefix.hfrom CocoaPods sources (SwiftPM-only shim).iOS source
RNFingerprintjsPro.swift: added#if RCT_SPM/import Reactso the Swift target resolvesRCTPromiseResolveBlock/RCTPromiseRejectBlockwithout a bridging header.react-native-spm-prefix.h, a minimal prefix header that imports Foundation for the ObjC++ glue target. Force-included via-includeinPackage.swift; excluded from the podspec.Strict TypeScript API
Replaced the internal
react-native/Libraries/Types/CodegenTypesimport path with the publicCodegenTypesnamespace fromreact-native:UnsafeObject->CodegenTypes.UnsafeObjectDouble->CodegenTypes.Doublesdk/tsconfig.sdk.jsonnow uses"moduleResolution": "Bundler"to resolve RN'sexportsmap.eslint.config.mjspoints SDK files at that tsconfig.Minimum version bump
RN minimum raised from
>=0.79to>=0.80(Expo>=54.0.0). The Strict TypeScript API isn't available before 0.80. The E2E CI matrix andcompatibility.mjsdrop the 0.79/Expo 53 row.