@imgly/camera-react-native 1.85.0-rc.1 → 1.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -9
- package/android/build.gradle +1 -1
- package/ios/Package.swift +9 -25
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -29,15 +29,24 @@ To keep up-to-date with the latest changes, visit [CHANGELOG](https://img.ly/doc
|
|
|
29
29
|
|
|
30
30
|
React Native 0.87 introduced an experimental Swift Package Manager mode (`npx react-native spm`) — see the [React Native 0.87 announcement](https://reactnative.dev/blog/2026/08/11/react-native-0.87) and the [0.87.0 release notes](https://github.com/react/react-native/releases/tag/v0.87.0). This module dual-ships a SwiftPM manifest (`ios/Package.swift`) next to its podspec, so React Native's SPM autolinking resolves it out of the box. CocoaPods currently remains the default integration path; the React Native team does not recommend the SPM mode for production yet.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
Expo SDK 58 supports this mode too. Set `"experiments": { "swiftPackageManager": true }`
|
|
33
|
+
under `expo` in `app.json`, add `expo-constants` as a direct dependency with
|
|
34
|
+
`npx expo install expo-constants`, then run `npx expo prebuild -p ios`. Without the direct
|
|
35
|
+
dependency, a package manager that does not hoist `expo-constants`, such as npm 10, installs it
|
|
36
|
+
under `expo`, and the first build fails with `expo-constants could not be resolved`. If you add the
|
|
37
|
+
dependency after a prebuild, run `npx expo prebuild -p ios --clean`. Expo SDK 58 needs iOS 16.4
|
|
38
|
+
or later, so an `ios.deploymentTarget` that you set in the app config, for example with
|
|
39
|
+
`expo-build-properties`, must be 16.4 or later.
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
We verified this support on React Native 0.87.0, 0.87.1 and 0.88.0, and on Expo SDK 58. We have not
|
|
42
|
+
verified newer versions. React Native calls this mode experimental and can change its commands,
|
|
43
|
+
flags, and generated layout in any release. Check the release notes of the React Native version you
|
|
44
|
+
use.
|
|
40
45
|
|
|
41
|
-
Note:
|
|
46
|
+
Note: Set the **iOS Deployment Target** of the app target in Xcode to 16.0 or later. The React Native template scaffolds iOS 15.1. On React Native 0.88, set it before you run `npx react-native spm`, or raise it later and run `npx react-native spm update`. React Native 0.88 takes the platform version of its generated packages from the app target ([iOS deployment target](https://github.com/react/react-native/blob/v0.88.0/packages/react-native/scripts/spm/__docs__/spm-scripts.md#ios-deployment-target)), so a lower target fails the build. On React Native 0.87, a lower target builds until your app code imports this module directly, for example for native customization. In an Expo app, `npx expo prebuild` writes the target from the app config, so set it there.
|
|
42
47
|
|
|
43
|
-
Note: React Native 0.87
|
|
48
|
+
Note: React Native 0.87 pins its generated autolinking package to iOS 15 while this module requires iOS 16. On 0.87, raise the `platforms:` entries in `react-native/scripts/spm/generate-spm-autolinking.js` to `.iOS(.v16)` (for example with `patch-package`). React Native 0.88 needs no patch.
|
|
49
|
+
|
|
50
|
+
Note: React Native 0.87.0 downloads the Hermes runtime that the `latest-v1` tag of `hermes-compiler` names, while its own `hermes-compiler` emits bytecode version 98. When the two differ, any build with an embedded JS bundle crashes at startup. Update to React Native 0.87.1, which pins the runtime to the installed `hermes-compiler`. To stay on 0.87.0, install the `hermes-compiler` version that `npm view hermes-compiler@latest-v1 version` prints.
|
|
51
|
+
|
|
52
|
+
Note: On Expo SDK 58, this mode cannot build `expo-dev-client`: `expo-dev-launcher` and `expo-dev-menu` ship no Swift Package Manager manifest, so `npx expo prebuild` fails. Build the app without `expo-dev-client`.
|
package/android/build.gradle
CHANGED
package/ios/Package.swift
CHANGED
|
@@ -9,38 +9,20 @@
|
|
|
9
9
|
// React Native's SPM autolinking consumes this manifest through a symlink at
|
|
10
10
|
// <app>/ios/build/generated/autolinking/libs/CameraReactNative -> this
|
|
11
11
|
// directory, so the relative package references below resolve against that
|
|
12
|
-
// location.
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
12
|
+
// location. React Native documents this layout for libraries that ship their
|
|
13
|
+
// own manifest under "Self-managed community packages" in
|
|
14
|
+
// https://github.com/react/react-native/blob/v0.88.0/packages/react-native/scripts/spm/__docs__/spm-scripts.md
|
|
15
|
+
// The package and product must be named CameraReactNative. React Native 0.87
|
|
16
|
+
// derives that name from the npm package, and 0.88 reads it from
|
|
17
|
+
// `swiftpmConfig.name` in package.json, otherwise it uses the podspec name.
|
|
16
18
|
//
|
|
17
19
|
// The Objective-C++ bridge and the Swift implementation are separate targets
|
|
18
20
|
// because SwiftPM cannot compile mixed-language targets (SE-0403). The bridge
|
|
19
21
|
// resolves the Swift implementation at runtime (IMGLYCameraModuleSupport.h),
|
|
20
22
|
// so no Objective-C -> Swift compile-time dependency exists.
|
|
21
23
|
|
|
22
|
-
import Foundation
|
|
23
24
|
import PackageDescription
|
|
24
25
|
|
|
25
|
-
// Single-source the version from package.json, like the podspec does, so
|
|
26
|
-
// release automation bumps the IMG.LY dependency pin together with the
|
|
27
|
-
// package version. React Native's autolinking references this manifest
|
|
28
|
-
// through a symlink, so resolve it before walking up to the package root.
|
|
29
|
-
let version: Version = {
|
|
30
|
-
let packageJSON = URL(fileURLWithPath: #filePath)
|
|
31
|
-
.resolvingSymlinksInPath()
|
|
32
|
-
.deletingLastPathComponent()
|
|
33
|
-
.deletingLastPathComponent()
|
|
34
|
-
.appendingPathComponent("package.json")
|
|
35
|
-
guard let data = try? Data(contentsOf: packageJSON),
|
|
36
|
-
let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
|
|
37
|
-
let versionString = json["version"] as? String,
|
|
38
|
-
let version = Version(versionString) else {
|
|
39
|
-
fatalError("Unable to read the package version from \(packageJSON.path).")
|
|
40
|
-
}
|
|
41
|
-
return version
|
|
42
|
-
}()
|
|
43
|
-
|
|
44
26
|
let package = Package(
|
|
45
27
|
name: "CameraReactNative",
|
|
46
28
|
platforms: [
|
|
@@ -53,7 +35,9 @@ let package = Package(
|
|
|
53
35
|
.package(name: "ReactNative", path: "../../../../xcframeworks"),
|
|
54
36
|
.package(name: "React-GeneratedCode", path: "../../../ios"),
|
|
55
37
|
// Pinned exactly: the module and IMGLYUI are versioned in lockstep, matching the podspec.
|
|
56
|
-
|
|
38
|
+
// The release bump rewrites this text. Xcode's cache of the evaluated manifest ignores the
|
|
39
|
+
// files it reads, so a version read from package.json stays old after an upgrade.
|
|
40
|
+
.package(url: "https://github.com/imgly/IMGLYUI-swift.git", exact: "1.85.0"),
|
|
57
41
|
],
|
|
58
42
|
targets: [
|
|
59
43
|
.target(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/camera-react-native",
|
|
3
|
-
"version": "1.85.0
|
|
3
|
+
"version": "1.85.0",
|
|
4
4
|
"description": "Camera SDK for React Native - provide a versatile video camera to your users on iOS and Android.",
|
|
5
5
|
"react-native": "index.js",
|
|
6
6
|
"source": "index.js",
|
|
@@ -45,5 +45,8 @@
|
|
|
45
45
|
"android": {
|
|
46
46
|
"javaPackageName": "ly.img.camera.reactnative.module"
|
|
47
47
|
}
|
|
48
|
+
},
|
|
49
|
+
"swiftpmConfig": {
|
|
50
|
+
"name": "CameraReactNative"
|
|
48
51
|
}
|
|
49
52
|
}
|