From be521e4c88285dcb67b135bb79e2c6f397d31c9a Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Mon, 6 Feb 2023 13:06:40 +0100 Subject: [PATCH 01/36] Init FabricExample --- FabricExample/.bundle/config | 2 + FabricExample/.eslintrc.js | 4 + FabricExample/.gitignore | 63 + FabricExample/.prettierrc.js | 7 + FabricExample/.ruby-version | 1 + FabricExample/.watchmanconfig | 1 + FabricExample/App.tsx | 127 + FabricExample/Gemfile | 6 + FabricExample/Gemfile.lock | 100 + FabricExample/__tests__/App-test.tsx | 14 + FabricExample/_node-version | 1 + FabricExample/android/app/build.gradle | 170 + FabricExample/android/app/debug.keystore | Bin 0 -> 2257 bytes FabricExample/android/app/proguard-rules.pro | 10 + .../android/app/src/debug/AndroidManifest.xml | 13 + .../com/fabricexample/ReactNativeFlipper.java | 75 + .../android/app/src/main/AndroidManifest.xml | 25 + .../java/com/fabricexample/MainActivity.java | 35 + .../com/fabricexample/MainApplication.java | 62 + .../res/drawable/rn_edit_text_material.xml | 36 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 9 + .../com/fabricexample/ReactNativeFlipper.java | 20 + FabricExample/android/build.gradle | 21 + FabricExample/android/gradle.properties | 44 + .../android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59821 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + FabricExample/android/gradlew | 234 + FabricExample/android/gradlew.bat | 89 + FabricExample/android/settings.gradle | 4 + FabricExample/app.json | 4 + FabricExample/babel.config.js | 3 + FabricExample/examples/Basic.tsx | 276 + FabricExample/examples/Functional.tsx | 207 + FabricExample/examples/GetSetClear.tsx | 77 + FabricExample/examples/MergeItem.tsx | 231 + FabricExample/examples/tests.ts | 51 + FabricExample/index.js | 9 + FabricExample/ios/.xcode.env | 1 + .../FabricExample.xcodeproj/project.pbxproj | 704 ++ .../xcschemes/FabricExample.xcscheme | 88 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + FabricExample/ios/FabricExample/AppDelegate.h | 6 + .../ios/FabricExample/AppDelegate.mm | 36 + .../AppIcon.appiconset/Contents.json | 53 + .../Images.xcassets/Contents.json | 6 + FabricExample/ios/FabricExample/Info.plist | 55 + .../ios/FabricExample/LaunchScreen.storyboard | 47 + FabricExample/ios/FabricExample/main.m | 10 + .../FabricExampleTests/FabricExampleTests.m | 66 + .../ios/FabricExampleTests/Info.plist | 24 + FabricExample/ios/Podfile | 62 + FabricExample/ios/Podfile.lock | 987 +++ FabricExample/ios/_xcode.env | 11 + FabricExample/metro.config.js | 37 + FabricExample/package.json | 37 + FabricExample/tsconfig.json | 3 + FabricExample/yarn.lock | 6921 +++++++++++++++++ 69 files changed, 11211 insertions(+) create mode 100644 FabricExample/.bundle/config create mode 100644 FabricExample/.eslintrc.js create mode 100644 FabricExample/.gitignore create mode 100644 FabricExample/.prettierrc.js create mode 100644 FabricExample/.ruby-version create mode 100644 FabricExample/.watchmanconfig create mode 100644 FabricExample/App.tsx create mode 100644 FabricExample/Gemfile create mode 100644 FabricExample/Gemfile.lock create mode 100644 FabricExample/__tests__/App-test.tsx create mode 100644 FabricExample/_node-version create mode 100644 FabricExample/android/app/build.gradle create mode 100644 FabricExample/android/app/debug.keystore create mode 100644 FabricExample/android/app/proguard-rules.pro create mode 100644 FabricExample/android/app/src/debug/AndroidManifest.xml create mode 100644 FabricExample/android/app/src/debug/java/com/fabricexample/ReactNativeFlipper.java create mode 100644 FabricExample/android/app/src/main/AndroidManifest.xml create mode 100644 FabricExample/android/app/src/main/java/com/fabricexample/MainActivity.java create mode 100644 FabricExample/android/app/src/main/java/com/fabricexample/MainApplication.java create mode 100644 FabricExample/android/app/src/main/res/drawable/rn_edit_text_material.xml create mode 100644 FabricExample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 FabricExample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 FabricExample/android/app/src/main/res/values/strings.xml create mode 100644 FabricExample/android/app/src/main/res/values/styles.xml create mode 100644 FabricExample/android/app/src/release/java/com/fabricexample/ReactNativeFlipper.java create mode 100644 FabricExample/android/build.gradle create mode 100644 FabricExample/android/gradle.properties create mode 100644 FabricExample/android/gradle/wrapper/gradle-wrapper.jar create mode 100644 FabricExample/android/gradle/wrapper/gradle-wrapper.properties create mode 100755 FabricExample/android/gradlew create mode 100644 FabricExample/android/gradlew.bat create mode 100644 FabricExample/android/settings.gradle create mode 100644 FabricExample/app.json create mode 100644 FabricExample/babel.config.js create mode 100644 FabricExample/examples/Basic.tsx create mode 100644 FabricExample/examples/Functional.tsx create mode 100644 FabricExample/examples/GetSetClear.tsx create mode 100644 FabricExample/examples/MergeItem.tsx create mode 100644 FabricExample/examples/tests.ts create mode 100644 FabricExample/index.js create mode 100644 FabricExample/ios/.xcode.env create mode 100644 FabricExample/ios/FabricExample.xcodeproj/project.pbxproj create mode 100644 FabricExample/ios/FabricExample.xcodeproj/xcshareddata/xcschemes/FabricExample.xcscheme create mode 100644 FabricExample/ios/FabricExample.xcworkspace/contents.xcworkspacedata create mode 100644 FabricExample/ios/FabricExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 FabricExample/ios/FabricExample/AppDelegate.h create mode 100644 FabricExample/ios/FabricExample/AppDelegate.mm create mode 100644 FabricExample/ios/FabricExample/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 FabricExample/ios/FabricExample/Images.xcassets/Contents.json create mode 100644 FabricExample/ios/FabricExample/Info.plist create mode 100644 FabricExample/ios/FabricExample/LaunchScreen.storyboard create mode 100644 FabricExample/ios/FabricExample/main.m create mode 100644 FabricExample/ios/FabricExampleTests/FabricExampleTests.m create mode 100644 FabricExample/ios/FabricExampleTests/Info.plist create mode 100644 FabricExample/ios/Podfile create mode 100644 FabricExample/ios/Podfile.lock create mode 100644 FabricExample/ios/_xcode.env create mode 100644 FabricExample/metro.config.js create mode 100644 FabricExample/package.json create mode 100644 FabricExample/tsconfig.json create mode 100644 FabricExample/yarn.lock diff --git a/FabricExample/.bundle/config b/FabricExample/.bundle/config new file mode 100644 index 00000000..848943bb --- /dev/null +++ b/FabricExample/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/FabricExample/.eslintrc.js b/FabricExample/.eslintrc.js new file mode 100644 index 00000000..40c6dcd0 --- /dev/null +++ b/FabricExample/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/FabricExample/.gitignore b/FabricExample/.gitignore new file mode 100644 index 00000000..16f8c307 --- /dev/null +++ b/FabricExample/.gitignore @@ -0,0 +1,63 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +ios/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# 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/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +/ios/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/FabricExample/.prettierrc.js b/FabricExample/.prettierrc.js new file mode 100644 index 00000000..2b540746 --- /dev/null +++ b/FabricExample/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/FabricExample/.ruby-version b/FabricExample/.ruby-version new file mode 100644 index 00000000..49cdd668 --- /dev/null +++ b/FabricExample/.ruby-version @@ -0,0 +1 @@ +2.7.6 diff --git a/FabricExample/.watchmanconfig b/FabricExample/.watchmanconfig new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/FabricExample/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/FabricExample/App.tsx b/FabricExample/App.tsx new file mode 100644 index 00000000..5e156ce2 --- /dev/null +++ b/FabricExample/App.tsx @@ -0,0 +1,127 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React, {useCallback, useMemo, useState} from 'react'; +import { + Button, + Keyboard, + SafeAreaView, + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; +import Basic from './examples/Basic'; +import Functional from './examples/Functional'; +import GetSetClear from './examples/GetSetClear'; +import MergeItem from './examples/MergeItem'; + +const SCREENS = { + Functional, + GetSetClear, + MergeItem, + Basic, +}; + +export default function App(): JSX.Element { + const [iteration, setIteration] = useState(0); + const [currentTest, setCurrentTest] = useState(SCREENS.Functional); + + const dismissKeyboard = useCallback(Keyboard.dismiss, []); + const simulateRestart = useCallback( + () => setIteration(iteration + 1), + [iteration], + ); + const navigationBar = useMemo( + () => + Object.values(SCREENS).map(t => { + const {testId, title} = t; + return ( +