expo-template-bare-minimum 47.0.21 → 48.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.
Files changed (32) hide show
  1. package/android/app/build.gradle +91 -217
  2. package/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +11 -5
  3. package/android/app/src/main/AndroidManifest.xml +1 -1
  4. package/android/app/src/main/java/com/helloworld/MainActivity.java +13 -28
  5. package/android/app/src/main/java/com/helloworld/MainApplication.java +37 -67
  6. package/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java +20 -0
  7. package/android/build.gradle +7 -30
  8. package/android/gitignore +0 -6
  9. package/android/gradle.properties +1 -1
  10. package/android/settings.gradle +0 -7
  11. package/gitignore +5 -6
  12. package/ios/HelloWorld/AppDelegate.h +2 -4
  13. package/ios/HelloWorld/AppDelegate.mm +12 -111
  14. package/ios/HelloWorld.xcodeproj/project.pbxproj +2 -0
  15. package/ios/HelloWorld.xcodeproj/project.xcworkspace/xcuserdata/brentvatne.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  16. package/ios/Podfile +19 -2
  17. package/ios/Podfile.properties.json +1 -1
  18. package/package.json +7 -7
  19. package/.buckconfig +0 -6
  20. package/android/app/BUCK +0 -55
  21. package/android/app/build_defs.bzl +0 -19
  22. package/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java +0 -117
  23. package/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java +0 -36
  24. package/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +0 -48
  25. package/android/app/src/main/jni/CMakeLists.txt +0 -7
  26. package/android/app/src/main/jni/MainApplicationModuleProvider.cpp +0 -32
  27. package/android/app/src/main/jni/MainApplicationModuleProvider.h +0 -16
  28. package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +0 -45
  29. package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +0 -38
  30. package/android/app/src/main/jni/MainComponentsRegistry.cpp +0 -65
  31. package/android/app/src/main/jni/MainComponentsRegistry.h +0 -32
  32. package/android/app/src/main/jni/OnLoad.cpp +0 -11
