Skip to content
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!: RN 0.72.6 and Expo 49 #2446

Merged
merged 78 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d68f34c
chore: RN 0.72.0-rc.3 and Expo 49 alpha.3
frankcalise May 24, 2023
772f1de
chore: alpha4 expo 49 and RN rc6
frankcalise Jun 14, 2023
6c62b83
chore: package updates
frankcalise Jun 29, 2023
e64d38a
chore: merge branch 'master' into feat/rn-72-expo-49
frankcalise Jun 30, 2023
ca98ae8
chore: remove webpack-config dep, expo uses metro now
frankcalise Jun 30, 2023
0c77940
feat(web): metro over webpack for SDK 49
frankcalise Jun 30, 2023
ef58d4f
chore: tsc fix
frankcalise Jun 30, 2023
f10956a
Ignite Expresso (#2476 by @frankcalise)
frankcalise Jul 13, 2023
ed0b3af
docs(readme): move documentation link higher, update versions
frankcalise Jul 13, 2023
005c2de
feat(boilerplate): add in default eas.json for EAS Build
frankcalise Jul 13, 2023
bf300e1
chore(boilerplate): eas.json updates
frankcalise Jul 14, 2023
ea415d8
chore: cherry-pick 2e24ef8
mazenchami Jul 10, 2023
c3fd3c5
chore: remaining TS strict fixes
frankcalise Jul 14, 2023
6962ad7
feat(boilerplate): expo TS paths in favor of babel plugin
frankcalise Jul 14, 2023
c62ed38
fix(demo): podcast list data
frankcalise Jul 17, 2023
c4d79dd
fix(demo): tab icons
frankcalise Jul 17, 2023
434a4e8
fix(boilerplate): podfile.lock
frankcalise Jul 17, 2023
c240385
overloading Array.filter for the special case of the Boolean constructor
mazenchami Jul 17, 2023
735121b
fix(boilerplate): update reactotron deps, type fixes
frankcalise Jul 20, 2023
4a5e225
chore: gitignore for flame cli 🔥
frankcalise Jul 20, 2023
322975f
refactor(cli): rework experimental flag for more flexible options
frankcalise Jul 20, 2023
3044899
fix(cli): kebab-case over camelCase for flags
frankcalise Jul 20, 2023
dbcd641
fix(ReactotronConfig): update to chain
joshuayoes Jul 20, 2023
e94a25a
Merge branch 'master' into feat/rn-72-expo-49
jamonholmgren Jul 25, 2023
757f850
chore(boilerplate): remove native dirs
frankcalise Jul 26, 2023
2cecd7c
feat(cli): workflow options go/prebuild/manual
frankcalise Jul 26, 2023
cf24469
feat(boilerplate): add fabric bool to demo debug screen
frankcalise Jul 26, 2023
9502968
chore(boilerplate): dep updates
frankcalise Jul 26, 2023
653af08
fix(cli): workflow name value mapping
frankcalise Jul 26, 2023
d345de6
fix(cli): fix cache issue with tests
frankcalise Jul 26, 2023
0d1a8d9
docs(releasing-ignite): fixed package.json snippet to be more accurate
frankcalise Jul 27, 2023
af34b66
fix(cli): #2225 remove-demo finds all empty dirs
frankcalise Jul 27, 2023
99e5946
fix(boilerplate): #2230
frankcalise Jul 27, 2023
2ca37f7
chore(boilerplate): update reactotron deps
frankcalise Jul 27, 2023
74650b6
fix(cli): drop improper flag from prebuild
frankcalise Jul 28, 2023
7fd9e1b
feat(cli): add prebuild progress message
frankcalise Jul 28, 2023
688e553
fix(boilerplate): removed unnecessary expo deps
frankcalise Jul 28, 2023
efc5e1d
fix(cli): new arch bools before prebuild
frankcalise Jul 28, 2023
e5d045a
chore: dir clean up, win32 compat
frankcalise Aug 2, 2023
258e8c0
feat(boilerplate): config plugin scaffolding (#2487 by @frankcalise)
frankcalise Aug 4, 2023
65c4d0b
fix(cli): new arch toggle
frankcalise Aug 5, 2023
11cc2c8
docs(readme): add more badges
frankcalise Aug 5, 2023
ea88b0c
docs(readme): remove expo badge
frankcalise Aug 5, 2023
b13852b
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Aug 8, 2023
7d8eef5
Update README.md
frankcalise Aug 22, 2023
ba65810
chore(boilerplate): remove unused overrides
frankcalise Aug 22, 2023
9a37093
fix(boilerplate): better new arch support
frankcalise Aug 23, 2023
eecac88
chore(boilerplate) Update react-native to 0.72.5 (#2505)
markrickert Sep 28, 2023
7d78fc6
feat(cli): add bun support (#2497 by @frankcalise @jamonholmgren)
frankcalise Oct 1, 2023
4f03467
chore: Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 1, 2023
9b768dd
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 3, 2023
fce89e1
fix(cli): Expo Go compat deps (#2508 by @frankcalise and @markrickert)
frankcalise Oct 3, 2023
19a0aff
fix(boilerplate): update type import
frankcalise Oct 4, 2023
b1b33c2
fix: ios compiling issue when the user specifies the new architecture…
markrickert Oct 10, 2023
bddaea5
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 10, 2023
1ac2870
feat(boilerplate) `@shopify/flash-list` integration and ListView HOC …
markrickert Oct 11, 2023
23c3953
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 11, 2023
c484e3d
fix(boilerplate): inherit default metro from expo (#2526 by @frankcal…
frankcalise Oct 17, 2023
d1968de
fix(web): Fixes web implementation (#2528)
markrickert Oct 17, 2023
4052df2
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 22, 2023
924a624
chore: RN to 0.72.6 and build commands (#2532 by @frankcalise)
frankcalise Oct 26, 2023
4d30729
feat(cli): adds bun path / version to doctor (#2523 by @frankcalise)
frankcalise Oct 26, 2023
775c751
fix(cli): support for kebab-case names (#2534 by @frankcalise)
frankcalise Oct 30, 2023
af1b925
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Oct 30, 2023
a75f321
Merge branch 'master' into feat/rn-72-expo-49
jamonholmgren Nov 8, 2023
b231ae8
chore: remove unused deps, upgrade mobx (#2543 by @frankcalise)
frankcalise Nov 8, 2023
ca36ac7
Add timeout to avoid long-term hangs (#2546 by @jamonholmgren)
jamonholmgren Nov 10, 2023
21945e8
chore: remove bunfig disabling peer install (#2548 by @frankcalise)
frankcalise Nov 10, 2023
963e394
chore(doctor): fix var typo
frankcalise Nov 13, 2023
c7fe3d1
chore: merge branch 'master' into feat/rn-72-expo-49
frankcalise Nov 15, 2023
5211701
chore: tsc fixes
frankcalise Nov 15, 2023
0696baa
fix(boilerplate): estimatedItemSize warning
frankcalise Nov 15, 2023
26f6d0a
chore: formatting
frankcalise Nov 15, 2023
0141a0b
fix(cli): docs link typo
frankcalise Nov 15, 2023
cf5e6b4
Update boilerplate/app/models/helpers/setupRootStore.ts
frankcalise Nov 15, 2023
d001eb0
Merge branch 'master' into feat/rn-72-expo-49
frankcalise Nov 16, 2023
b03e91c
chore: update rn version, expo compat (#2555 by @frankcalise)
frankcalise Nov 16, 2023
db31dea
fix(cli): remove demo markup if keeping demo files (#2556 by @frankca…
frankcalise Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,37 @@ The culmination of over six years of constant React Native development, Ignite i

This is the React Native boilerplate that the [Infinite Red](https://infinite.red) team uses on a day-to-day basis to build client apps. Developers who use Ignite report that it saves them two to four weeks of time on average off the beginning of their React Native project!

## [Full Documentation](https://github.com/infinitered/ignite/blob/master/docs)

We've put great effort into the documentation as a team, please [read through it here](https://github.com/infinitered/ignite/blob/master/docs). If you're unsure why a certain decision was made related to this boilerplate or how to proceed with a particular feature, it's likely documented. If it still isn't clear, go through the proper [help channels](#reporting-bugs--getting-help) and we always welcome PRs to improve the docs!

## Tech Stack

Nothing makes it into Ignite unless it's been proven on projects that Infinite Red works on. Ignite apps include the following rock-solid technical decisions out of the box:

| Library | Category | Version | Description |
| ----------------- | -------------------- | ------- | ---------------------------------------------- |
| React Native | Mobile Framework | v0.71 | The best cross-platform mobile framework |
| React Native | Mobile Framework | v0.72 | The best cross-platform mobile framework |
| React | UI Framework | v18 | The most popular UI framework in the world |
| TypeScript | Language | v4 | Static typechecking |
| TypeScript | Language | v5 | Static typechecking |
| React Navigation | Navigation | v6 | Performant and consistent navigation framework |
| MobX-State-Tree | State Management | v5 | Observable state tree |
| MobX-React-Lite | React Integration | v3 | Re-render React performantly |
| Expo | SDK | v48 | Allows (optional) Expo modules |
| Expo Font | Custom Fonts | v10 | Import custom fonts |
| Expo Localization | Internationalization | v13 | i18n support (including RTL!) |
| Expo | SDK | v49 | Allows (optional) Expo modules |
| Expo Font | Custom Fonts | v11 | Import custom fonts |
| Expo Localization | Internationalization | v14 | i18n support (including RTL!) |
| Expo Status Bar | Status Bar Library | v1 | Status bar support |
| RN Reanimated | Animations | v2 | Beautiful and performant animations |
| RN Reanimated | Animations | v3 | Beautiful and performant animations |
| AsyncStorage | Persistence | v1 | State persistence |
| apisauce | REST client | v2 | Communicate with back-end |
| Flipper | Debugger | | Native debugging |
| Reactotron RN | Inspector/Debugger | v2 | JS debugging |
| Reactotron RN | Inspector/Debugger | v3 | JS debugging |
| Hermes | JS engine | | Fine-tuned JS engine for RN |
| Jest | Test Runner | v26 | Standard test runner for JS apps |
| Maestro | Testing Framework | | Automate end-to-end UI testing |
| date-fns | Date library | v2 | Excellent date library |

Ignite also comes with a [component library](https://github.com/infinitered/ignite/blob/master/docs/Components.md) that is tuned for custom designs, theming support, testing, custom fonts, generators, and much, much more.

[Check out the documentation!](https://github.com/infinitered/ignite/blob/master/docs)

## Quick Start

Prerequisites:
Expand Down
2 changes: 2 additions & 0 deletions boilerplate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ web-build/

# Configurations
!env.js

/coverage
19 changes: 0 additions & 19 deletions boilerplate/App.js

This file was deleted.

11 changes: 11 additions & 0 deletions boilerplate/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import App from "./app/app"
import React from "react"
import * as SplashScreen from "expo-splash-screen"

SplashScreen.preventAutoHideAsync()

function IgniteApp() {
return <App hideSplashScreen={SplashScreen.hideAsync} />
}

export default IgniteApp
55 changes: 0 additions & 55 deletions boilerplate/android/app/BUCK

This file was deleted.

129 changes: 58 additions & 71 deletions boilerplate/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile

def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
def expoDebuggableVariants = ['debug']
// Override `debuggableVariants` for expo-updates debugging
if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == "1") {
react {
expoDebuggableVariants = []
}
}


/**
* This is the configuration block to customize your React Native Android app.
Expand All @@ -21,17 +11,20 @@ react {
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
debuggableVariants = expoDebuggableVariants
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()

// Use Expo CLI to bundle the app, this ensures the Metro config
// works correctly with Expo projects.
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"

/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand All @@ -42,9 +35,7 @@ react {
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"

//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
Expand All @@ -67,19 +58,6 @@ react {
// hermesFlags = ["-O", "-output-source-map"]
}

// Override `hermesEnabled` by `expo.jsEngine`
ext {
hermesEnabled = (findProperty('expo.jsEngine') ?: "hermes") == "hermes"
}

/**
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false

/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
Expand All @@ -98,37 +76,20 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea
*/
def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.helloworld"
namespace 'com.helloworld'
defaultConfig {
applicationId "com.helloworld"
applicationId 'com.helloworld'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
versionName "1.0.0"

splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
signingConfigs {
debug {
Expand All @@ -146,24 +107,29 @@ android {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}

// Apply static values from `gradle.properties` to the `android.packagingOptions`
// Accepts values in comma delimited lists, example:
// android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini
["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop ->
// Split option: 'foo,bar' -> ['foo', 'bar']
def options = (findProperty("android.packagingOptions.$prop") ?: "").split(",");
// Trim all elements in place.
for (i in 0..<options.size()) options[i] = options[i].trim();
// `[] - ""` is essentially `[""].filter(Boolean)` removing all empty strings.
options -= ""

if (options.length > 0) {
println "android.packagingOptions.$prop += $options ($options.length)"
// Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
options.each {
android.packagingOptions[prop] += it
}
}
}
Expand All @@ -172,22 +138,43 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

// RN BootSplash
implementation("androidx.core:core-splashscreen:1.0.0")
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
def frescoVersion = rootProject.ext.frescoVersion

// If your app supports Android versions before Ice Cream Sandwich (API level 14)
if (isGifEnabled || isWebpEnabled) {
implementation("com.facebook.fresco:fresco:${frescoVersion}")
implementation("com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}")
}

if (isGifEnabled) {
// For animated gif support
implementation("com.facebook.fresco:animated-gif:${frescoVersion}")
}

if (isWebpEnabled) {
// For webp support
implementation("com.facebook.fresco:webpsupport:${frescoVersion}")
if (isWebpAnimatedEnabled) {
// Animated webp support
implementation("com.facebook.fresco:animated-webp:${frescoVersion}")
}
}

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesAppBuildGradle(project)
4 changes: 4 additions & 0 deletions boilerplate/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# react-native-reanimated
-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }

# Add any project specific keep options here:
8 changes: 1 addition & 7 deletions boilerplate/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
Expand All @@ -35,7 +34,6 @@ public static void initializeFlipper(Context context, ReactInstanceManager react
final FlipperClient client = AndroidFlipperClient.getInstance(context);

client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
Expand Down
Loading