mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Fix autolinking for local app Fabric components"
Summary: Original commit changeset: 28c376fbd08c Original Phabricator Diff: D53661231 Reviewed By: cipolleschi Differential Revision: D53709386 fbshipit-source-id: aab2d99327460cc82591f7de5e6e0296f7695cd6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8a12cfd2d1
commit
b366b4b42e
-72
@@ -16,15 +16,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ArrayPropsNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<ArrayPropsNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -46,15 +42,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using BooleanPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<BooleanPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -76,15 +68,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ColorPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<ColorPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -106,15 +94,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using DimensionPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<DimensionPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -136,15 +120,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EdgeInsetsPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<EdgeInsetsPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -166,15 +146,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EnumPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<EnumPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -196,15 +172,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EventNestedObjectPropsNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<EventNestedObjectPropsNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -226,15 +198,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EventPropsNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<EventPropsNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -256,15 +224,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using FloatPropsNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<FloatPropsNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -286,15 +250,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ImagePropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<ImagePropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -316,15 +276,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using IntegerPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<IntegerPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -346,15 +302,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -376,15 +328,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using MixedPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<MixedPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -406,15 +354,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using MultiNativePropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<MultiNativePropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -436,15 +380,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using NoPropsNoEventsNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<NoPropsNoEventsNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -466,15 +406,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ObjectPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ObjectPropsNativeComponentShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -496,15 +432,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using PointPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<PointPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -526,15 +458,11 @@ Object {
|
||||
|
||||
#include <react/renderer/components/RNCodegenModuleFixtures/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using StringPropNativeComponentViewComponentDescriptor = ConcreteComponentDescriptor<StringPropNativeComponentViewShadowNode>;
|
||||
|
||||
void RNCodegenModuleFixtures_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ export type ViewGeneratorFunction = (libraryName: string, schema: SchemaType) =>
|
||||
|
||||
type LibraryGeneratorNames =
|
||||
| 'generateComponentDescriptorH'
|
||||
| 'generateComponentDescriptorCpp'
|
||||
| 'generateComponentHObjCpp'
|
||||
| 'generateEventEmitterCpp'
|
||||
| 'generateEventEmitterH'
|
||||
|
||||
@@ -19,7 +19,6 @@ TODO:
|
||||
import type {SchemaType} from '../CodegenSchema';
|
||||
|
||||
const schemaValidator = require('../SchemaValidator.js');
|
||||
const generateComponentDescriptorCpp = require('./components/GenerateComponentDescriptorCpp.js');
|
||||
const generateComponentDescriptorH = require('./components/GenerateComponentDescriptorH.js');
|
||||
const generateComponentHObjCpp = require('./components/GenerateComponentHObjCpp.js');
|
||||
const generateEventEmitterCpp = require('./components/GenerateEventEmitterCpp.js');
|
||||
@@ -47,7 +46,6 @@ const path = require('path');
|
||||
|
||||
const ALL_GENERATORS = {
|
||||
generateComponentDescriptorH: generateComponentDescriptorH.generate,
|
||||
generateComponentDescriptorCpp: generateComponentDescriptorCpp.generate,
|
||||
generateComponentHObjCpp: generateComponentHObjCpp.generate,
|
||||
generateEventEmitterCpp: generateEventEmitterCpp.generate,
|
||||
generateEventEmitterH: generateEventEmitterH.generate,
|
||||
@@ -128,7 +126,6 @@ const LIBRARY_GENERATORS = {
|
||||
componentsAndroid: [
|
||||
// JNI/C++ files
|
||||
generateComponentDescriptorH.generate,
|
||||
generateComponentDescriptorCpp.generate,
|
||||
generateEventEmitterCpp.generate,
|
||||
generateEventEmitterH.generate,
|
||||
generatePropsCpp.generate,
|
||||
@@ -143,7 +140,6 @@ const LIBRARY_GENERATORS = {
|
||||
],
|
||||
componentsIOS: [
|
||||
generateComponentDescriptorH.generate,
|
||||
generateComponentDescriptorCpp.generate,
|
||||
generateEventEmitterCpp.generate,
|
||||
generateEventEmitterH.generate,
|
||||
generateComponentHObjCpp.generate,
|
||||
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {SchemaType} from '../../CodegenSchema';
|
||||
|
||||
const {IncludeTemplate} = require('./CppHelpers');
|
||||
|
||||
// File path -> contents
|
||||
type FilesOutput = Map<string, string>;
|
||||
|
||||
const FileTemplate = ({
|
||||
libraryName,
|
||||
componentRegistrations,
|
||||
headerPrefix,
|
||||
}: {
|
||||
libraryName: string,
|
||||
componentRegistrations: string,
|
||||
headerPrefix: string,
|
||||
}) => `
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* ${'@'}generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
${IncludeTemplate({headerPrefix, file: 'ShadowNodes.h'})}
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void ${libraryName}_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
${componentRegistrations}
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
`;
|
||||
|
||||
const ComponentRegistrationTemplate = ({className}: {className: string}) =>
|
||||
`
|
||||
registry->add(concreteComponentDescriptorProvider<${className}ComponentDescriptor>());
|
||||
`.trim();
|
||||
|
||||
module.exports = {
|
||||
generate(
|
||||
libraryName: string,
|
||||
schema: SchemaType,
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
): FilesOutput {
|
||||
const fileName = 'ComponentDescriptors.h';
|
||||
|
||||
const componentRegistrations = Object.keys(schema.modules)
|
||||
.map(moduleName => {
|
||||
const module = schema.modules[moduleName];
|
||||
if (module.type !== 'Component') {
|
||||
return;
|
||||
}
|
||||
|
||||
const {components} = module;
|
||||
// No components in this module
|
||||
if (components == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.keys(components)
|
||||
.map(componentName => {
|
||||
if (components[componentName].interfaceOnly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
return ComponentRegistrationTemplate({className: componentName});
|
||||
})
|
||||
.join('\n');
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
|
||||
const replacedTemplate = FileTemplate({
|
||||
libraryName,
|
||||
componentRegistrations,
|
||||
headerPrefix: headerPrefix ?? '',
|
||||
});
|
||||
|
||||
return new Map([[fileName, replacedTemplate]]);
|
||||
},
|
||||
};
|
||||
+7
-14
@@ -18,12 +18,10 @@ const {IncludeTemplate} = require('./CppHelpers');
|
||||
type FilesOutput = Map<string, string>;
|
||||
|
||||
const FileTemplate = ({
|
||||
libraryName,
|
||||
componentDefinitions,
|
||||
componentDescriptors,
|
||||
headerPrefix,
|
||||
}: {
|
||||
libraryName: string,
|
||||
componentDefinitions: string,
|
||||
componentDescriptors: string,
|
||||
headerPrefix: string,
|
||||
}) => `
|
||||
/**
|
||||
@@ -39,19 +37,15 @@ const FileTemplate = ({
|
||||
|
||||
${IncludeTemplate({headerPrefix, file: 'ShadowNodes.h'})}
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
${componentDefinitions}
|
||||
|
||||
void ${libraryName}_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
${componentDescriptors}
|
||||
|
||||
} // namespace facebook::react
|
||||
`;
|
||||
|
||||
const ComponentDefinitionTemplate = ({className}: {className: string}) =>
|
||||
const ComponentTemplate = ({className}: {className: string}) =>
|
||||
`
|
||||
using ${className}ComponentDescriptor = ConcreteComponentDescriptor<${className}ShadowNode>;
|
||||
`.trim();
|
||||
@@ -66,7 +60,7 @@ module.exports = {
|
||||
): FilesOutput {
|
||||
const fileName = 'ComponentDescriptors.h';
|
||||
|
||||
const componentDefinitions = Object.keys(schema.modules)
|
||||
const componentDescriptors = Object.keys(schema.modules)
|
||||
.map(moduleName => {
|
||||
const module = schema.modules[moduleName];
|
||||
if (module.type !== 'Component') {
|
||||
@@ -85,7 +79,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
return ComponentDefinitionTemplate({className: componentName});
|
||||
return ComponentTemplate({className: componentName});
|
||||
})
|
||||
.join('\n');
|
||||
})
|
||||
@@ -93,8 +87,7 @@ module.exports = {
|
||||
.join('\n');
|
||||
|
||||
const replacedTemplate = FileTemplate({
|
||||
libraryName,
|
||||
componentDefinitions,
|
||||
componentDescriptors,
|
||||
headerPrefix: headerPrefix ?? '',
|
||||
});
|
||||
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const fixtures = require('../__test_fixtures__/fixtures.js');
|
||||
const generator = require('../GenerateComponentDescriptorCpp.js');
|
||||
|
||||
describe('GenerateComponentDescriptorCpp', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
it(`can generate fixture ${fixtureName}`, () => {
|
||||
expect(
|
||||
generator.generate(
|
||||
fixtureName,
|
||||
fixture,
|
||||
'',
|
||||
false,
|
||||
`react/renderer/components/${fixtureName}/`,
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
-874
@@ -1,874 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture ARRAY_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/ARRAY_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void ARRAY_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ArrayPropsNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture ARRAY_PROPS_WITH_NESTED_OBJECT 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/ARRAY_PROPS_WITH_NESTED_OBJECT/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void ARRAY_PROPS_WITH_NESTED_OBJECT_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ArrayPropsNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture BOOLEAN_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/BOOLEAN_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void BOOLEAN_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<BooleanPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture COLOR_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/COLOR_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void COLOR_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ColorPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture COMMANDS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/COMMANDS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void COMMANDS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<CommandNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture COMMANDS_AND_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/COMMANDS_AND_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void COMMANDS_AND_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<CommandNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture DIMENSION_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/DIMENSION_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void DIMENSION_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<DimensionPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture DOUBLE_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/DOUBLE_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void DOUBLE_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<DoublePropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EVENT_NESTED_OBJECT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EVENT_NESTED_OBJECT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<EventsNestedObjectNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EVENT_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EVENT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EVENT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<EventsNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EVENTS_WITH_PAPER_NAME 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EVENTS_WITH_PAPER_NAME/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EVENTS_WITH_PAPER_NAME_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EXCLUDE_ANDROID 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_ANDROID/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EXCLUDE_ANDROID_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ExcludedAndroidComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EXCLUDE_ANDROID_IOS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_ANDROID_IOS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EXCLUDE_ANDROID_IOS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ExcludedAndroidIosComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ExcludedIosComponentComponentDescriptor>());
|
||||
registry->add(concreteComponentDescriptorProvider<MultiFileIncludedNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture FLOAT_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/FLOAT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void FLOAT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<FloatPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture IMAGE_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/IMAGE_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void IMAGE_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ImagePropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture INSETS_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/INSETS_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void INSETS_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<InsetsPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/INT32_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void INT32_ENUM_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<Int32EnumPropsNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/INTEGER_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void INTEGER_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<IntegerPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture INTERFACE_ONLY 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/INTERFACE_ONLY/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void INTERFACE_ONLY_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture MIXED_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/MIXED_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void MIXED_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<MixedPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture MULTI_NATIVE_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/MULTI_NATIVE_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void MULTI_NATIVE_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ImageColorPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture NO_PROPS_NO_EVENTS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/NO_PROPS_NO_EVENTS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void NO_PROPS_NO_EVENTS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<NoPropsNoEventsComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/OBJECT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void OBJECT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<ObjectPropsComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/POINT_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void POINT_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<PointPropNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/STRING_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void STRING_ENUM_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<StringEnumPropsNativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/STRING_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void STRING_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<StringPropComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/TWO_COMPONENTS_DIFFERENT_FILES/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void TWO_COMPONENTS_DIFFERENT_FILES_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<MultiFile1NativeComponentComponentDescriptor>());
|
||||
registry->add(concreteComponentDescriptorProvider<MultiFile2NativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorCpp can generate fixture TWO_COMPONENTS_SAME_FILE 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
||||
*
|
||||
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
||||
* once the code is regenerated.
|
||||
*
|
||||
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/TWO_COMPONENTS_SAME_FILE/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
void TWO_COMPONENTS_SAME_FILE_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
registry->add(concreteComponentDescriptorProvider<MultiComponent1NativeComponentComponentDescriptor>());
|
||||
registry->add(concreteComponentDescriptorProvider<MultiComponent2NativeComponentComponentDescriptor>());
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
`;
|
||||
-116
@@ -16,15 +16,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/ARRAY_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ArrayPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ArrayPropsNativeComponentShadowNode>;
|
||||
|
||||
void ARRAY_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -46,15 +42,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/ARRAY_PROPS_WITH_NESTED_OBJECT/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ArrayPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ArrayPropsNativeComponentShadowNode>;
|
||||
|
||||
void ARRAY_PROPS_WITH_NESTED_OBJECT_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -76,15 +68,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/BOOLEAN_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using BooleanPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<BooleanPropNativeComponentShadowNode>;
|
||||
|
||||
void BOOLEAN_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -106,15 +94,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/COLOR_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ColorPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ColorPropNativeComponentShadowNode>;
|
||||
|
||||
void COLOR_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -136,15 +120,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/COMMANDS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using CommandNativeComponentComponentDescriptor = ConcreteComponentDescriptor<CommandNativeComponentShadowNode>;
|
||||
|
||||
void COMMANDS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -166,15 +146,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/COMMANDS_AND_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using CommandNativeComponentComponentDescriptor = ConcreteComponentDescriptor<CommandNativeComponentShadowNode>;
|
||||
|
||||
void COMMANDS_AND_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -196,15 +172,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/DIMENSION_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using DimensionPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<DimensionPropNativeComponentShadowNode>;
|
||||
|
||||
void DIMENSION_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -226,15 +198,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/DOUBLE_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using DoublePropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<DoublePropNativeComponentShadowNode>;
|
||||
|
||||
void DOUBLE_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -256,15 +224,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EVENT_NESTED_OBJECT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EventsNestedObjectNativeComponentComponentDescriptor = ConcreteComponentDescriptor<EventsNestedObjectNativeComponentShadowNode>;
|
||||
|
||||
void EVENT_NESTED_OBJECT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -286,15 +250,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EVENT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using EventsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<EventsNativeComponentShadowNode>;
|
||||
|
||||
void EVENT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -316,15 +276,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EVENTS_WITH_PAPER_NAME/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
|
||||
|
||||
void EVENTS_WITH_PAPER_NAME_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -346,15 +302,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_ANDROID/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ExcludedAndroidComponentComponentDescriptor = ConcreteComponentDescriptor<ExcludedAndroidComponentShadowNode>;
|
||||
|
||||
void EXCLUDE_ANDROID_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -376,15 +328,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_ANDROID_IOS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ExcludedAndroidIosComponentComponentDescriptor = ConcreteComponentDescriptor<ExcludedAndroidIosComponentShadowNode>;
|
||||
|
||||
void EXCLUDE_ANDROID_IOS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -406,16 +354,12 @@ Map {
|
||||
|
||||
#include <react/renderer/components/EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ExcludedIosComponentComponentDescriptor = ConcreteComponentDescriptor<ExcludedIosComponentShadowNode>;
|
||||
using MultiFileIncludedNativeComponentComponentDescriptor = ConcreteComponentDescriptor<MultiFileIncludedNativeComponentShadowNode>;
|
||||
|
||||
void EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -437,15 +381,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/FLOAT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using FloatPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<FloatPropNativeComponentShadowNode>;
|
||||
|
||||
void FLOAT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -467,15 +407,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/IMAGE_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ImagePropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ImagePropNativeComponentShadowNode>;
|
||||
|
||||
void IMAGE_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -497,15 +433,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/INSETS_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using InsetsPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<InsetsPropNativeComponentShadowNode>;
|
||||
|
||||
void INSETS_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -527,15 +459,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/INT32_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using Int32EnumPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<Int32EnumPropsNativeComponentShadowNode>;
|
||||
|
||||
void INT32_ENUM_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -557,15 +485,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/INTEGER_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using IntegerPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<IntegerPropNativeComponentShadowNode>;
|
||||
|
||||
void INTEGER_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -587,15 +511,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/INTERFACE_ONLY/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
|
||||
|
||||
void INTERFACE_ONLY_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -617,15 +537,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/MIXED_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using MixedPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<MixedPropNativeComponentShadowNode>;
|
||||
|
||||
void MIXED_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -647,15 +563,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/MULTI_NATIVE_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ImageColorPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<ImageColorPropNativeComponentShadowNode>;
|
||||
|
||||
void MULTI_NATIVE_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -677,15 +589,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/NO_PROPS_NO_EVENTS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using NoPropsNoEventsComponentComponentDescriptor = ConcreteComponentDescriptor<NoPropsNoEventsComponentShadowNode>;
|
||||
|
||||
void NO_PROPS_NO_EVENTS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -707,15 +615,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/OBJECT_PROPS/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using ObjectPropsComponentDescriptor = ConcreteComponentDescriptor<ObjectPropsShadowNode>;
|
||||
|
||||
void OBJECT_PROPS_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -737,15 +641,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/POINT_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using PointPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<PointPropNativeComponentShadowNode>;
|
||||
|
||||
void POINT_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -767,15 +667,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/STRING_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using StringEnumPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<StringEnumPropsNativeComponentShadowNode>;
|
||||
|
||||
void STRING_ENUM_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -797,15 +693,11 @@ Map {
|
||||
|
||||
#include <react/renderer/components/STRING_PROP/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using StringPropComponentComponentDescriptor = ConcreteComponentDescriptor<StringPropComponentShadowNode>;
|
||||
|
||||
void STRING_PROP_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -827,16 +719,12 @@ Map {
|
||||
|
||||
#include <react/renderer/components/TWO_COMPONENTS_DIFFERENT_FILES/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using MultiFile1NativeComponentComponentDescriptor = ConcreteComponentDescriptor<MultiFile1NativeComponentShadowNode>;
|
||||
using MultiFile2NativeComponentComponentDescriptor = ConcreteComponentDescriptor<MultiFile2NativeComponentShadowNode>;
|
||||
|
||||
void TWO_COMPONENTS_DIFFERENT_FILES_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
@@ -858,16 +746,12 @@ Map {
|
||||
|
||||
#include <react/renderer/components/TWO_COMPONENTS_SAME_FILE/ShadowNodes.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
using MultiComponent1NativeComponentComponentDescriptor = ConcreteComponentDescriptor<MultiComponent1NativeComponentShadowNode>;
|
||||
using MultiComponent2NativeComponentComponentDescriptor = ConcreteComponentDescriptor<MultiComponent2NativeComponentShadowNode>;
|
||||
|
||||
void TWO_COMPONENTS_SAME_FILE_registerComponentDescriptorsFromCodegen(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
||||
|
||||
} // namespace facebook::react
|
||||
",
|
||||
}
|
||||
|
||||
@@ -141,8 +141,6 @@ if(EXISTS ${PROJECT_BUILD_DIR}/generated/source/codegen/jni/CMakeLists.txt)
|
||||
target_compile_options(${CMAKE_PROJECT_NAME}
|
||||
PRIVATE
|
||||
-DREACT_NATIVE_APP_CODEGEN_HEADER="${APP_CODEGEN_HEADER}.h"
|
||||
-DREACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER="react/renderer/components/${APP_CODEGEN_HEADER}/ComponentDescriptors.h"
|
||||
-DREACT_NATIVE_APP_COMPONENT_REGISTRATION=${APP_CODEGEN_HEADER}_registerComponentDescriptorsFromCodegen
|
||||
-DREACT_NATIVE_APP_MODULE_PROVIDER=${APP_CODEGEN_HEADER}_ModuleProvider
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
|
||||
#include REACT_NATIVE_APP_CODEGEN_HEADER
|
||||
#endif
|
||||
#ifdef REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
||||
#include REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
||||
#endif
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -50,12 +47,7 @@ void registerComponents(
|
||||
// providerRegistry->add(concreteComponentDescriptorProvider<
|
||||
// MyComponentDescriptor>());
|
||||
|
||||
// We link app local components if available
|
||||
#ifdef REACT_NATIVE_APP_COMPONENT_REGISTRATION
|
||||
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
|
||||
#endif
|
||||
|
||||
// And we fallback to the components autolinked by RN CLI
|
||||
// By default we just use the components autolinked by RN CLI
|
||||
rncli_registerProviders(registry);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,22 +11,21 @@
|
||||
#include <ReactCommon/SampleTurboModuleSpec.h>
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
#include <react/renderer/components/AppSpecs/ComponentDescriptors.h>
|
||||
|
||||
#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
|
||||
#include REACT_NATIVE_APP_CODEGEN_HEADER
|
||||
#endif
|
||||
#ifdef REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
||||
#include REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
||||
#endif
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char RNTMyNativeViewName[] = "RNTMyLegacyNativeView";
|
||||
|
||||
void registerComponents(
|
||||
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
||||
#ifdef REACT_NATIVE_APP_COMPONENT_REGISTRATION
|
||||
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
|
||||
#endif
|
||||
registry->add(concreteComponentDescriptorProvider<
|
||||
RNTMyNativeViewComponentDescriptor>());
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> cxxModuleProvider(
|
||||
|
||||
Reference in New Issue
Block a user