Skip to content

Commit bc7beee

Browse files
authored
Next version 8.x (#249)
New version 8.x - perf. optimization: add optional React Compiler - reduce bundle size: split web code via `.web` extention - debugging: no anonymous functions - Update example
1 parent f465d0c commit bc7beee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+12471
-565
lines changed

.eslintrc.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ module.exports = {
22
parser: '@typescript-eslint/parser',
33
extends: [
44
'plugin:react/recommended',
5+
'plugin:react-hooks/recommended-legacy',
56
'plugin:@typescript-eslint/recommended',
67
'plugin:prettier/recommended',
78
],
9+
plugins: ['react-compiler'],
810
parserOptions: {
9-
ecmaVersion: 2023,
11+
ecmaVersion: 2025,
1012
sourceType: 'module',
1113
ecmaFeatures: {jsx: true},
1214
},
@@ -16,6 +18,9 @@ module.exports = {
1618
},
1719
},
1820
rules: {
19-
"@typescript-eslint/no-explicit-any": "off",
20-
}
21+
'@typescript-eslint/no-explicit-any': 'off',
22+
'react-compiler/react-compiler': 'error',
23+
'react-hooks/rules-of-hooks': 'error',
24+
'react-hooks/exhaustive-deps': 'error',
25+
},
2126
};

examples/DemoCodeField/.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
*.xcworkspace/
44
*.zip
55
.DS_Store
6+
.bundle/*
7+
!.bundle/config
68
.gradle/
79
.idea/
810
.vs/
11+
.xcode.env
912
Pods/
1013
build/
11-
dist/
14+
dist/*
15+
!dist/.gitignore
1216
local.properties
1317
msbuild.binlog
1418
node_modules/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}
958 KB
Binary file not shown.

examples/DemoCodeField/Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '< 1.3.4'

examples/DemoCodeField/android/build.gradle

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
buildscript {
2-
def androidTestAppDir = "../node_modules/react-native-test-app/android"
3-
apply(from: "${androidTestAppDir}/dependencies.gradle")
4-
apply(from: "${androidTestAppDir}/test-app-util.gradle")
2+
apply(from: {
3+
def searchDir = rootDir.toPath()
4+
do {
5+
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
6+
if (p.toFile().exists()) {
7+
return p.toRealPath().toString()
8+
}
9+
} while (searchDir = searchDir.getParent())
10+
throw new GradleException("Could not find `react-native-test-app`");
11+
}())
512

613
repositories {
714
mavenCentral()
815
google()
916
}
1017

1118
dependencies {
12-
classpath("com.android.tools.build:gradle:${androidPluginVersion}")
13-
14-
if (isNewArchitectureEnabled(project)) {
15-
classpath("com.facebook.react:react-native-gradle-plugin")
16-
classpath("de.undercouch:gradle-download-task:5.1.0")
19+
getReactNativeDependencies().each { dependency ->
20+
classpath(dependency)
1721
}
1822
}
1923
}
2024

2125
allprojects {
2226
repositories {
23-
maven {
24-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
25-
url("${rootDir}/../node_modules/react-native/android")
26-
}
27+
{
28+
def searchDir = rootDir.toPath()
29+
do {
30+
def p = searchDir.resolve("node_modules/react-native/android")
31+
if (p.toFile().exists()) {
32+
maven {
33+
url(p.toRealPath().toString())
34+
}
35+
break
36+
}
37+
} while (searchDir = searchDir.getParent())
38+
// As of 0.80, React Native is no longer installed from npm
39+
}()
2740
mavenCentral()
2841
google()
2942
}

examples/DemoCodeField/android/gradle.properties

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,29 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
2525
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2626
android.useAndroidX=true
2727
# Automatically convert third-party libraries to use AndroidX
28-
android.enableJetifier=true
29-
30-
# Version of Flipper to use with React Native. Default value is whatever React
31-
# Native defaults to. To disable Flipper, set it to `false`.
32-
#FLIPPER_VERSION=0.125.0
28+
#android.enableJetifier=true
29+
# Jetifier randomly fails on these libraries
30+
#android.jetifier.ignorelist=hermes-android,react-android
31+
32+
# Use this property to specify which architecture you want to build.
33+
# You can also override it from the CLI using
34+
# ./gradlew <task> -PreactNativeArchitectures=x86_64
35+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
36+
37+
# Use this property to enable support to the new architecture.
38+
# This will allow you to use TurboModules and the Fabric render in
39+
# your application. You should enable this flag either if you want
40+
# to write custom TurboModules/Fabric components OR use libraries that
41+
# are providing them.
42+
# Note that this is incompatible with web debugging.
43+
newArchEnabled=true
44+
#bridgelessEnabled=true
3345

34-
# Enable Fabric at runtime.
35-
#USE_FABRIC=1
46+
# Uncomment the line below to build React Native from source.
47+
#react.buildFromSource=true
3648

37-
# Enable new architecture, i.e. Fabric + TurboModule - implies USE_FABRIC=1.
38-
# Note that this is incompatible with web debugging.
39-
#newArchEnabled=true
49+
# Version of Android NDK to build against.
50+
#ANDROID_NDK_VERSION=26.1.10909125
4051

41-
# Uncomment the line below if building react-native from source
42-
#ANDROID_NDK_VERSION=21.4.7075529
52+
# Version of Kotlin to build against.
53+
#KOTLIN_VERSION=1.8.22
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

examples/DemoCodeField/android/gradlew

Lines changed: 28 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)