expo-template-bare-minimum 46.0.31 → 47.0.0

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.
@@ -1,7 +1,6 @@
1
1
  apply plugin: "com.android.application"
2
2
 
3
3
  import com.android.build.OutputFile
4
- import org.apache.tools.ant.taskdefs.condition.Os
5
4
 
6
5
  /**
7
6
  * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -151,27 +150,14 @@ android {
151
150
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
152
151
 
153
152
  if (isNewArchitectureEnabled()) {
154
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
153
+ // We configure the CMake build only if you decide to opt-in for the New Architecture.
155
154
  externalNativeBuild {
156
- ndkBuild {
157
- arguments "APP_PLATFORM=android-21",
158
- "APP_STL=c++_shared",
159
- "NDK_TOOLCHAIN_VERSION=clang",
160
- "GENERATED_SRC_DIR=$buildDir/generated/source",
161
- "PROJECT_BUILD_DIR=$buildDir",
162
- "REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid",
163
- "REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build",
164
- "NODE_MODULES_DIR=$rootDir/../node_modules"
165
- cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
166
- cppFlags "-std=c++17"
167
- // Make sure this target name is the same you specify inside the
168
- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
169
- targets "helloworld_appmodules"
170
-
171
- // Fix for windows limit on number of character in file paths and in command lines
172
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
173
- arguments "NDK_APP_SHORT_COMMANDS=true"
174
- }
155
+ cmake {
156
+ arguments "-DPROJECT_BUILD_DIR=$buildDir",
157
+ "-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid",
158
+ "-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build",
159
+ "-DNODE_MODULES_DIR=$rootDir/../node_modules",
160
+ "-DANDROID_STL=c++_shared"
175
161
  }
176
162
  }
177
163
  if (!enableSeparateBuildPerCPUArchitecture) {
@@ -183,10 +169,10 @@ android {
183
169
  }
184
170
 
185
171
  if (isNewArchitectureEnabled()) {
186
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
172
+ // We configure the CMake build only if you decide to opt-in for the New Architecture.
187
173
  externalNativeBuild {
188
- ndkBuild {
189
- path "$projectDir/src/main/jni/Android.mk"
174
+ cmake {
175
+ path "$projectDir/src/main/jni/CMakeLists.txt"
190
176
  }
191
177
  }
192
178
  def reactAndroidProjectDir = project(':ReactAndroid').projectDir
@@ -208,15 +194,15 @@ android {
208
194
  preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
209
195
 
210
196
  // Due to a bug inside AGP, we have to explicitly set a dependency
211
- // between configureNdkBuild* tasks and the preBuild tasks.
197
+ // between configureCMakeDebug* tasks and the preBuild tasks.
212
198
  // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
213
- configureNdkBuildRelease.dependsOn(preReleaseBuild)
214
- configureNdkBuildDebug.dependsOn(preDebugBuild)
199
+ configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
200
+ configureCMakeDebug.dependsOn(preDebugBuild)
215
201
  reactNativeArchitectures().each { architecture ->
216
- tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
202
+ tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
217
203
  dependsOn("preDebugBuild")
218
204
  }
219
- tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
205
+ tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
220
206
  dependsOn("preReleaseBuild")
221
207
  }
222
208
  }
@@ -0,0 +1,7 @@
1
+ cmake_minimum_required(VERSION 3.13)
2
+
3
+ # Define the library name here.
4
+ project(helloworld_appmodules)
5
+
6
+ # This file includes all the necessary to let you build your application with the New Architecture.
7
+ include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
@@ -1,12 +1,13 @@
1
1
  #include "MainApplicationModuleProvider.h"
2
2
 
3
+ #include <rncli.h>
3
4
  #include <rncore.h>
4
5
 
5
6
  namespace facebook {
6
7
  namespace react {
7
8
 
8
9
  std::shared_ptr<TurboModule> MainApplicationModuleProvider(
9
- const std::string moduleName,
10
+ const std::string &moduleName,
10
11
  const JavaTurboModule::InitParams &params) {
11
12
  // Here you can provide your own module provider for TurboModules coming from
12
13
  // either your application or from external libraries. The approach to follow
@@ -17,6 +18,13 @@ std::shared_ptr<TurboModule> MainApplicationModuleProvider(
17
18
  // return module;
18
19
  // }
19
20
  // return rncore_ModuleProvider(moduleName, params);
21
+
22
+ // Module providers autolinked by RN CLI
23
+ auto rncli_module = rncli_ModuleProvider(moduleName, params);
24
+ if (rncli_module != nullptr) {
25
+ return rncli_module;
26
+ }
27
+
20
28
  return rncore_ModuleProvider(moduleName, params);
21
29
  }
22
30
 
@@ -9,7 +9,7 @@ namespace facebook {
9
9
  namespace react {
10
10
 
11
11
  std::shared_ptr<TurboModule> MainApplicationModuleProvider(
12
- const std::string moduleName,
12
+ const std::string &moduleName,
13
13
  const JavaTurboModule::InitParams &params);
14
14
 
15
15
  } // namespace react
@@ -22,21 +22,21 @@ void MainApplicationTurboModuleManagerDelegate::registerNatives() {
22
22
 
23
23
  std::shared_ptr<TurboModule>
24
24
  MainApplicationTurboModuleManagerDelegate::getTurboModule(
25
- const std::string name,
26
- const std::shared_ptr<CallInvoker> jsInvoker) {
25
+ const std::string &name,
26
+ const std::shared_ptr<CallInvoker> &jsInvoker) {
27
27
  // Not implemented yet: provide pure-C++ NativeModules here.
28
28
  return nullptr;
29
29
  }
30
30
 
31
31
  std::shared_ptr<TurboModule>
32
32
  MainApplicationTurboModuleManagerDelegate::getTurboModule(
33
- const std::string name,
33
+ const std::string &name,
34
34
  const JavaTurboModule::InitParams &params) {
35
35
  return MainApplicationModuleProvider(name, params);
36
36
  }
37
37
 
38
38
  bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
39
- std::string name) {
39
+ const std::string &name) {
40
40
  return getTurboModule(name, nullptr) != nullptr ||
41
41
  getTurboModule(name, {.moduleName = name}) != nullptr;
42
42
  }
@@ -21,17 +21,17 @@ class MainApplicationTurboModuleManagerDelegate
21
21
  static void registerNatives();
22
22
 
23
23
  std::shared_ptr<TurboModule> getTurboModule(
24
- const std::string name,
25
- const std::shared_ptr<CallInvoker> jsInvoker) override;
24
+ const std::string &name,
25
+ const std::shared_ptr<CallInvoker> &jsInvoker) override;
26
26
  std::shared_ptr<TurboModule> getTurboModule(
27
- const std::string name,
27
+ const std::string &name,
28
28
  const JavaTurboModule::InitParams &params) override;
29
29
 
30
30
  /**
31
31
  * Test-only method. Allows user to verify whether a TurboModule can be
32
32
  * created by instances of this class.
33
33
  */
