mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove CoreComponentsRegistry class
Summary: This diff removes the CoreComponentsRegistry class that was recently created to expose Fabric components in OSS changelog: [internal] internal Reviewed By: JoshuaGross, shergin Differential Revision: D23091020 fbshipit-source-id: 9d851608ed0eddb98367265b5e346d5298f5f732
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0f24b1bab3
commit
7fb1afae7f
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric;
|
||||
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
/**
|
||||
* This class is responsible for registrering a set of RN Android view managers into a {@link
|
||||
* ComponentFactory}.
|
||||
*/
|
||||
public class ComponentRegistry {
|
||||
|
||||
@DoNotStrip private final HybridData mHybridData;
|
||||
|
||||
@DoNotStrip
|
||||
private native HybridData initHybrid(ComponentFactory componentFactory);
|
||||
|
||||
public ComponentRegistry(ComponentFactory componentFactory) {
|
||||
mHybridData = initHybrid(componentFactory);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric;
|
||||
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public class CoreComponentsRegistry extends ComponentRegistry {
|
||||
|
||||
static {
|
||||
FabricSoLoader.staticInit();
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
private static native HybridData initHybrid();
|
||||
|
||||
@DoNotStrip
|
||||
private CoreComponentsRegistry(ComponentFactory componentFactory) {
|
||||
super(componentFactory);
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
public static CoreComponentsRegistry register(ComponentFactory componentFactory) {
|
||||
return new CoreComponentsRegistry(componentFactory);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "CoreComponentsRegistry.h"
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
||||
#include <react/renderer/components/view/ViewComponentDescriptor.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
CoreComponentsRegistry::CoreComponentsRegistry(ComponentFactory *delegate)
|
||||
: delegate_(delegate) {}
|
||||
|
||||
std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
||||
CoreComponentsRegistry::sharedProviderRegistry() {
|
||||
static auto providerRegistry =
|
||||
[]() -> std::shared_ptr<ComponentDescriptorProviderRegistry> {
|
||||
auto providerRegistry =
|
||||
std::make_shared<ComponentDescriptorProviderRegistry>();
|
||||
|
||||
providerRegistry->add(
|
||||
concreteComponentDescriptorProvider<ViewComponentDescriptor>());
|
||||
return providerRegistry;
|
||||
}();
|
||||
|
||||
return providerRegistry;
|
||||
}
|
||||
|
||||
jni::local_ref<CoreComponentsRegistry::jhybriddata>
|
||||
CoreComponentsRegistry::initHybrid(
|
||||
jni::alias_ref<jclass>,
|
||||
ComponentFactory *delegate) {
|
||||
auto instance = makeCxxInstance(delegate);
|
||||
|
||||
auto buildRegistryFunction =
|
||||
[](EventDispatcher::Weak const &eventDispatcher,
|
||||
ContextContainer::Shared const &contextContainer)
|
||||
-> ComponentDescriptorRegistry::Shared {
|
||||
auto registry = CoreComponentsRegistry::sharedProviderRegistry()
|
||||
->createComponentDescriptorRegistry(
|
||||
{eventDispatcher, contextContainer});
|
||||
return registry;
|
||||
};
|
||||
|
||||
delegate->buildRegistryFunction = buildRegistryFunction;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void CoreComponentsRegistry::registerNatives() {
|
||||
registerHybrid({
|
||||
makeNativeMethod("initHybrid", CoreComponentsRegistry::initHybrid),
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
||||
#include "ComponentFactory.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class CoreComponentsRegistry
|
||||
: public facebook::jni::HybridClass<CoreComponentsRegistry> {
|
||||
public:
|
||||
constexpr static auto kJavaDescriptor =
|
||||
"Lcom/facebook/react/fabric/CoreComponentsRegistry;";
|
||||
|
||||
static void registerNatives();
|
||||
|
||||
CoreComponentsRegistry(ComponentFactory *delegate);
|
||||
|
||||
private:
|
||||
friend HybridBase;
|
||||
|
||||
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
||||
sharedProviderRegistry();
|
||||
|
||||
const ComponentFactory *delegate_;
|
||||
|
||||
static jni::local_ref<jhybriddata> initHybrid(
|
||||
jni::alias_ref<jclass>,
|
||||
ComponentFactory *delegate);
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "Binding.h"
|
||||
#include "ComponentFactory.h"
|
||||
#include "CoreComponentsRegistry.h"
|
||||
#include "EventBeatManager.h"
|
||||
#include "EventEmitterWrapper.h"
|
||||
#include "StateWrapperImpl.h"
|
||||
@@ -21,6 +20,5 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
||||
facebook::react::EventEmitterWrapper::registerNatives();
|
||||
facebook::react::StateWrapperImpl::registerNatives();
|
||||
facebook::react::ComponentFactory::registerNatives();
|
||||
facebook::react::CoreComponentsRegistry::registerNatives();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user