@@ -1,117 +0,0 @@
1
- package com.helloworld.newarchitecture;
2
-
3
- import android.app.Application;
4
- import androidx.annotation.NonNull;
5
- import com.facebook.react.PackageList;
6
- import com.facebook.react.ReactInstanceManager;
7
- import com.facebook.react.ReactNativeHost;
8
- import com.facebook.react.ReactPackage;
9
- import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
10
- import com.facebook.react.bridge.JSIModulePackage;
11
- import com.facebook.react.bridge.JSIModuleProvider;
12
- import com.facebook.react.bridge.JSIModuleSpec;
13
- import com.facebook.react.bridge.JSIModuleType;
14
- import com.facebook.react.bridge.JavaScriptContextHolder;
15
- import com.facebook.react.bridge.ReactApplicationContext;
16
- import com.facebook.react.bridge.UIManager;
17
- import com.facebook.react.fabric.ComponentFactory;
18
- import com.facebook.react.fabric.CoreComponentsRegistry;
19
- import com.facebook.react.fabric.EmptyReactNativeConfig;
20
- import com.facebook.react.fabric.FabricJSIModuleProvider;
21
- import com.facebook.react.fabric.ReactNativeConfig;
22
- import com.facebook.react.uimanager.ViewManagerRegistry;
23
- import com.helloworld.BuildConfig;
24
- import com.helloworld.newarchitecture.components.MainComponentsRegistry;
25
- import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
26
- import java.util.ArrayList;
27
- import java.util.List;
28
-
29
- /**
30
- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
31
- * TurboModule delegates and the Fabric Renderer.
32
- *
33
- * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
34
- * `newArchEnabled` property). Is ignored otherwise.
35
- */
36
- public class MainApplicationReactNativeHost extends ReactNativeHost {
37
- public MainApplicationReactNativeHost(Application application) {
38
- super(application);
39
- }
40
-
41
- @Override
42
- public boolean getUseDeveloperSupport() {
43
- return BuildConfig.DEBUG;
44
- }
45
-
46
- @Override
47
- protected List<ReactPackage> getPackages() {
48
- List<ReactPackage> packages = new PackageList(this).getPackages();
49
- // Packages that cannot be autolinked yet can be added manually here, for example:
50
- // packages.add(new MyReactNativePackage());
51
- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
52
- // packages.add(new TurboReactPackage() { ... });
53
- // If you have custom Fabric Components, their ViewManagers should also be loaded here
54
- // inside a ReactPackage.
55
- return packages;
56
- }
57
-
58
- @Override
59
- protected String getJSMainModuleName() {
60
- return "index";
61
- }
62
-
63
- @NonNull
64
- @Override
65
- protected ReactPackageTurboModuleManagerDelegate.Builder
66
- getReactPackageTurboModuleManagerDelegateBuilder() {
67
- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
68
- // for the new architecture and to use TurboModules correctly.
69
- return new MainApplicationTurboModuleManagerDelegate.Builder();
70
- }
71
-
72
- @Override
73
- protected JSIModulePackage getJSIModulePackage() {
74
- return new JSIModulePackage() {
75
- @Override
76
- public List<JSIModuleSpec> getJSIModules(
77
- final ReactApplicationContext reactApplicationContext,
78
- final JavaScriptContextHolder jsContext) {
79
- final List<JSIModuleSpec> specs = new ArrayList<>();
80
-
81
- // Here we provide a new JSIModuleSpec that will be responsible of providing the
82
- // custom Fabric Components.
83
- specs.add(
84
- new JSIModuleSpec() {
85
- @Override
86
- public JSIModuleType getJSIModuleType() {
87
- return JSIModuleType.UIManager;
88
- }
89
-
90
- @Override
91
- public JSIModuleProvider<UIManager> getJSIModuleProvider() {
92
- final ComponentFactory componentFactory = new ComponentFactory();
93
- CoreComponentsRegistry.register(componentFactory);
94
-
95
- // Here we register a Components Registry.
96
- // The one that is generated with the template contains no components
97
- // and just provides you the one from React Native core.
98
- MainComponentsRegistry.register(componentFactory);
99
-
100
- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
101
-
102
- ViewManagerRegistry viewManagerRegistry =
103
- new ViewManagerRegistry(
104
- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
105
-
106
- return new FabricJSIModuleProvider(
107
- reactApplicationContext,
108
- componentFactory,
109
- ReactNativeConfig.DEFAULT_CONFIG,
110
- viewManagerRegistry);
111
- }
112
- });
113
- return specs;
114
- }
115
- };
116
- }
117
- }
@@ -1,36 +0,0 @@
1
- package com.helloworld.newarchitecture.components;
2
-
3
- import com.facebook.jni.HybridData;
4
- import com.facebook.proguard.annotations.DoNotStrip;
5
- import com.facebook.react.fabric.ComponentFactory;
6
- import com.facebook.soloader.SoLoader;
7
-
8
- /**
9
- * Class responsible to load the custom Fabric Components. This class has native methods and needs a
10
- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/
11
- * folder for you).
12
- *
13
- * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
14
- * `newArchEnabled` property). Is ignored otherwise.
15
- */
16
- @DoNotStrip
17
- public class MainComponentsRegistry {
18
- static {
19
- SoLoader.loadLibrary("fabricjni");
20
- }
21
-
22
- @DoNotStrip private final HybridData mHybridData;
23
-
24
- @DoNotStrip
25
- private native HybridData initHybrid(ComponentFactory componentFactory);
26
-
27
- @DoNotStrip
28
- private MainComponentsRegistry(ComponentFactory componentFactory) {
29
- mHybridData = initHybrid(componentFactory);
30
- }
31
-
32
- @DoNotStrip
33
- public static MainComponentsRegistry register(ComponentFactory componentFactory) {
34
- return new MainComponentsRegistry(componentFactory);
35
- }
36
- }
@@ -1,48 +0,0 @@
1
- package com.helloworld.newarchitecture.modules;
2
-
3
- import com.facebook.jni.HybridData;
4
- import com.facebook.react.ReactPackage;
5
- import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
6
- import com.facebook.react.bridge.ReactApplicationContext;
7
- import com.facebook.soloader.SoLoader;
8
- import java.util.List;
9
-
10
- /**
11
- * Class responsible to load the TurboModules. This class has native methods and needs a
12
- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/
13
- * folder for you).
14
- *
15
- * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
16
- * `newArchEnabled` property). Is ignored otherwise.
17
- */
18
- public class MainApplicationTurboModuleManagerDelegate
19
- extends ReactPackageTurboModuleManagerDelegate {
20
-
21
- private static volatile boolean sIsSoLibraryLoaded;
22
-
23
- protected MainApplicationTurboModuleManagerDelegate(
24
- ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
25
- super(reactApplicationContext, packages);
26
- }
27
-
28
- protected native HybridData initHybrid();
29
-
30
- native boolean canCreateTurboModule(String moduleName);
31
-
32
- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
33
- protected MainApplicationTurboModuleManagerDelegate build(
34
- ReactApplicationContext context, List<ReactPackage> packages) {
35
- return new MainApplicationTurboModuleManagerDelegate(context, packages);
36
- }
37
- }
38
-
39
- @Override
40
- protected synchronized void maybeLoadOtherSoLibraries() {
41
- if (!sIsSoLibraryLoaded) {
42
- // If you change the name of your application .so file in the Android.mk file,
43
- // make sure you update the name here as well.
44
- SoLoader.loadLibrary("helloworld_appmodules");
45
- sIsSoLibraryLoaded = true;
46
- }
47
- }
48
- }
@@ -1,7 +0,0 @@
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,32 +0,0 @@
1
- #include "MainApplicationModuleProvider.h"
2
-
3
- #include <rncli.h>
4
- #include <rncore.h>
5
-
6
- namespace facebook {
7
- namespace react {
8
-
9
- std::shared_ptr<TurboModule> MainApplicationModuleProvider(
10
- const std::string &moduleName,
11
- const JavaTurboModule::InitParams &params) {
12
- // Here you can provide your own module provider for TurboModules coming from
13
- // either your application or from external libraries. The approach to follow
14
- // is similar to the following (for a library called `samplelibrary`:
15
- //
16
- // auto module = samplelibrary_ModuleProvider(moduleName, params);
17
- // if (module != nullptr) {
18
- // return module;
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
-
28
- return rncore_ModuleProvider(moduleName, params);
29
- }
30
-
31
- } // namespace react
32
- } // namespace facebook
@@ -1,16 +0,0 @@
1
- #pragma once
2
-
3
- #include <memory>
4
- #include <string>
5
-
6
- #include <ReactCommon/JavaTurboModule.h>
7
-
8
- namespace facebook {
9
- namespace react {
10
-
11
- std::shared_ptr<TurboModule> MainApplicationModuleProvider(
12
- const std::string &moduleName,
13
- const JavaTurboModule::InitParams &params);
14
-
15
- } // namespace react
16
- } // namespace facebook
@@ -1,45 +0,0 @@
1
- #include "MainApplicationTurboModuleManagerDelegate.h"
2
- #include "MainApplicationModuleProvider.h"
3
-
4
- namespace facebook {
5
- namespace react {
6
-
7
- jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
8
- MainApplicationTurboModuleManagerDelegate::initHybrid(
9
- jni::alias_ref<jhybridobject>) {
10
- return makeCxxInstance();
11
- }
12
-
13
- void MainApplicationTurboModuleManagerDelegate::registerNatives() {
14
- registerHybrid({
15
- makeNativeMethod(
16
- "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
17
- makeNativeMethod(
18
- "canCreateTurboModule",
19
- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
20
- });
21
- }
22
-
23
- std::shared_ptr<TurboModule>
24
- MainApplicationTurboModuleManagerDelegate::getTurboModule(
25
- const std::string &name,
26
- const std::shared_ptr<CallInvoker> &jsInvoker) {
27
- // Not implemented yet: provide pure-C++ NativeModules here.
28
- return nullptr;
29
- }
30
-
31
- std::shared_ptr<TurboModule>
32
- MainApplicationTurboModuleManagerDelegate::getTurboModule(
33
- const std::string &name,
34
- const JavaTurboModule::InitParams &params) {
35
- return MainApplicationModuleProvider(name, params);
36
- }
37
-
38
- bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
39
- const std::string &name) {
40
- return getTurboModule(name, nullptr) != nullptr ||
41
- getTurboModule(name, {.moduleName = name}) != nullptr;
42
- }
43
-
44
- } // namespace react
45
- } // namespace facebook
@@ -1,38 +0,0 @@
1
- #include <memory>
2
- #include <string>
3
-
4
- #include <ReactCommon/TurboModuleManagerDelegate.h>
5
- #include <fbjni/fbjni.h>
6
-
7
- namespace facebook {
8
- namespace react {
9
-
10
- class MainApplicationTurboModuleManagerDelegate
11
- : public jni::HybridClass<
12
- MainApplicationTurboModuleManagerDelegate,
13
- TurboModuleManagerDelegate> {
14
- public:
15
- // Adapt it to the package you used for your Java class.
16
- static constexpr auto kJavaDescriptor =
17
- "Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
18
-
19
- static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
20
-
21
- static void registerNatives();
22
-
23
- std::shared_ptr<TurboModule> getTurboModule(
24
- const std::string &name,
25
- const std::shared_ptr<CallInvoker> &jsInvoker) override;
26
- std::shared_ptr<TurboModule> getTurboModule(
27
- const std::string &name,
28
- const JavaTurboModule::InitParams &params) override;
29
-
30
- /**
31
- * Test-only method. Allows user to verify whether a TurboModule can be
32
- * created by instances of this class.
33
- */
34
- bool canCreateTurboModule(const std::string &name);
35
- };
36
-
37
- } // namespace react
38
- } // namespace facebook
@@ -1,65 +0,0 @@
1
- #include "MainComponentsRegistry.h"
2
-
3
- #include <CoreComponentsRegistry.h>
4
- #include <fbjni/fbjni.h>
5
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
6
- #include <react/renderer/components/rncore/ComponentDescriptors.h>
7
- #include <rncli.h>
8
-
9
- namespace facebook {
10
- namespace react {
11
-
12
- MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
13
-
14
- std::shared_ptr<ComponentDescriptorProviderRegistry const>
15
- MainComponentsRegistry::sharedProviderRegistry() {
16
- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
17
-
18
- // Autolinked providers registered by RN CLI
19
- rncli_registerProviders(providerRegistry);
20
-
21
- // Custom Fabric Components go here. You can register custom
22
- // components coming from your App or from 3rd party libraries here.
23
- //
24
- // providerRegistry->add(concreteComponentDescriptorProvider<
25
- // AocViewerComponentDescriptor>());
26
- return providerRegistry;
27
- }
28
-
29
- jni::local_ref<MainComponentsRegistry::jhybriddata>
30
- MainComponentsRegistry::initHybrid(
31
- jni::alias_ref<jclass>,
32
- ComponentFactory *delegate) {
33
- auto instance = makeCxxInstance(delegate);
34
-
35
- auto buildRegistryFunction =
36
- [](EventDispatcher::Weak const &eventDispatcher,
37
- ContextContainer::Shared const &contextContainer)
38
- -> ComponentDescriptorRegistry::Shared {
39
- auto registry = MainComponentsRegistry::sharedProviderRegistry()
40
- ->createComponentDescriptorRegistry(
41
- {eventDispatcher, contextContainer});
42
-
43
- auto mutableRegistry =
44
- std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
45
-
46
- mutableRegistry->setFallbackComponentDescriptor(
47
- std::make_shared<UnimplementedNativeViewComponentDescriptor>(
48
- ComponentDescriptorParameters{
49
- eventDispatcher, contextContainer, nullptr}));
50
-
51
- return registry;
52
- };
53
-
54
- delegate->buildRegistryFunction = buildRegistryFunction;
55
- return instance;
56
- }
57
-
58
- void MainComponentsRegistry::registerNatives() {
59
- registerHybrid({
60
- makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
61
- });
62
- }
63
-
64
- } // namespace react
65
- } // namespace facebook
@@ -1,32 +0,0 @@
1
- #pragma once
2
-
3
- #include <ComponentFactory.h>
4
- #include <fbjni/fbjni.h>
5
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
6
- #include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
7
-
8
- namespace facebook {
9
- namespace react {
10
-
11
- class MainComponentsRegistry
12
- : public facebook::jni::HybridClass<MainComponentsRegistry> {
13
- public:
14
- // Adapt it to the package you used for your Java class.
15
- constexpr static auto kJavaDescriptor =
16
- "Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;";
17
-
18
- static void registerNatives();
19
-
20
- MainComponentsRegistry(ComponentFactory *delegate);
21
-
22
- private:
23
- static std::shared_ptr<ComponentDescriptorProviderRegistry const>
24
- sharedProviderRegistry();
25
-
26
- static jni::local_ref<jhybriddata> initHybrid(
27
- jni::alias_ref<jclass>,
28
- ComponentFactory *delegate);
29
- };
30
-
31
- } // namespace react
32
- } // namespace facebook
@@ -1,11 +0,0 @@
1
- #include <fbjni/fbjni.h>
2
- #include "MainApplicationTurboModuleManagerDelegate.h"
3
- #include "MainComponentsRegistry.h"
4
-
5
- JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
6
- return facebook::jni::initialize(vm, [] {
7
- facebook::react::MainApplicationTurboModuleManagerDelegate::
8
- registerNatives();
9
- facebook::react::MainComponentsRegistry::registerNatives();
10
- });
11
- }