From a9ff376c64059cf77bc463774f806afd4f03843e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Pe=C3=B1a?= Date: Fri, 6 Jan 2023 20:06:12 -0800 Subject: [PATCH] Perform version update - Updated react and react-native-video to the latest - Updated DemoApp based on latest version of template from react native - DemoApp is now using Typescript - Added a stub .d.ts for mux-react-native-video-sdk --- DemoApp/.bundle/config | 2 + DemoApp/.eslintrc.js | 12 + DemoApp/.flowconfig | 75 - DemoApp/.gitattributes | 1 - DemoApp/.gitignore | 13 +- DemoApp/.node-version | 1 + DemoApp/.prettierrc.js | 5 +- DemoApp/.ruby-version | 1 + DemoApp/{App.js => App.tsx} | 16 +- DemoApp/Gemfile | 6 + DemoApp/Gemfile.lock | 100 + .../__tests__/{App-test.js => App-test.tsx} | 0 DemoApp/android/app/{BUCK => _BUCK} | 0 DemoApp/android/app/build.gradle | 146 +- .../android/app/src/debug/AndroidManifest.xml | 7 +- .../java/com/demoapp/ReactNativeFlipper.java | 73 + .../android/app/src/main/AndroidManifest.xml | 8 +- .../main/java/com/demoapp/MainActivity.java | 33 + .../java/com/demoapp/MainApplication.java | 29 +- .../MainApplicationReactNativeHost.java | 116 + .../components/MainComponentsRegistry.java | 36 + ...ApplicationTurboModuleManagerDelegate.java | 48 + .../android/app/src/main/jni/CMakeLists.txt | 7 + .../jni/MainApplicationModuleProvider.cpp | 32 + .../main/jni/MainApplicationModuleProvider.h | 16 + ...nApplicationTurboModuleManagerDelegate.cpp | 45 + ...ainApplicationTurboModuleManagerDelegate.h | 38 + .../src/main/jni/MainComponentsRegistry.cpp | 65 + .../app/src/main/jni/MainComponentsRegistry.h | 32 + DemoApp/android/app/src/main/jni/OnLoad.cpp | 11 + .../res/drawable/rn_edit_text_material.xml | 36 + .../app/src/main/res/values/styles.xml | 4 +- DemoApp/android/build.gradle | 35 +- DemoApp/android/gradle.properties | 23 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 59821 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- DemoApp/android/gradlew | 264 +- DemoApp/android/gradlew.bat | 27 +- DemoApp/android/settings.gradle | 8 + DemoApp/global.d.ts | 3 + DemoApp/index.js | 1 + DemoApp/ios/.xcode.env | 11 + DemoApp/ios/DemoApp-tvOS/Info.plist | 53 - DemoApp/ios/DemoApp-tvOSTests/Info.plist | 24 - DemoApp/ios/DemoApp.xcodeproj/project.pbxproj | 530 +- .../xcschemes/DemoApp-tvOS.xcscheme | 129 - .../xcshareddata/xcschemes/DemoApp.xcscheme | 45 +- DemoApp/ios/DemoApp/AppDelegate.h | 7 - DemoApp/ios/DemoApp/AppDelegate.m | 42 - DemoApp/ios/DemoApp/AppDelegate.mm | 133 + .../ios/DemoApp/Base.lproj/LaunchScreen.xib | 42 - .../AppIcon.appiconset/Contents.json | 45 +- DemoApp/ios/DemoApp/Info.plist | 2 - DemoApp/ios/DemoApp/LaunchScreen.storyboard | 47 + DemoApp/ios/DemoApp/main.m | 10 +- DemoApp/ios/DemoAppTests/DemoAppTests.m | 36 +- DemoApp/ios/Podfile | 82 +- DemoApp/ios/Podfile.lock | 664 +- DemoApp/package.json | 44 +- DemoApp/tsconfig.json | 10 + DemoApp/yarn.lock | 6857 +++++++++-------- package.json | 4 +- src/index.js | 14 +- yarn.lock | 498 +- 64 files changed, 5715 insertions(+), 4991 deletions(-) create mode 100644 DemoApp/.bundle/config delete mode 100644 DemoApp/.flowconfig delete mode 100644 DemoApp/.gitattributes create mode 100644 DemoApp/.node-version create mode 100644 DemoApp/.ruby-version rename DemoApp/{App.js => App.tsx} (84%) create mode 100644 DemoApp/Gemfile create mode 100644 DemoApp/Gemfile.lock rename DemoApp/__tests__/{App-test.js => App-test.tsx} (100%) rename DemoApp/android/app/{BUCK => _BUCK} (100%) create mode 100644 DemoApp/android/app/src/debug/java/com/demoapp/ReactNativeFlipper.java create mode 100644 DemoApp/android/app/src/main/java/com/demoapp/newarchitecture/MainApplicationReactNativeHost.java create mode 100644 DemoApp/android/app/src/main/java/com/demoapp/newarchitecture/components/MainComponentsRegistry.java create mode 100644 DemoApp/android/app/src/main/java/com/demoapp/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java create mode 100644 DemoApp/android/app/src/main/jni/CMakeLists.txt create mode 100644 DemoApp/android/app/src/main/jni/MainApplicationModuleProvider.cpp create mode 100644 DemoApp/android/app/src/main/jni/MainApplicationModuleProvider.h create mode 100644 DemoApp/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp create mode 100644 DemoApp/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h create mode 100644 DemoApp/android/app/src/main/jni/MainComponentsRegistry.cpp create mode 100644 DemoApp/android/app/src/main/jni/MainComponentsRegistry.h create mode 100644 DemoApp/android/app/src/main/jni/OnLoad.cpp create mode 100644 DemoApp/android/app/src/main/res/drawable/rn_edit_text_material.xml create mode 100644 DemoApp/global.d.ts create mode 100644 DemoApp/ios/.xcode.env delete mode 100644 DemoApp/ios/DemoApp-tvOS/Info.plist delete mode 100644 DemoApp/ios/DemoApp-tvOSTests/Info.plist delete mode 100644 DemoApp/ios/DemoApp.xcodeproj/xcshareddata/xcschemes/DemoApp-tvOS.xcscheme delete mode 100644 DemoApp/ios/DemoApp/AppDelegate.m create mode 100644 DemoApp/ios/DemoApp/AppDelegate.mm delete mode 100644 DemoApp/ios/DemoApp/Base.lproj/LaunchScreen.xib create mode 100644 DemoApp/ios/DemoApp/LaunchScreen.storyboard create mode 100644 DemoApp/tsconfig.json diff --git a/DemoApp/.bundle/config b/DemoApp/.bundle/config new file mode 100644 index 0000000..848943b --- /dev/null +++ b/DemoApp/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/DemoApp/.eslintrc.js b/DemoApp/.eslintrc.js index 40c6dcd..dcf0be0 100644 --- a/DemoApp/.eslintrc.js +++ b/DemoApp/.eslintrc.js @@ -1,4 +1,16 @@ module.exports = { root: true, extends: '@react-native-community', + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + '@typescript-eslint/no-shadow': ['error'], + 'no-shadow': 'off', + 'no-undef': 'off', + }, + }, + ], }; diff --git a/DemoApp/.flowconfig b/DemoApp/.flowconfig deleted file mode 100644 index 4afc766..0000000 --- a/DemoApp/.flowconfig +++ /dev/null @@ -1,75 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; These should not be required directly -; require from fbjs/lib instead: require('fbjs/lib/warning') -node_modules/warning/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/LoadingView.js - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -munge_underscores=true - -module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation' -module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -untyped-type-import=warn -nonstrict-import=warn -deprecated-type=warn -unsafe-getters-setters=warn -inexact-spread=warn -unnecessary-invariant=warn -signature-verification-failure=warn -deprecated-utility=error - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -^0.105.0 diff --git a/DemoApp/.gitattributes b/DemoApp/.gitattributes deleted file mode 100644 index d42ff18..0000000 --- a/DemoApp/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/DemoApp/.gitignore b/DemoApp/.gitignore index ad572e6..2423126 100644 --- a/DemoApp/.gitignore +++ b/DemoApp/.gitignore @@ -20,6 +20,7 @@ DerivedData *.hmap *.ipa *.xcuserstate +ios/.xcode.env.local # Android/IntelliJ # @@ -28,6 +29,8 @@ build/ .gradle local.properties *.iml +*.hprof +.cxx/ # node.js # @@ -48,12 +51,14 @@ buck-out/ # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output # Bundle artifact *.jsbundle -# CocoaPods +# Ruby / CocoaPods /ios/Pods/ +/vendor/bundle/ diff --git a/DemoApp/.node-version b/DemoApp/.node-version new file mode 100644 index 0000000..b6a7d89 --- /dev/null +++ b/DemoApp/.node-version @@ -0,0 +1 @@ +16 diff --git a/DemoApp/.prettierrc.js b/DemoApp/.prettierrc.js index 5c4de1a..aef1667 100644 --- a/DemoApp/.prettierrc.js +++ b/DemoApp/.prettierrc.js @@ -1,6 +1,7 @@ module.exports = { - bracketSpacing: false, - jsxBracketSameLine: true, + arrowParens: 'avoid', + bracketSameLine: false, + bracketSpacing: true, singleQuote: true, trailingComma: 'all', }; diff --git a/DemoApp/.ruby-version b/DemoApp/.ruby-version new file mode 100644 index 0000000..a603bb5 --- /dev/null +++ b/DemoApp/.ruby-version @@ -0,0 +1 @@ +2.7.5 diff --git a/DemoApp/App.js b/DemoApp/App.tsx similarity index 84% rename from DemoApp/App.js rename to DemoApp/App.tsx index ce38b64..1aa5b97 100644 --- a/DemoApp/App.js +++ b/DemoApp/App.tsx @@ -6,28 +6,25 @@ * @flow */ -import React, {useState, useEffect} from 'react'; +import React from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, - Text, StatusBar, Button, } from 'react-native'; -import {Colors} from 'react-native/Libraries/NewAppScreen'; +import { Colors } from 'react-native/Libraries/NewAppScreen'; import Video from 'react-native-video'; import muxReactNativeVideo from 'mux-react-native-video-sdk'; import app from './package.json'; const MuxVideo = muxReactNativeVideo(Video); -const App: () => React$Node = () => { - const [showVideo, setShowVideo] = useState(false); - - useEffect(() => {}, []); +const App: () => React.ReactNode = () => { + const [showVideo, setShowVideo] = React.useState(false); return ( <> @@ -36,11 +33,6 @@ const App: () => React$Node = () => { - {global.HermesInternal == null ? null : ( - - Engine: Hermes - - )}