@nrwl/react-native 14.8.7 → 14.9.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/LICENSE +22 -22
- package/README.md +6 -27
- package/migrations.json +268 -0
- package/package.json +13 -13
- package/plugins/metro-resolver.js +16 -5
- package/plugins/metro-resolver.js.map +1 -1
- package/project.json +5 -35
- package/src/executors/build-android/build-android.impl.js +3 -4
- package/src/executors/build-android/build-android.impl.js.map +1 -1
- package/src/executors/build-android/build-android.impl.ts +4 -4
- package/src/executors/build-android/schema.json +4 -1
- package/src/executors/bundle/bundle.impl.js +2 -2
- package/src/executors/bundle/bundle.impl.js.map +1 -1
- package/src/executors/bundle/bundle.impl.ts +4 -3
- package/src/executors/bundle/schema.d.ts +1 -1
- package/src/executors/bundle/schema.json +5 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +1 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +1 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +2 -1
- package/src/executors/ensure-symlink/schema.json +2 -0
- package/src/executors/run-android/run-android.impl.js +8 -4
- package/src/executors/run-android/run-android.impl.js.map +1 -1
- package/src/executors/run-android/run-android.impl.ts +8 -3
- package/src/executors/run-android/schema.d.ts +1 -0
- package/src/executors/run-android/schema.json +11 -2
- package/src/executors/run-ios/run-ios.impl.js +1 -1
- package/src/executors/run-ios/run-ios.impl.js.map +1 -1
- package/src/executors/run-ios/run-ios.impl.ts +2 -1
- package/src/executors/run-ios/schema.json +21 -7
- package/src/executors/start/schema.json +4 -1
- package/src/executors/start/start.impl.js +2 -2
- package/src/executors/start/start.impl.js.map +1 -1
- package/src/executors/start/start.impl.ts +3 -2
- package/src/executors/storybook/schema.json +2 -0
- package/src/executors/storybook/storybook.impl.js +1 -1
- package/src/executors/storybook/storybook.impl.js.map +1 -1
- package/src/executors/storybook/storybook.impl.ts +2 -1
- package/src/executors/sync-deps/schema.json +2 -0
- package/src/executors/sync-deps/sync-deps.impl.js +1 -1
- package/src/executors/sync-deps/sync-deps.impl.js.map +1 -1
- package/src/executors/sync-deps/sync-deps.impl.ts +2 -1
- package/src/generators/application/application.d.ts +1 -1
- package/src/generators/application/application.js +6 -8
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/application/application.spec.ts +124 -5
- package/src/generators/application/files/app/.ruby-version +1 -0
- package/src/generators/application/files/app/Gemfile.template +6 -0
- package/src/generators/application/files/app/android/app/build.gradle.template +71 -217
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +2 -8
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +4 -2
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +3 -3
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +13 -26
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +19 -48
- package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +20 -0
- package/src/generators/application/files/app/android/build.gradle.template +13 -36
- package/src/generators/application/files/app/android/gradle.properties +4 -0
- package/src/generators/application/files/app/android/settings.gradle.template +2 -17
- package/src/generators/application/files/app/ios/Podfile.template +21 -5
- package/src/generators/application/files/app/ios/__className__/AppDelegate.h +2 -4
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +12 -109
- package/src/generators/application/files/app/ios/__className__/Info.plist.template +2 -2
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +4 -2
- package/src/generators/application/files/app/ios/__className__.xcworkspace/{contents.xcworkspacedata → xcshareddata/contents.xcworkspacedata} +1 -1
- package/src/generators/application/files/app/src/app/App.tsx.template +224 -38
- package/src/generators/application/files/app/tsconfig.app.json.template +2 -2
- package/src/generators/application/files/app/tsconfig.json.template +3 -2
- package/src/generators/application/lib/add-detox.js +1 -1
- package/src/generators/application/lib/add-detox.js.map +1 -1
- package/src/generators/application/lib/add-project.js +2 -8
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/application/lib/create-application-files.js +2 -2
- package/src/generators/application/lib/create-application-files.js.map +1 -1
- package/src/generators/application/lib/nomalize-options.spec.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +1 -1
- package/src/generators/application/lib/normalize-options.js.map +1 -1
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +14 -7
- package/src/generators/component/component.js +6 -2
- package/src/generators/component/component.js.map +1 -1
- package/src/generators/component/component.spec.ts +1 -1
- package/src/generators/component/lib/add-import.d.ts +1 -1
- package/src/generators/component/lib/add-import.js +7 -3
- package/src/generators/component/lib/add-import.js.map +1 -1
- package/src/generators/component/schema.json +3 -3
- package/src/generators/component-story/component-story.spec.ts +9 -14
- package/src/generators/init/init.d.ts +3 -3
- package/src/generators/init/init.js +16 -9
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/init/init.spec.ts +1 -1
- package/src/generators/init/lib/gitignore-entries.d.ts +1 -1
- package/src/generators/init/lib/gitignore-entries.js +17 -9
- package/src/generators/init/lib/gitignore-entries.js.map +1 -1
- package/src/generators/init/schema.d.ts +1 -0
- package/src/generators/init/schema.json +8 -1
- package/src/generators/library/files/lib/tsconfig.json__tmpl__ +1 -1
- package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +3 -4
- package/src/generators/library/library.js +8 -24
- package/src/generators/library/library.js.map +1 -1
- package/src/generators/library/library.spec.ts +14 -1
- package/src/generators/library/schema.d.ts +1 -1
- package/src/generators/library/schema.json +14 -10
- package/src/generators/stories/stories-app.spec.ts +1 -1
- package/src/generators/stories/stories-lib.spec.ts +1 -1
- package/src/generators/stories/stories.js +6 -4
- package/src/generators/stories/stories.js.map +1 -1
- package/src/generators/storybook-configuration/configuration.js +3 -2
- package/src/generators/storybook-configuration/configuration.js.map +1 -1
- package/src/generators/storybook-configuration/configuration.spec.ts +10 -6
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +4 -4
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +1 -1
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +5 -6
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +1 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +1 -1
- package/src/generators/storybook-configuration/schema.json +6 -3
- package/src/generators/upgrade-native/schema.json +2 -1
- package/src/generators/upgrade-native/upgrade-native.d.ts +5 -1
- package/src/generators/upgrade-native/upgrade-native.js +10 -13
- package/src/generators/upgrade-native/upgrade-native.js.map +1 -1
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +1 -1
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js +1 -1
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js.map +1 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +2 -2
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +1 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +1 -1
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +1 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +1 -1
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +1 -1
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +1 -1
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +1 -1
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +1 -1
- package/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +1 -1
- package/src/migrations/update-14-6-0/remove-jest-transform.js +1 -1
- package/src/migrations/update-14-6-0/remove-jest-transform.js.map +1 -1
- package/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +1 -1
- package/src/migrations/update-15-0-0/add-babel-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js +11 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +1 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +73 -0
- package/src/utils/add-jest.d.ts +1 -1
- package/src/utils/add-jest.js +3 -2
- package/src/utils/add-jest.js.map +1 -1
- package/src/utils/add-linting.d.ts +3 -2
- package/src/utils/add-linting.js +16 -17
- package/src/utils/add-linting.js.map +1 -1
- package/src/utils/add-linting.spec.ts +2 -17
- package/src/utils/chmod-android-gradle-files.d.ts +3 -0
- package/src/utils/chmod-android-gradle-files.js +24 -0
- package/src/utils/chmod-android-gradle-files.js.map +1 -0
- package/src/utils/find-all-npm-dependencies.spec.ts +1 -1
- package/src/utils/pod-install-task.js +1 -1
- package/src/utils/pod-install-task.js.map +1 -1
- package/src/utils/versions.d.ts +17 -13
- package/src/utils/versions.js +18 -14
- package/src/utils/versions.js.map +1 -1
- package/src/generators/application/files/app/android/app/_BUCK.template +0 -55
- package/src/generators/application/files/app/android/app/build_defs.bzl +0 -19
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/MainApplicationReactNativeHost.java.template +0 -116
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/components/MainComponentsRegistry.java.template +0 -36
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java.template +0 -48
- package/src/generators/application/files/app/android/app/src/main/jni/CMakeLists.txt.template +0 -6
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationModuleProvider.cpp +0 -32
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationModuleProvider.h +0 -16
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +0 -45
- package/src/generators/application/files/app/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h.template +0 -38
- package/src/generators/application/files/app/android/app/src/main/jni/MainComponentsRegistry.cpp +0 -65
- package/src/generators/application/files/app/android/app/src/main/jni/MainComponentsRegistry.h.template +0 -32
- package/src/generators/application/files/app/android/app/src/main/jni/OnLoad.cpp +0 -11
- package/src/generators/application/files/app/ios/__className__.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/src/generators/application/files/app/src/app/icons/blog.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/book.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/checkmark.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/chevron-right.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/courses.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/github.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/heart.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/logo.png +0 -0
- package/src/generators/application/files/app/src/app/icons/nx-cloud.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/pointer.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/terminal.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/vscode.svg +0 -1
- package/src/generators/application/files/app/src/app/icons/youtube.svg +0 -1
- package/src/generators/init/lib/init-root-babel-config.d.ts +0 -2
- package/src/generators/init/lib/init-root-babel-config.js +0 -20
- package/src/generators/init/lib/init-root-babel-config.js.map +0 -1
- package/src/utils/chmod-task.d.ts +0 -2
- package/src/utils/chmod-task.js +0 -18
- package/src/utils/chmod-task.js.map +0 -1
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
package com.<%= lowerCaseName %>;
|
|
2
2
|
|
|
3
3
|
import android.app.Application;
|
|
4
|
-
import android.content.Context;
|
|
5
4
|
import com.facebook.react.PackageList;
|
|
6
5
|
import com.facebook.react.ReactApplication;
|
|
7
|
-
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
|
|
8
|
-
import com.facebook.react.ReactInstanceManager;
|
|
9
6
|
import com.facebook.react.ReactNativeHost;
|
|
10
7
|
import com.facebook.react.ReactPackage;
|
|
11
|
-
import com.facebook.react.
|
|
8
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
9
|
+
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
12
10
|
import com.facebook.soloader.SoLoader;
|
|
13
|
-
import com.<%= lowerCaseName %>.newarchitecture.MainApplicationReactNativeHost;
|
|
14
|
-
import java.lang.reflect.InvocationTargetException;
|
|
15
11
|
import java.util.List;
|
|
12
|
+
import com.lugg.RNCConfig.RNCConfigPackage;
|
|
16
13
|
|
|
17
14
|
public class MainApplication extends Application implements ReactApplication {
|
|
18
15
|
|
|
19
16
|
private final ReactNativeHost mReactNativeHost =
|
|
20
|
-
new
|
|
17
|
+
new DefaultReactNativeHost(this) {
|
|
21
18
|
@Override
|
|
22
19
|
public boolean getUseDeveloperSupport() {
|
|
23
20
|
return BuildConfig.DEBUG;
|
|
@@ -36,57 +33,31 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
36
33
|
protected String getJSMainModuleName() {
|
|
37
34
|
return "<%= entryFile %>";
|
|
38
35
|
}
|
|
39
|
-
};
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
@Override
|
|
38
|
+
protected boolean isNewArchEnabled() {
|
|
39
|
+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Override
|
|
43
|
+
protected Boolean isHermesEnabled() {
|
|
44
|
+
return BuildConfig.IS_HERMES_ENABLED;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
43
47
|
|
|
44
48
|
@Override
|
|
45
49
|
public ReactNativeHost getReactNativeHost() {
|
|
46
|
-
|
|
47
|
-
return mNewArchitectureNativeHost;
|
|
48
|
-
} else {
|
|
49
|
-
return mReactNativeHost;
|
|
50
|
-
}
|
|
50
|
+
return mReactNativeHost;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@Override
|
|
54
54
|
public void onCreate() {
|
|
55
55
|
super.onCreate();
|
|
56
|
-
// If you opted-in for the New Architecture, we enable the TurboModule system
|
|
57
|
-
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
58
56
|
SoLoader.init(this, /* native exopackage */ false);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
64
|
-
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
65
|
-
*
|
|
66
|
-
* @param context
|
|
67
|
-
* @param reactInstanceManager
|
|
68
|
-
*/
|
|
69
|
-
private static void initializeFlipper(
|
|
70
|
-
Context context, ReactInstanceManager reactInstanceManager) {
|
|
71
|
-
if (BuildConfig.DEBUG) {
|
|
72
|
-
try {
|
|
73
|
-
/*
|
|
74
|
-
We use reflection here to pick up the class that initializes Flipper,
|
|
75
|
-
since Flipper library is not available in release mode
|
|
76
|
-
*/
|
|
77
|
-
Class<?> aClass = Class.forName("com.<%= lowerCaseName %>.ReactNativeFlipper");
|
|
78
|
-
aClass
|
|
79
|
-
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
80
|
-
.invoke(null, context, reactInstanceManager);
|
|
81
|
-
} catch (ClassNotFoundException e) {
|
|
82
|
-
e.printStackTrace();
|
|
83
|
-
} catch (NoSuchMethodException e) {
|
|
84
|
-
e.printStackTrace();
|
|
85
|
-
} catch (IllegalAccessException e) {
|
|
86
|
-
e.printStackTrace();
|
|
87
|
-
} catch (InvocationTargetException e) {
|
|
88
|
-
e.printStackTrace();
|
|
89
|
-
}
|
|
57
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
58
|
+
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
59
|
+
DefaultNewArchitectureEntryPoint.load();
|
|
90
60
|
}
|
|
61
|
+
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
91
62
|
}
|
|
92
63
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
+
* directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
package com.<%= lowerCaseName %>;
|
|
8
|
+
|
|
9
|
+
import android.content.Context;
|
|
10
|
+
import com.facebook.react.ReactInstanceManager;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Class responsible of loading Flipper inside your React Native application. This is the release
|
|
14
|
+
* flavor of it so it's empty as we don't want to load Flipper.
|
|
15
|
+
*/
|
|
16
|
+
public class ReactNativeFlipper {
|
|
17
|
+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
18
|
+
// Do nothing as we don't want to initialize Flipper on Release.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -2,56 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
buildscript {
|
|
4
4
|
ext {
|
|
5
|
-
buildToolsVersion = "
|
|
5
|
+
buildToolsVersion = "33.0.0"
|
|
6
6
|
minSdkVersion = 21
|
|
7
|
-
compileSdkVersion =
|
|
8
|
-
targetSdkVersion =
|
|
9
|
-
|
|
10
|
-
kotlinVersion = '1.7.10'
|
|
11
|
-
<% } %>
|
|
7
|
+
compileSdkVersion = 33
|
|
8
|
+
targetSdkVersion = 33
|
|
9
|
+
kotlinVersion = "1.7.21"
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ndkVersion = "24.0.8215888"
|
|
16
|
-
} else {
|
|
17
|
-
// Otherwise we default to the side-by-side NDK version from AGP.
|
|
18
|
-
ndkVersion = "21.4.7075529"
|
|
19
|
-
}
|
|
11
|
+
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
|
|
12
|
+
ndkVersion = "23.1.7779620"
|
|
20
13
|
}
|
|
21
14
|
repositories {
|
|
22
15
|
google()
|
|
23
16
|
mavenCentral()
|
|
24
17
|
}
|
|
25
18
|
dependencies {
|
|
26
|
-
classpath("com.android.tools.build:gradle:7.
|
|
19
|
+
classpath("com.android.tools.build:gradle:7.3.1")
|
|
27
20
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
28
|
-
classpath("
|
|
29
|
-
<% if (e2eTestRunner === 'detox') { %>
|
|
30
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
31
|
-
<% } %>
|
|
32
|
-
// NOTE: Do not place your application dependencies here; they belong
|
|
33
|
-
// in the individual module build.gradle files
|
|
21
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
24
|
|
|
37
25
|
allprojects {
|
|
38
26
|
repositories {
|
|
27
|
+
<% if (e2eTestRunner === 'detox') { %>
|
|
39
28
|
maven {
|
|
40
|
-
//
|
|
41
|
-
url("$rootDir/../node_modules/
|
|
42
|
-
}
|
|
43
|
-
maven {
|
|
44
|
-
// Android JSC is installed from npm
|
|
45
|
-
url("$rootDir/../node_modules/jsc-android/dist")
|
|
46
|
-
}
|
|
47
|
-
mavenCentral {
|
|
48
|
-
// We don't want to fetch react-native from Maven Central as there are
|
|
49
|
-
// older versions over there.
|
|
50
|
-
content {
|
|
51
|
-
excludeGroup "com.facebook.react"
|
|
52
|
-
}
|
|
29
|
+
// https://wix.github.io/Detox/docs/introduction/project-setup
|
|
30
|
+
url("$rootDir/../node_modules/detox/Detox-android")
|
|
53
31
|
}
|
|
54
|
-
|
|
55
|
-
maven { url 'https://www.jitpack.io' }
|
|
32
|
+
<% } %>
|
|
56
33
|
}
|
|
57
|
-
}
|
|
34
|
+
}
|
|
@@ -38,3 +38,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
|
38
38
|
# to write custom TurboModules/Fabric components OR use libraries that
|
|
39
39
|
# are providing them.
|
|
40
40
|
newArchEnabled=false
|
|
41
|
+
|
|
42
|
+
# Use this property to enable or disable the Hermes JS engine.
|
|
43
|
+
# If set to false, you will be using JSC instead.
|
|
44
|
+
hermesEnabled=true
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
rootProject.name = '<%= className %>'
|
|
2
2
|
|
|
3
3
|
include ':react-native-config'
|
|
4
|
-
project(':react-native-config').projectDir = new File(rootProject.projectDir, '
|
|
5
|
-
|
|
6
|
-
<% if (e2eTestRunner === 'detox') { %>
|
|
7
|
-
include ':detox'
|
|
8
|
-
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
|
|
9
|
-
<% } %>
|
|
10
|
-
|
|
11
|
-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
|
|
12
|
-
applyNativeModulesSettingsGradle(settings)
|
|
13
|
-
|
|
4
|
+
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
|
|
5
|
+
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
|
14
6
|
include ':app'
|
|
15
7
|
includeBuild('../node_modules/react-native-gradle-plugin')
|
|
16
|
-
|
|
17
|
-
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
|
|
18
|
-
include(":ReactAndroid")
|
|
19
|
-
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
|
|
20
|
-
include(":ReactAndroid:hermes-engine")
|
|
21
|
-
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
|
|
22
|
-
}
|
|
@@ -2,8 +2,25 @@ require_relative '<%= offsetFromRoot %>../node_modules/react-native/scripts/reac
|
|
|
2
2
|
require_relative '<%= offsetFromRoot %>../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
3
3
|
require_relative '<%= offsetFromRoot %>../node_modules/@nrwl/react-native/nx_post_install'
|
|
4
4
|
|
|
5
|
-
platform :ios,
|
|
6
|
-
|
|
5
|
+
platform :ios, min_ios_version_supported
|
|
6
|
+
prepare_react_native_project!
|
|
7
|
+
|
|
8
|
+
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
|
|
9
|
+
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
|
|
10
|
+
#
|
|
11
|
+
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
|
|
12
|
+
# ```js
|
|
13
|
+
# module.exports = {
|
|
14
|
+
# dependencies: {
|
|
15
|
+
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
|
|
16
|
+
# ```
|
|
17
|
+
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
|
|
18
|
+
|
|
19
|
+
linkage = ENV['USE_FRAMEWORKS']
|
|
20
|
+
if linkage != nil
|
|
21
|
+
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
|
|
22
|
+
use_frameworks! :linkage => linkage.to_sym
|
|
23
|
+
end
|
|
7
24
|
|
|
8
25
|
target '<%= className %>' do
|
|
9
26
|
config = use_native_modules!
|
|
@@ -16,14 +33,13 @@ target '<%= className %>' do
|
|
|
16
33
|
# Hermes is now enabled by default. Disable by setting this flag to false.
|
|
17
34
|
# Upcoming versions of React Native may rely on get_default_flags(), but
|
|
18
35
|
# we make it explicit here to aid in the React Native upgrade process.
|
|
19
|
-
|
|
20
|
-
:hermes_enabled => false,
|
|
36
|
+
:hermes_enabled => flags[:hermes_enabled],
|
|
21
37
|
:fabric_enabled => flags[:fabric_enabled],
|
|
22
38
|
# Enables Flipper.
|
|
23
39
|
#
|
|
24
40
|
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
25
41
|
# you should disable the next line.
|
|
26
|
-
:flipper_configuration =>
|
|
42
|
+
:flipper_configuration => flipper_config,
|
|
27
43
|
# An absolute path to your application root.
|
|
28
44
|
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
29
45
|
)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
#import <
|
|
1
|
+
#import <RCTAppDelegate.h>
|
|
2
2
|
#import <UIKit/UIKit.h>
|
|
3
3
|
|
|
4
|
-
@interface AppDelegate :
|
|
5
|
-
|
|
6
|
-
@property (nonatomic, strong) UIWindow *window;
|
|
4
|
+
@interface AppDelegate : RCTAppDelegate
|
|
7
5
|
|
|
8
6
|
@end
|
|
@@ -1,85 +1,17 @@
|
|
|
1
1
|
#import "AppDelegate.h"
|
|
2
2
|
|
|
3
|
-
#import <React/RCTBridge.h>
|
|
4
3
|
#import <React/RCTBundleURLProvider.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
|
|
7
|
-
#import <React/RCTAppSetupUtils.h>
|
|
8
|
-
|
|
9
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
10
|
-
#import <React/CoreModulesPlugins.h>
|
|
11
|
-
#import <React/RCTCxxBridgeDelegate.h>
|
|
12
|
-
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
13
|
-
#import <React/RCTSurfacePresenter.h>
|
|
14
|
-
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
|
15
|
-
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
16
|
-
|
|
17
|
-
#import <react/config/ReactNativeConfig.h>
|
|
18
|
-
|
|
19
|
-
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
20
|
-
|
|
21
|
-
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
|
22
|
-
RCTTurboModuleManager *_turboModuleManager;
|
|
23
|
-
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
|
24
|
-
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
|
25
|
-
facebook::react::ContextContainer::Shared _contextContainer;
|
|
26
|
-
}
|
|
27
|
-
@end
|
|
28
|
-
#endif
|
|
29
4
|
|
|
30
5
|
@implementation AppDelegate
|
|
31
6
|
|
|
32
7
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
33
8
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
39
|
-
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
|
|
40
|
-
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
|
|
41
|
-
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
|
42
|
-
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
|
|
43
|
-
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
|
44
|
-
#endif
|
|
45
|
-
|
|
46
|
-
NSDictionary *initProps = [self prepareInitialProps];
|
|
47
|
-
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"<%= className %>", initProps);
|
|
48
|
-
|
|
49
|
-
if (@available(iOS 13.0, *)) {
|
|
50
|
-
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
51
|
-
} else {
|
|
52
|
-
rootView.backgroundColor = [UIColor whiteColor];
|
|
53
|
-
}
|
|
9
|
+
self.moduleName = @"<%= className %>";
|
|
10
|
+
// You can add your custom initial props in the dictionary below.
|
|
11
|
+
// They will be passed down to the ViewController used by React Native.
|
|
12
|
+
self.initialProps = @{};
|
|
54
13
|
|
|
55
|
-
|
|
56
|
-
UIViewController *rootViewController = [UIViewController new];
|
|
57
|
-
rootViewController.view = rootView;
|
|
58
|
-
self.window.rootViewController = rootViewController;
|
|
59
|
-
[self.window makeKeyAndVisible];
|
|
60
|
-
return YES;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
64
|
-
///
|
|
65
|
-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
66
|
-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
67
|
-
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
|
|
68
|
-
- (BOOL)concurrentRootEnabled
|
|
69
|
-
{
|
|
70
|
-
// Switch this bool to turn on and off the concurrent root
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
- (NSDictionary *)prepareInitialProps
|
|
75
|
-
{
|
|
76
|
-
NSMutableDictionary *initProps = [NSMutableDictionary new];
|
|
77
|
-
|
|
78
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
79
|
-
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
return initProps;
|
|
14
|
+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
83
15
|
}
|
|
84
16
|
|
|
85
17
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
@@ -91,43 +23,14 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
|
91
23
|
#endif
|
|
92
24
|
}
|
|
93
25
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
|
101
|
-
delegate:self
|
|
102
|
-
jsInvoker:bridge.jsCallInvoker];
|
|
103
|
-
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
#pragma mark RCTTurboModuleManagerDelegate
|
|
107
|
-
|
|
108
|
-
- (Class)getModuleClassFromName:(const char *)name
|
|
109
|
-
{
|
|
110
|
-
return RCTCoreModulesClassProvider(name);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
114
|
-
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
|
115
|
-
{
|
|
116
|
-
return nullptr;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
120
|
-
initParams:
|
|
121
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
122
|
-
{
|
|
123
|
-
return nullptr;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
|
26
|
+
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
27
|
+
///
|
|
28
|
+
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
29
|
+
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
30
|
+
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
|
|
31
|
+
- (BOOL)concurrentRootEnabled
|
|
127
32
|
{
|
|
128
|
-
return
|
|
33
|
+
return true;
|
|
129
34
|
}
|
|
130
35
|
|
|
131
|
-
#endif
|
|
132
|
-
|
|
133
36
|
@end
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
<key>CFBundlePackageType</key>
|
|
18
18
|
<string>APPL</string>
|
|
19
19
|
<key>CFBundleShortVersionString</key>
|
|
20
|
-
<string
|
|
20
|
+
<string>$(MARKETING_VERSION)</string>
|
|
21
21
|
<key>CFBundleSignature</key>
|
|
22
22
|
<string>????</string>
|
|
23
23
|
<key>CFBundleVersion</key>
|
|
24
|
-
<string
|
|
24
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
25
25
|
<key>LSRequiresIPhoneOS</key>
|
|
26
26
|
<true/>
|
|
27
27
|
<key>NSAppTransportSecurity</key>
|
package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template
CHANGED
|
@@ -492,6 +492,7 @@
|
|
|
492
492
|
"$(inherited)",
|
|
493
493
|
"@executable_path/Frameworks",
|
|
494
494
|
);
|
|
495
|
+
MARKETING_VERSION = 1.0;
|
|
495
496
|
OTHER_LDFLAGS = (
|
|
496
497
|
"$(inherited)",
|
|
497
498
|
"-ObjC",
|
|
@@ -517,6 +518,7 @@
|
|
|
517
518
|
"$(inherited)",
|
|
518
519
|
"@executable_path/Frameworks",
|
|
519
520
|
);
|
|
521
|
+
MARKETING_VERSION = 1.0;
|
|
520
522
|
OTHER_LDFLAGS = (
|
|
521
523
|
"$(inherited)",
|
|
522
524
|
"-ObjC",
|
|
@@ -562,7 +564,7 @@
|
|
|
562
564
|
COPY_PHASE_STRIP = NO;
|
|
563
565
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
564
566
|
ENABLE_TESTABILITY = YES;
|
|
565
|
-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" =
|
|
567
|
+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
|
|
566
568
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
567
569
|
GCC_DYNAMIC_NO_PIC = NO;
|
|
568
570
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
@@ -633,7 +635,7 @@
|
|
|
633
635
|
COPY_PHASE_STRIP = YES;
|
|
634
636
|
ENABLE_NS_ASSERTIONS = NO;
|
|
635
637
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
636
|
-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" =
|
|
638
|
+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
|
|
637
639
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
638
640
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
639
641
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|