diff --git a/.gitignore b/.gitignore index 4f1c43c..82f0288 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ npm-debug.log yarn-debug.log yarn-error.log +# Ignore files generated by npm pack +/*.tgz + # BUCK buck-out/ \.buckd/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 58ff2d7..c7ac6a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ When an underlying runtime like [rive-ios](https://github.com/rive-app/rive-ios) Before running `yarn` at the root level of the project, set the appropriate version of the iOS runtime in `rive-react-native.podspec` at the root of the folder: ``` -s.dependency "RiveRuntime", "5.1.6" +s.dependency "RiveRuntime", "x.x.x" ``` In the example folder, run the following command to update the example project to retrieve the expected `RiveRuntime` dependency you're upgrading to: diff --git a/android/build.gradle b/android/build.gradle index 3ee784a..f96b1a4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -138,7 +138,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1' - implementation 'app.rive:rive-android:9.5.1' + implementation 'app.rive:rive-android:9.9.5' implementation "androidx.startup:startup-runtime:1.1.1" implementation 'com.android.volley:volley:1.2.0' } diff --git a/example/ios/Podfile b/example/ios/Podfile index 266477a..1826f57 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -26,5 +26,22 @@ target 'RiveReactNativeExample' do :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + # This is a temporary workaround for the issue described here: + # https://github.com/facebook/react-native/issues/43335. Flipper is no longer + # used in React Native 0.74 so this workaround can be removed once we upgrade. + installer.pods_project.targets.each do |target| + if target.name == 'Flipper' + file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h' + contents = File.read(file_path) + unless contents.include?('#include ') + File.chmod(0755, file_path) + File.open(file_path, 'w') do |file| + file.puts('#include ') + file.puts(contents) + end + end + end + end end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 22162fd..da0e5e6 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -487,10 +487,10 @@ PODS: - React-jsi (= 0.72.7) - React-logger (= 0.72.7) - React-perflogger (= 0.72.7) - - rive-react-native (7.2.0): + - rive-react-native (8.0.0): - React-Core - - RiveRuntime (= 5.14.0) - - RiveRuntime (5.14.0) + - RiveRuntime (= 6.2.1) + - RiveRuntime (6.2.1) - RNCMaskedView (0.2.9): - React-Core - RNCPicker (1.16.8): @@ -744,8 +744,8 @@ SPEC CHECKSUMS: React-runtimescheduler: 7649c3b46c8dee1853691ecf60146a16ae59253c React-utils: 56838edeaaf651220d1e53cd0b8934fb8ce68415 ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6 - rive-react-native: c5f46a81d999be348e3a4875f5d5a42b0288db78 - RiveRuntime: c470cc8daa0c192c678f7abb35b980f95d2bb625 + rive-react-native: 555505d7a84182ea159d5856bcda8ba01057f256 + RiveRuntime: 23b2f53b5439c38f716b2f1a5d2a9e3a24683877 RNCMaskedView: 949696f25ec596bfc697fc88e6f95cf0c79669b6 RNCPicker: 0991c56da7815c0cf946d6f63cf920b25296e5f6 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 @@ -755,6 +755,6 @@ SPEC CHECKSUMS: Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 2e1de35b032a6e591da83a5975df1059c489c1d8 +PODFILE CHECKSUM: 2162e0768710a1457a43053c4af0534adf174041 COCOAPODS: 1.15.2 diff --git a/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj b/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj index c8a5d19..96ddd83 100644 --- a/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj @@ -915,7 +915,11 @@ ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)"; - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -972,7 +976,11 @@ MTL_ENABLE_DEBUG_INFO = NO; OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)"; - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/example/src/App.tsx b/example/src/App.tsx index 2411389..8059eef 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -30,7 +30,7 @@ export default function Main() { // For more information: https://rive.app/community/doc/overview/docD20dU9Rod // // This is optional. The current defaults are: - // - iOS: Skia + // - iOS: Rive // - Android: Skia // In the future the default will be the Rive Renderer (RiveRendererIOS.Rive and RiveRendererAndroid.Rive) // diff --git a/ios/RNRiveRendererType.swift b/ios/RNRiveRendererType.swift index 1444ccd..4f56976 100644 --- a/ios/RNRiveRendererType.swift +++ b/ios/RNRiveRendererType.swift @@ -10,9 +10,8 @@ import RiveRuntime enum RNRiveRendererType: String { case Rive = "rive" - case Skia = "skia" case CoreGraphics = "coreGraphics" - + static func mapToRNRiveRendererType(value: String) -> RNRiveRendererType { if let rnEnum = RNRiveRendererType(rawValue: value) { return rnEnum @@ -20,13 +19,11 @@ enum RNRiveRendererType: String { fatalError("Unsupported renderer type: \(value)") } } - + static func mapToRendererType(rnRendererType: RNRiveRendererType) -> RendererType { switch rnRendererType { case .Rive: return RendererType.riveRenderer - case .Skia: - return RendererType.skiaRenderer case .CoreGraphics: return RendererType.cgRenderer } diff --git a/ios/RiveReactNative-Bridging-Header.h b/ios/RiveReactNative-Bridging-Header.h index 4c94f2b..4178014 100644 --- a/ios/RiveReactNative-Bridging-Header.h +++ b/ios/RiveReactNative-Bridging-Header.h @@ -1,7 +1,7 @@ #import #import #import -#import "React/RCTUIManager.h" +#import #import -#import "React/RCTExceptionsManager.h" +#import #import diff --git a/ios/RiveReactNativeViewManager.m b/ios/RiveReactNativeViewManager.m index e69fbad..2938e7d 100644 --- a/ios/RiveReactNativeViewManager.m +++ b/ios/RiveReactNativeViewManager.m @@ -1,5 +1,5 @@ -#import "React/RCTViewManager.h" +#import @interface RCT_EXTERN_MODULE(RiveReactNativeViewManager, RCTViewManager) diff --git a/package.json b/package.json index 65be99f..e8408b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rive-react-native", - "version": "7.3.0", + "version": "8.0.0", "description": "Rive React Native", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/rive-react-native.podspec b/rive-react-native.podspec index f43be90..77de1ed 100644 --- a/rive-react-native.podspec +++ b/rive-react-native.podspec @@ -15,6 +15,8 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" + s.swift_version = "5.0" + s.dependency "React-Core" - s.dependency "RiveRuntime", "5.14.0" + s.dependency "RiveRuntime", "6.2.1" end diff --git a/src/types.ts b/src/types.ts index 891c00a..cf3f590 100644 --- a/src/types.ts +++ b/src/types.ts @@ -78,7 +78,6 @@ export enum Direction { export enum RiveRendererIOS { Rive = 'rive', - Skia = 'skia', CoreGraphics = 'coreGraphics', }