34
- bool canCreateTurboModule(std::string name);
34
+ bool canCreateTurboModule(const std::string &name);
35
35
  };
36
36
 
37
37
  } // namespace react
@@ -4,6 +4,7 @@
4
4
  #include <fbjni/fbjni.h>
5
5
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
6
6
  #include <react/renderer/components/rncore/ComponentDescriptors.h>
7
+ #include <rncli.h>
7
8
 
8
9
  namespace facebook {
9
10
  namespace react {
@@ -14,6 +15,9 @@ std::shared_ptr<ComponentDescriptorProviderRegistry const>
14
15
  MainComponentsRegistry::sharedProviderRegistry() {
15
16
  auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
16
17
 
18
+ // Autolinked providers registered by RN CLI
19
+ rncli_registerProviders(providerRegistry);
20
+
17
21
  // Custom Fabric Components go here. You can register custom
18
22
  // components coming from your App or from 3rd party libraries here.
19
23
  //
@@ -1,5 +1,3 @@
1
- import org.apache.tools.ant.taskdefs.condition.Os
2
-
3
1
  // Top-level build file where you can add configuration options common to all sub-projects/modules.
4
2
 
5
3
  buildscript {
@@ -26,7 +24,7 @@ buildscript {
26
24
  mavenCentral()
27
25
  }
28
26
  dependencies {
29
- classpath('com.android.tools.build:gradle:7.1.1')
27
+ classpath('com.android.tools.build:gradle:7.2.1')
30
28
  classpath('com.facebook.react:react-native-gradle-plugin')
31
29
  classpath('de.undercouch:gradle-download-task:5.0.1')
32
30
  // NOTE: Do not place your application dependencies here; they belong
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
package/android/gradlew CHANGED
@@ -205,6 +205,12 @@ set -- \
205
205
  org.gradle.wrapper.GradleWrapperMain \
206
206
  "$@"
207
207
 
208
+ # Stop when "xargs" is not available.
209
+ if ! command -v xargs >/dev/null 2>&1
210
+ then
211
+ die "xargs is not available"
212
+ fi
213
+
208
214
  # Use "xargs" to parse quoted args.
209
215
  #
210
216
  # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -14,7 +14,7 @@
14
14
  @rem limitations under the License.
15
15
  @rem
16
16
 
17
- @if "%DEBUG%" == "" @echo off
17
+ @if "%DEBUG%"=="" @echo off
18
18
  @rem ##########################################################################
19
19
  @rem
20
20
  @rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
25
25
  if "%OS%"=="Windows_NT" setlocal
26
26
 
27
27
  set DIRNAME=%~dp0
28
- if "%DIRNAME%" == "" set DIRNAME=.
28
+ if "%DIRNAME%"=="" set DIRNAME=.
29
29
  set APP_BASE_NAME=%~n0
30
30
  set APP_HOME=%DIRNAME%
31
31
 
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
40
40
 
41
41
  set JAVA_EXE=java.exe
42
42
  %JAVA_EXE% -version >NUL 2>&1
43
- if "%ERRORLEVEL%" == "0" goto execute
43
+ if %ERRORLEVEL% equ 0 goto execute
44
44
 
45
45
  echo.
46
46
  echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
75
75
 
76
76
  :end
77
77
  @rem End local scope for the variables with windows NT shell
78
- if "%ERRORLEVEL%"=="0" goto mainEnd
78
+ if %ERRORLEVEL% equ 0 goto mainEnd
79
79
 
80
80
  :fail
81
81
  rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82
82
  rem the _cmd.exe /c_ return code!
83
- if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84
- exit /b 1
83
+ set EXIT_CODE=%ERRORLEVEL%
84
+ if %EXIT_CODE% equ 0 set EXIT_CODE=1
85
+ if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86
+ exit /b %EXIT_CODE%
85
87
 
86
88
  :mainEnd
87
89
  if "%OS%"=="Windows_NT" endlocal
package/gitignore CHANGED
@@ -30,6 +30,7 @@ build/
30
30
  local.properties
31
31
  *.iml
32
32
  *.hprof
33
+ .cxx/
33
34
 
34
35
  # node.js
35
36
  #
@@ -214,7 +214,7 @@
214
214
  );
215
215
  runOnlyForDeploymentPostprocessing = 0;
216
216
  shellPath = /bin/sh;
217
- shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n";
217
+ shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" $PROJECT_ROOT ios relative | tail -n 1)\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n";
218
218
  };
219
219
  08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {
220
220
  isa = PBXShellScriptBuildPhase;
@@ -308,7 +308,7 @@
308
308
  "FB_SONARKIT_ENABLED=1",
309
309
  );
310
310
  INFOPLIST_FILE = HelloWorld/Info.plist;
311
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
311
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
312
312
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
313
313
  OTHER_LDFLAGS = (
314
314
  "$(inherited)",
@@ -331,7 +331,7 @@
331
331
  CLANG_ENABLE_MODULES = YES;
332
332
  CURRENT_PROJECT_VERSION = 1;
333
333
  INFOPLIST_FILE = HelloWorld/Info.plist;
334
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
334
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
335
335
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
336
336
  OTHER_LDFLAGS = (
337
337
  "$(inherited)",
@@ -392,7 +392,7 @@
392
392
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
393
393
  GCC_WARN_UNUSED_FUNCTION = YES;
394
394
  GCC_WARN_UNUSED_VARIABLE = YES;
395
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
395
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
396
396
  LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
397
397
  LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
398
398
  MTL_ENABLE_DEBUG_INFO = YES;
@@ -441,7 +441,7 @@
441
441
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
442
442
  GCC_WARN_UNUSED_FUNCTION = YES;
443
443
  GCC_WARN_UNUSED_VARIABLE = YES;
444
- IPHONEOS_DEPLOYMENT_TARGET = 12.4;
444
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
445
445
  LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
446
446
  LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
447
447
  MTL_ENABLE_DEBUG_INFO = NO;
package/ios/Podfile CHANGED
@@ -5,7 +5,7 @@ require File.join(File.dirname(`node --print "require.resolve('@react-native-com
5
5
  require 'json'
6
6
  podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
7
7
 
8
- platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'
8
+ platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
9
9
  install! 'cocoapods',
10
10
  :deterministic_uuids => false
11
11
 
@@ -20,21 +20,23 @@ target 'HelloWorld' do
20
20
 
21
21
  use_react_native!(
22
22
  :path => config[:reactNativePath],
23
- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',
23
+ :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',
24
24
  :fabric_enabled => flags[:fabric_enabled],
25
25
  # An absolute path to your application root.
26
- :app_path => "#{Dir.pwd}/.."
26
+ :app_path => "#{Pod::Config.instance.installation_root}/..",
27
+ #
28
+ # Uncomment to opt-in to using Flipper
29
+ # Note that if you have use_frameworks! enabled, Flipper will not work
30
+ # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,
27
31
  )
28
32
 
29
- # Uncomment to opt-in to using Flipper
30
- # Note that if you have use_frameworks! enabled, Flipper will not work
31
- #
32
- # if !ENV['CI']
33
- # use_flipper!()
34
- # end
35
-
36
33
  post_install do |installer|
37
- react_native_post_install(installer)
34
+ react_native_post_install(
35
+ installer,
36
+ # Set `mac_catalyst_enabled` to `true` in order to apply patches
37
+ # necessary for Mac Catalyst builds
38
+ :mac_catalyst_enabled => false
39
+ )
38
40
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
39
41
 
40
42
  # This is necessary for Xcode 14, because it signs resource bundles by default
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "expo-template-bare-minimum",
3
3
  "description": "This bare project template includes a minimal setup for using unimodules with React Native.",
4
- "version": "46.0.31",
5
- "main": "index.js",
4
+ "version": "47.0.0",
6
5
  "scripts": {
7
6
  "start": "expo start --dev-client",
8
7
  "android": "expo run:android",
@@ -10,13 +9,11 @@
10
9
  "web": "expo start --web"
11
10
  },
12
11
  "dependencies": {
13
- "expo": "~46.0.16",
14
- "expo-splash-screen": "~0.16.2",
15
- "expo-status-bar": "~1.4.0",
16
- "react": "18.0.0",
17
- "react-dom": "18.0.0",
18
- "react-native": "0.69.6",
19
- "react-native-web": "~0.18.7"
12
+ "expo": "~47.0.0-beta.1",
13
+ "expo-splash-screen": "~0.17.0",
14
+ "expo-status-bar": "~1.4.1",
15
+ "react": "18.1.0",
16
+ "react-native": "0.70.3"
20
17
  },
21
18
  "devDependencies": {
22
19
  "@babel/core": "^7.12.9"
@@ -1,48 +0,0 @@
1
- THIS_DIR := $(call my-dir)
2
-
3
- include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
4
-
5
- # If you wish to add a custom TurboModule or Fabric component in your app you
6
- # will have to include the following autogenerated makefile.
7
- # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
8
- include $(CLEAR_VARS)
9
-
10
- LOCAL_PATH := $(THIS_DIR)
11
-
12
- # You can customize the name of your application .so file here.
13
- LOCAL_MODULE := helloworld_appmodules
14
-
15
- LOCAL_C_INCLUDES := $(LOCAL_PATH)
16
- LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
17
- LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
18
-
19
- # If you wish to add a custom TurboModule or Fabric component in your app you
20
- # will have to uncomment those lines to include the generated source
21
- # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
22
- #
23
- # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
24
- # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
25
- # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
26
-
27
- # Here you should add any native library you wish to depend on.
28
- LOCAL_SHARED_LIBRARIES := \
29
- libfabricjni \
30
- libfbjni \
31
- libfolly_runtime \
32
- libglog \
33
- libjsi \
34
- libreact_codegen_rncore \
35
- libreact_debug \
36
- libreact_nativemodule_core \
37
- libreact_render_componentregistry \
38
- libreact_render_core \
39
- libreact_render_debug \
40
- libreact_render_graphics \
41
- librrc_view \
42
- libruntimeexecutor \
43
- libturbomodulejsijni \
44
- libyoga
45
-
46
- LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall
47
-
48
- include $(BUILD_SHARED_LIBRARY)
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- import { registerRootComponent } from 'expo';
2
-
3
- import App from './App';
4
-
5
- // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6
- // It also ensures that whether you load the app in Expo Go or in a native build,
7
- // the environment is set up appropriately
8
- registerRootComponent(App);