-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: move test app to react-native-test-app #2746
Open
Saadnajmi
wants to merge
8
commits into
Shopify:main
Choose a base branch
from
Saadnajmi:rnta
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
64c5d54
Add react-native-test-app
Saadnajmi 6a6fd92
delete fabric app
Saadnajmi c412bb9
move src from paper to example
Saadnajmi 7b42b16
move more stuff over
Saadnajmi 26714ef
update reanimated
Saadnajmi f32f3f9
single app mode + shorter name
Saadnajmi fe206b2
Merge branch 'main' into rnta
wcandillon 2bc3023
:wrench:
wcandillon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
*.binlog | ||
*.hprof | ||
*.xcworkspace/ | ||
*.zip | ||
.DS_Store | ||
.gradle/ | ||
.idea/ | ||
.vs/ | ||
.xcode.env | ||
Pods/ | ||
build/ | ||
dist/* | ||
!dist/.gitignore | ||
local.properties | ||
msbuild.binlog | ||
node_modules/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/** | ||
* Sample React Native App | ||
* https://github.com/facebook/react-native | ||
* | ||
* @format | ||
*/ | ||
|
||
import React from 'react'; | ||
import type {PropsWithChildren} from 'react'; | ||
import { | ||
SafeAreaView, | ||
ScrollView, | ||
StatusBar, | ||
StyleSheet, | ||
Text, | ||
useColorScheme, | ||
View, | ||
} from 'react-native'; | ||
|
||
import { | ||
Colors, | ||
DebugInstructions, | ||
Header, | ||
LearnMoreLinks, | ||
ReloadInstructions, | ||
} from 'react-native/Libraries/NewAppScreen'; | ||
|
||
type SectionProps = PropsWithChildren<{ | ||
title: string; | ||
}>; | ||
|
||
function Section({children, title}: SectionProps): React.JSX.Element { | ||
const isDarkMode = useColorScheme() === 'dark'; | ||
return ( | ||
<View style={styles.sectionContainer}> | ||
<Text | ||
style={[ | ||
styles.sectionTitle, | ||
{ | ||
color: isDarkMode ? Colors.white : Colors.black, | ||
}, | ||
]}> | ||
{title} | ||
</Text> | ||
<Text | ||
style={[ | ||
styles.sectionDescription, | ||
{ | ||
color: isDarkMode ? Colors.light : Colors.dark, | ||
}, | ||
]}> | ||
{children} | ||
</Text> | ||
</View> | ||
); | ||
} | ||
|
||
function App(): React.JSX.Element { | ||
const isDarkMode = useColorScheme() === 'dark'; | ||
|
||
const backgroundStyle = { | ||
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, | ||
}; | ||
|
||
return ( | ||
<SafeAreaView style={backgroundStyle}> | ||
<StatusBar | ||
barStyle={isDarkMode ? 'light-content' : 'dark-content'} | ||
backgroundColor={backgroundStyle.backgroundColor} | ||
/> | ||
<ScrollView | ||
contentInsetAdjustmentBehavior="automatic" | ||
style={backgroundStyle}> | ||
<Header /> | ||
<View | ||
style={{ | ||
backgroundColor: isDarkMode ? Colors.black : Colors.white, | ||
}}> | ||
<Section title="Step One"> | ||
Edit <Text style={styles.highlight}>App.tsx</Text> to change this | ||
screen and then come back to see your edits. | ||
</Section> | ||
<Section title="See Your Changes"> | ||
<ReloadInstructions /> | ||
</Section> | ||
<Section title="Debug"> | ||
<DebugInstructions /> | ||
</Section> | ||
<Section title="Learn More"> | ||
Read the docs to discover what to do next: | ||
</Section> | ||
<LearnMoreLinks /> | ||
</View> | ||
</ScrollView> | ||
</SafeAreaView> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
sectionContainer: { | ||
marginTop: 32, | ||
paddingHorizontal: 24, | ||
}, | ||
sectionTitle: { | ||
fontSize: 24, | ||
fontWeight: '600', | ||
}, | ||
sectionDescription: { | ||
marginTop: 8, | ||
fontSize: 18, | ||
fontWeight: '400', | ||
}, | ||
highlight: { | ||
fontWeight: '700', | ||
}, | ||
}); | ||
|
||
export default App; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
buildscript { | ||
apply(from: { | ||
def searchDir = rootDir.toPath() | ||
do { | ||
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle") | ||
if (p.toFile().exists()) { | ||
return p.toRealPath().toString() | ||
} | ||
} while (searchDir = searchDir.getParent()) | ||
throw new GradleException("Could not find `react-native-test-app`"); | ||
}()) | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
dependencies { | ||
getReactNativeDependencies().each { dependency -> | ||
classpath(dependency) | ||
} | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url({ | ||
def searchDir = rootDir.toPath() | ||
do { | ||
def p = searchDir.resolve("node_modules/react-native/android") | ||
if (p.toFile().exists()) { | ||
return p.toRealPath().toString() | ||
} | ||
} while (searchDir = searchDir.getParent()) | ||
throw new GradleException("Could not find `react-native`"); | ||
}()) | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the Gradle Daemon. The setting is | ||
# particularly useful for configuring JVM memory settings for build performance. | ||
# This does not affect the JVM settings for the Gradle client VM. | ||
# The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`. | ||
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute | ||
# projects in parallel. To learn more about parallel task execution, see the | ||
# section on Gradle build performance: | ||
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution. | ||
# Default is `false`. | ||
#org.gradle.parallel=true | ||
|
||
# AndroidX package structure to make it clearer which packages are bundled with the | ||
# Android operating system, and which are packaged with your app's APK | ||
# https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
android.useAndroidX=true | ||
# Automatically convert third-party libraries to use AndroidX | ||
android.enableJetifier=true | ||
# Jetifier randomly fails on these libraries | ||
android.jetifier.ignorelist=hermes-android,react-android | ||
|
||
# Use this property to specify which architecture you want to build. | ||
# You can also override it from the CLI using | ||
# ./gradlew <task> -PreactNativeArchitectures=x86_64 | ||
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 | ||
|
||
# Use this property to enable support to the new architecture. | ||
# This will allow you to use TurboModules and the Fabric render in | ||
# your application. You should enable this flag either if you want | ||
# to write custom TurboModules/Fabric components OR use libraries that | ||
# are providing them. | ||
# Note that this is incompatible with web debugging. | ||
#newArchEnabled=true | ||
#bridgelessEnabled=true | ||
|
||
# Uncomment the line below to build React Native from source. | ||
#react.buildFromSource=true | ||
|
||
# Version of Android NDK to build against. | ||
#ANDROID_NDK_VERSION=26.1.10909125 | ||
|
||
# Version of Kotlin to build against. | ||
#KOTLIN_VERSION=1.8.22 |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
google() | ||
} | ||
} | ||
|
||
rootProject.name = "skia-example" | ||
|
||
apply(from: { | ||
def searchDir = rootDir.toPath() | ||
do { | ||
def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle") | ||
if (p.toFile().exists()) { | ||
return p.toRealPath().toString() | ||
} | ||
} while (searchDir = searchDir.getParent()) | ||
throw new GradleException("Could not find `react-native-test-app`"); | ||
}()) | ||
applyTestAppSettings(settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "skia-example", | ||
"displayName": "skia-example", | ||
"singleApp": "skia-example", | ||
"components": [ | ||
{ | ||
"appKey": "skia-example", | ||
"displayName": "React Native Skia", | ||
"slug": "skia-example" | ||
} | ||
], | ||
"resources": { | ||
"android": [ | ||
"dist/res", | ||
"dist/main.android.jsbundle" | ||
], | ||
"ios": [ | ||
"dist/assets", | ||
"dist/main.ios.jsbundle" | ||
], | ||
"macos": [ | ||
"dist/assets", | ||
"dist/main.macos.jsbundle" | ||
], | ||
"visionos": [ | ||
"dist/assets", | ||
"dist/main.visionos.jsbundle" | ||
], | ||
"windows": [ | ||
"dist/assets", | ||
"dist/main.windows.bundle" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
presets: ['module:@react-native/babel-preset'], | ||
plugins: [ | ||
'react-native-reanimated/plugin', | ||
'transform-inline-environment-variables', | ||
'react-native-reanimated/plugin', | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ws_dir = Pathname.new(__dir__) | ||
ws_dir = ws_dir.parent until | ||
File.exist?("#{ws_dir}/node_modules/react-native-test-app/test_app.rb") || | ||
ws_dir.expand_path.to_s == '/' | ||
require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb" | ||
|
||
workspace 'skia-example.xcworkspace' | ||
|
||
use_test_app! :hermes_enabled => true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unfortunately needed for the E2E testing but I can gladly look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Speaking of, could you approve the CI workflow so I can test this PR better?