Call Turbo Module methods 'methods' in the Turbo Module JSON schema (#44919)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44919

## Changelog:

[Internal] [Fixed] - Call Turbo Module methods 'methods' in the Turbo Module JSON schema

We don't support `properties` on Turbo Modules. We only support methods (even eventEmitters are just methods)

Reviewed By: javache

Differential Revision: D58510557

fbshipit-source-id: 02b1dc93a37b58b47bb9fd94a9658b5a7301bf55
This commit is contained in:
Christoph Purrer
2024-06-14 10:36:31 -07:00
committed by Facebook GitHub Bot
parent 358fe46969
commit 810a516475
16 changed files with 108 additions and 117 deletions
@@ -142,11 +142,8 @@ module.exports = {
const hasteModuleNames: Array<string> = Object.keys(nativeModules).sort();
for (const hasteModuleName of hasteModuleNames) {
const {
aliasMap,
excludedPlatforms,
spec: {properties},
} = nativeModules[hasteModuleName];
const {aliasMap, excludedPlatforms, spec} =
nativeModules[hasteModuleName];
if (excludedPlatforms != null && excludedPlatforms.includes('iOS')) {
continue;
}
@@ -169,10 +166,10 @@ module.exports = {
* Note: As we serialize NativeModule methods, we insert structs into
* StructCollector, as we encounter them.
*/
properties
spec.methods
.filter(property => property.name !== 'getConstants')
.forEach(serializeProperty);
properties
spec.methods
.filter(property => property.name === 'getConstants')
.forEach(serializeProperty);