Skip to content

Commit

Permalink
TurboModule: exclude NativeSampleTurboModule in the schema
Browse files Browse the repository at this point in the history
Summary:
The sample module is meant for demo only, but it lives alongside other core modules in react-native repo.

For now, exclude it in the Flow-type parsing, just like `NativeUIManager.js`

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24005108

fbshipit-source-id: 9ef524bfe2778dd983c94d1701f9ce49da5e0a68
  • Loading branch information
fkgozali authored and facebook-github-bot committed Sep 30, 2020
1 parent 94b198c commit 1d89ef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ fileList.forEach(file => {
// NativeUIManager will be deprecated by Fabric UIManager.
// For now, ignore this spec completely because the types are not fully supported.
!f.endsWith('NativeUIManager.js') &&
// NativeSampleTurboModule is for demo purpose. It should be added manually to the
// app for now.
!f.endsWith('NativeSampleTurboModule.js') &&
!f.includes('__tests'),
);
allFiles.push(...dirFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include <PackagesRnTesterAndroidAppSpec.h>
#include <ReactAndroidSpec.h>
// TODO: Remove SampleTurboModule from ReactAndroidSpec, then uncomment.
// #include <ReactCommon/SampleTurboModuleSpec.h>
#include <ReactCommon/SampleTurboModuleSpec.h>

namespace facebook {
namespace react {
Expand All @@ -21,11 +20,10 @@ std::shared_ptr<TurboModule> RNTesterAppModuleProvider(const std::string moduleN
return module;
}

// TODO: Remove SampleTurboModule from ReactAndroidSpec, then uncomment.
// module = SampleTurboModuleSpec_ModuleProvider(moduleName, params);
// if (module != nullptr) {
// return module;
// }
module = SampleTurboModuleSpec_ModuleProvider(moduleName, params);
if (module != nullptr) {
return module;
}

// TODO: fix up the ReactAndroidSpec_ModuleProvider() to avoid the Android prefix.
if (moduleName == "DatePicker") {
Expand Down

0 comments on commit 1d89ef8

Please sign in to comment.