Skip to content

Commit

Permalink
chore(update): update react native
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyDolle committed Sep 19, 2024
1 parent 274029d commit 9fda3bf
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 32 deletions.
7 changes: 3 additions & 4 deletions template/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
21 changes: 11 additions & 10 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
*/
react {
/* 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 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")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -49,6 +49,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -114,5 +117,3 @@ dependencies {
implementation jscFlavor
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
3 changes: 2 additions & 1 deletion template/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
>
android:supportsRtl="true"
>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
2 changes: 1 addition & 1 deletion template/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "1.9.24"
}
repositories {
google()
Expand Down
2 changes: 0 additions & 2 deletions template/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# 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

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down
2 changes: 1 addition & 1 deletion template/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion template/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
4 changes: 3 additions & 1 deletion template/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'Boilerplate'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
14 changes: 7 additions & 7 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@tanstack/react-query": "^5.31.0",
"i18next": "^23.11.2",
"ky": "^1.2.4",
"react": "18.2.0",
"react": "18.3.1",
"react-i18next": "^14.1.0",
"react-native": "0.74.1",
"react-native": "0.75.3",
"react-native-gesture-handler": "^2.16.0",
"react-native-mmkv": "^2.12.2",
"react-native-reanimated": "^3.9.0-rc.1",
Expand All @@ -34,10 +34,10 @@
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.74.83",
"@react-native/eslint-config": "0.74.83",
"@react-native/metro-config": "0.74.83",
"@react-native/typescript-config": "0.74.83",
"@react-native/babel-preset": "0.75.3",
"@react-native/eslint-config": "0.75.3",
"@react-native/metro-config": "0.75.3",
"@react-native/typescript-config": "0.75.3",
"@testing-library/jest-native": "^5.4.2",
"@testing-library/react-native": "^12.1.2",
"@types/jest": "^29.4.0",
Expand All @@ -58,7 +58,7 @@
"eslint-plugin-jsx-a11y": "^6.8.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"react-test-renderer": "18.3.1",
"reactotron-react-native": "^5.1.6",
"reactotron-react-native-mmkv": "^0.2.6",
"reactotron-react-query": "^1.0.4",
Expand Down
8 changes: 7 additions & 1 deletion template/src/theme/borders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export const generateBorderRadius = () => {
},
[`roundedBottom_${radius}`]: {
borderBottomLeftRadius: radius,
borderBottomRightRadiusRadius: radius,
borderBottomRightRadius: radius,
},
[`roundedBottomRight_${radius}`]: {
borderBottomRightRadius: radius,
},
[`roundedTopLeft_${radius}`]: {
borderTopLeftRadius: radius,
},
});
}, {} as BorderRadius & BorderTopRadius & BorderBottomRadius);
Expand Down
21 changes: 18 additions & 3 deletions template/src/types/theme/borders.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { config } from '@/theme/_config';
import { staticBorderStyles } from '@/theme/borders';

import type { config } from '@/theme/_config';
import type { staticBorderStyles } from '@/theme/borders';
import type { ArrayValue, RemoveBeforeSeparator, ToNumber } from './common';
import type { UnionConfiguration } from './config';

Expand Down Expand Up @@ -29,11 +28,27 @@ type BorderBottomRadiusKeys = `roundedBottom_${ArrayValue<
typeof config.borders.radius
>}`;

type BorderBottomRightRadiusKeys = `roundedBottomRight_${ArrayValue<
typeof config.borders.radius
>}`;

type BorderTopLeftRadiusKeys = `roundedTopLeft_${ArrayValue<
typeof config.borders.radius
>}`;

export type BorderBottomRadius = {
[key in BorderBottomRadiusKeys]: {
borderBottomLeftRadius: ToNumber<RemoveBeforeSeparator<key>>;
borderBottomRightRadius: ToNumber<RemoveBeforeSeparator<key>>;
};
} & {
[key in BorderBottomRightRadiusKeys]: {
borderBottomRightRadius: ToNumber<RemoveBeforeSeparator<key>>;
};
} & {
[key in BorderTopLeftRadiusKeys]: {
borderTopLeftRadius: ToNumber<RemoveBeforeSeparator<key>>;
};
};

type BorderRadiusKeys = `rounded_${ArrayValue<typeof config.borders.radius>}`;
Expand Down

0 comments on commit 9fda3bf

Please sign in to comment.