mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Removing deprecated API from ComponentDescriptorRegistry
Summary: We don't use it anymore. Changelog: [Internal] Removing internal deprecated API (Fabric) Reviewed By: mdvacca Differential Revision: D18010490 fbshipit-source-id: c6da7fae071356e06bb0920f5a26d6c9b239c052
This commit is contained in:
committed by
Facebook Github Bot
parent
c8176881ce
commit
fd07fc9454
@@ -17,7 +17,7 @@ namespace react {
|
||||
ComponentDescriptorRegistry::ComponentDescriptorRegistry(
|
||||
ComponentDescriptorParameters const ¶meters,
|
||||
ComponentDescriptorProviderRegistry const &providerRegistry)
|
||||
: parameters_(parameters), providerRegistry_(&providerRegistry) {}
|
||||
: parameters_(parameters), providerRegistry_(providerRegistry) {}
|
||||
|
||||
void ComponentDescriptorRegistry::add(
|
||||
ComponentDescriptorProvider componentDescriptorProvider) const {
|
||||
@@ -130,16 +130,8 @@ ComponentDescriptor const &ComponentDescriptorRegistry::at(
|
||||
|
||||
auto it = _registryByName.find(unifiedComponentName);
|
||||
if (it == _registryByName.end()) {
|
||||
// TODO: T54849676 Refactor this condition when RN Fabric Android starts
|
||||
// using ComponentDescriptorProviderRegistry class
|
||||
if (!providerRegistry_) {
|
||||
throw std::invalid_argument(
|
||||
("Unable to find componentDescriptor for " + unifiedComponentName)
|
||||
.c_str());
|
||||
}
|
||||
|
||||
mutex_.unlock_shared();
|
||||
providerRegistry_->request(unifiedComponentName.c_str());
|
||||
providerRegistry_.request(unifiedComponentName.c_str());
|
||||
mutex_.lock_shared();
|
||||
|
||||
it = _registryByName.find(unifiedComponentName);
|
||||
|
||||
@@ -31,11 +31,6 @@ class ComponentDescriptorRegistry {
|
||||
public:
|
||||
using Shared = std::shared_ptr<const ComponentDescriptorRegistry>;
|
||||
|
||||
/*
|
||||
* Deprecated. Use custom constructor instead.
|
||||
*/
|
||||
ComponentDescriptorRegistry() = default;
|
||||
|
||||
/*
|
||||
* Creates an object with stored `ComponentDescriptorParameters` which will
|
||||
* be used later to create `ComponentDescriptor`s.
|
||||
@@ -44,12 +39,6 @@ class ComponentDescriptorRegistry {
|
||||
ComponentDescriptorParameters const ¶meters,
|
||||
ComponentDescriptorProviderRegistry const &providerRegistry);
|
||||
|
||||
/*
|
||||
* Deprecated. Use `add` instead.
|
||||
*/
|
||||
void registerComponentDescriptor(
|
||||
SharedComponentDescriptor componentDescriptor) const;
|
||||
|
||||
ComponentDescriptor const &at(std::string const &componentName) const;
|
||||
ComponentDescriptor const &at(ComponentHandle componentHandle) const;
|
||||
|
||||
@@ -66,6 +55,9 @@ class ComponentDescriptorRegistry {
|
||||
private:
|
||||
friend class ComponentDescriptorProviderRegistry;
|
||||
|
||||
void registerComponentDescriptor(
|
||||
SharedComponentDescriptor componentDescriptor) const;
|
||||
|
||||
/*
|
||||
* Adds (or removes) a `ComponentDescriptor ` created using given
|
||||
* `ComponentDescriptorProvider` and stored `ComponentDescriptorParameters`.
|
||||
@@ -81,7 +73,7 @@ class ComponentDescriptorRegistry {
|
||||
mutable better::map<std::string, SharedComponentDescriptor> _registryByName;
|
||||
ComponentDescriptor::Shared _fallbackComponentDescriptor;
|
||||
ComponentDescriptorParameters parameters_{};
|
||||
ComponentDescriptorProviderRegistry const *providerRegistry_{};
|
||||
ComponentDescriptorProviderRegistry const &providerRegistry_;
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
||||
Reference in New Issue
Block a user