Skip to content

Commit

Permalink
Merge pull request #2803 from infinitered/lindboe/v10-to-master
Browse files Browse the repository at this point in the history
Ignite X release commit
  • Loading branch information
lindboe authored Oct 14, 2024
2 parents 775104c + 005ef05 commit 4ac8ca8
Show file tree
Hide file tree
Showing 155 changed files with 7,193 additions and 4,307 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
defaults: &defaults
docker:
# Choose the version of Node you want here
- image: cimg/node:18.17.1
- image: cimg/node:20.17.0
working_directory: /mnt/ramdisk/repo

version: 2.1
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- run:
name: Run jest tests
command: yarn test
no_output_timeout: 5m
no_output_timeout: 10m
- save_cache:
name: Save ignite dependency cache
paths:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@ boilerplate/yarn.lock
boilerplate/bun.lockb
boilerplate/.gitignore.template

# Test artifacts
test/artifacts/*

# flame CLI
.config

# Yarn
.yarn/*
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,28 @@ We've put great effort into the documentation as a team, please [read through it

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.74 | The best cross-platform mobile framework |
| React | UI Framework | v18 | The most popular UI framework in the world |
| 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 | v51 | Allows (optional) Expo modules |
| Expo Font | Custom Fonts | v12 | Import custom fonts |
| Expo Localization | Internationalization | v15 | i18n support (including RTL!) |
| Expo Status Bar | Status Bar Library | v1 | Status bar support |
| RN Reanimated | Animations | v3 | Beautiful and performant animations |
| AsyncStorage | Persistence | v1 | State persistence |
| apisauce | REST client | v2 | Communicate with back-end |
| 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 |
| FlashList | FlatList replacement | v1 | A performant drop-in replacement for FlatList |
| Library | Category | Version | Description |
| -------------------------------- | -------------------- | ------- | ---------------------------------------------- |
| React Native | Mobile Framework | v0.74 | The best cross-platform mobile framework |
| React | UI Framework | v18 | The most popular UI framework in the world |
| 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 | v51 | Allows (optional) Expo modules |
| Expo Font | Custom Fonts | v12 | Import custom fonts |
| Expo Localization | Internationalization | v15 | i18n support (including RTL!) |
| Expo Status Bar | Status Bar Library | v1 | Status bar support |
| RN Reanimated | Animations | v3 | Beautiful and performant animations |
| AsyncStorage | Persistence | v1 | State persistence |
| apisauce | REST client | v2 | Communicate with back-end |
| 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 |
| react-native-keyboard-controller | Keyboard library | v1 | Great keyboard manager library |
| FlashList | FlatList replacement | v1 | A performant drop-in replacement for FlatList |

Ignite also comes with a [component library](./docs/boilerplate/app/components/Components.md) that is tuned for custom designs, theming support, testing, custom fonts, generators, and much, much more.

Expand Down
8 changes: 8 additions & 0 deletions boilerplate/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
ios
android
.expo
.vscode
ignite/ignite.json
package.json
.eslintignore
54 changes: 54 additions & 0 deletions boilerplate/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
extends: [
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-native/all",
// `expo` must come after `standard` or its globals configuration will be overridden
"expo",
// `jsx-runtime` must come after `expo` or it will be overridden
"plugin:react/jsx-runtime",
"prettier",
],
plugins: ["reactotron", "prettier"],
rules: {
"prettier/prettier": "error",
// typescript-eslint
"@typescript-eslint/array-type": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-var-requires": 0,
// eslint
"no-use-before-define": 0,
"no-restricted-imports": [
"error",
{
paths: [
// Prefer named exports from 'react' instead of importing `React`
{
name: "react",
importNames: ["default"],
message: "Import named exports from 'react' instead.",
},
],
},
],
//react-native
"react-native/no-raw-text": 0,
// reactotron
"reactotron/no-tron-in-production": "error",
// eslint-config-standard overrides
"comma-dangle": 0,
"no-global-assign": 0,
"quotes": 0,
"space-before-function-paren": 0,
},
}
4 changes: 4 additions & 0 deletions boilerplate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ buck-out/
bin/Exponent.app
/android
/ios
expo-env.d.ts

## Secrets
npm-debug.*
Expand All @@ -86,3 +87,6 @@ web-build/
!env.js

/coverage

# Yarn
.yarn/*
2 changes: 2 additions & 0 deletions boilerplate/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
ios
android
.expo
.vscode
ignite/ignite.json
package.json
.eslintignore
7 changes: 7 additions & 0 deletions boilerplate/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "all",
"quoteProps": "consistent"
}
3 changes: 1 addition & 2 deletions boilerplate/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "@expo/metro-runtime"
import React from "react"
import * as SplashScreen from "expo-splash-screen"
import App from "./app/app"
import App from "@/app"

SplashScreen.preventAutoHideAsync()

Expand Down
7 changes: 2 additions & 5 deletions boilerplate/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require("ts-node/register")

/**
* @param config ExpoConfig coming from the static config app.json if it exists
*
*
* You can read more about Expo's Configuration Resolution Rules here:
* https://docs.expo.dev/workflow/configuration/#configuration-resolution-rules
*/
Expand All @@ -17,9 +17,6 @@ module.exports = ({ config }: ConfigContext): Partial<ExpoConfig> => {

return {
...config,
plugins: [
...existingPlugins,
require("./plugins/withSplashScreen").withSplashScreen,
],
plugins: [...existingPlugins, require("./plugins/withSplashScreen").withSplashScreen],
}
}
1 change: 1 addition & 0 deletions boilerplate/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scheme": "helloworld",
"version": "1.0.0",
"orientation": "portrait",
"userInterfaceStyle": "automatic",
"icon": "./assets/images/app-icon-all.png",
"splash": {
"image": "./assets/images/splash-logo-all.png",
Expand Down
39 changes: 30 additions & 9 deletions boilerplate/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ if (__DEV__) {
require("./devtools/ReactotronConfig.ts")
}
import "./utils/gestureHandler"
import "./i18n"
import { initI18n } from "./i18n"
import "./utils/ignoreWarnings"
import { useFonts } from "expo-font"
import React from "react"
import { useEffect, useState } from "react"
import { initialWindowMetrics, SafeAreaProvider } from "react-native-safe-area-context"
import * as Linking from "expo-linking"
import { useInitialRootStore } from "./models"
import { useInitialRootStore } from "./models" // @mst remove-current-line
import { AppNavigator, useNavigationPersistence } from "./navigators"
import { ErrorBoundary } from "./screens/ErrorScreen/ErrorBoundary"
import * as storage from "./utils/storage"
import { customFontsToLoad } from "./theme"
import Config from "./config"
import { KeyboardProvider } from "react-native-keyboard-controller"
import { loadDateFnsLocale } from "./utils/formatDate"

export const NAVIGATION_PERSISTENCE_KEY = "NAVIGATION_STATE"

Expand Down Expand Up @@ -71,15 +73,26 @@ function App(props: AppProps) {
} = useNavigationPersistence(storage, NAVIGATION_PERSISTENCE_KEY)

const [areFontsLoaded, fontLoadError] = useFonts(customFontsToLoad)
const [isI18nInitialized, setIsI18nInitialized] = useState(false)

useEffect(() => {
initI18n()
.then(() => setIsI18nInitialized(true))
.then(() => loadDateFnsLocale())
}, [])

// @mst replace-next-line React.useEffect(() => {
const { rehydrated } = useInitialRootStore(() => {
// @mst replace-next-line
// This runs after the root store has been initialized and rehydrated.

// If your initialization scripts run very fast, it's good to show the splash screen for just a bit longer to prevent flicker.
// Slightly delaying splash screen hiding for better UX; can be customized or removed as needed,
// Note: (vanilla Android) The splash-screen will not appear if you launch your app via the terminal or Android Studio. Kill the app and launch it normally by tapping on the launcher icon. https://stackoverflow.com/a/69831106
// Note: (vanilla iOS) You might notice the splash-screen logo change size. This happens in debug/development mode. Try building the app for release.
setTimeout(hideSplashScreen, 500)

// @mst replace-next-line }, [])
})

// Before we show the app, we have to wait for our state to be ready.
Expand All @@ -88,7 +101,13 @@ function App(props: AppProps) {
// In iOS: application:didFinishLaunchingWithOptions:
// In Android: https://stackoverflow.com/a/45838109/204044
// You can replace with your own loading component if you wish.
if (!rehydrated || !isNavigationStateRestored || (!areFontsLoaded && !fontLoadError)) {
// @mst replace-next-line if (!isNavigationStateRestored || (!areFontsLoaded && !fontLoadError)) {
if (
!rehydrated ||
!isNavigationStateRestored ||
!isI18nInitialized ||
(!areFontsLoaded && !fontLoadError)
) {
return null
}

Expand All @@ -101,11 +120,13 @@ function App(props: AppProps) {
return (
<SafeAreaProvider initialMetrics={initialWindowMetrics}>
<ErrorBoundary catchErrors={Config.catchErrors}>
<AppNavigator
linking={linking}
initialState={initialNavigationState}
onStateChange={onNavigationStateChange}
/>
<KeyboardProvider>
<AppNavigator
linking={linking}
initialState={initialNavigationState}
onStateChange={onNavigationStateChange}
/>
</KeyboardProvider>
</ErrorBoundary>
</SafeAreaProvider>
)
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/app/components/AutoImage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useLayoutEffect, useState } from "react"
import { useLayoutEffect, useState } from "react"
import { Image, ImageProps, ImageURISource, Platform } from "react-native"

export interface AutoImageProps extends ImageProps {
Expand Down
Loading

0 comments on commit 4ac8ca8

Please sign in to comment.