Skip to content

Commit

Permalink
Update codegen artifacts for react-native-test-library
Browse files Browse the repository at this point in the history
Summary:
Some changes have been made to the codegen since `react-native-test-library` was published. This diff updates the generated artifacts in that library.
Changelog: [Internal]

Differential Revision: D59010093
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Jun 25, 2024
1 parent 70b43bb commit 0deafd7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
}

@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case "changeBackgroundColor":
mViewManager.changeBackgroundColor(view, args.getString(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
: TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}


private:
class Delegate : public NativeSampleModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {}
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {

}

double getRandomNumber(jsi::Runtime &rt) override {
static_assert(
Expand All @@ -54,6 +57,7 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
}

private:
friend class NativeSampleModuleCxxSpec;
T *instance_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#ifdef ANDROID
#include <folly/dynamic.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif

namespace facebook::react {
Expand All @@ -25,9 +23,6 @@ class SampleNativeComponentState {
folly::dynamic getDynamic() const {
return {};
};
MapBuffer getMapBuffer() const {
return MapBufferBuilder::EMPTY();
};
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif

// Avoid multiple includes of OSSLibraryExampleSpec symbols
#ifndef OSSLibraryExampleSpec_H
#define OSSLibraryExampleSpec_H

#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
Expand Down Expand Up @@ -41,3 +46,4 @@ namespace facebook::react {
};
} // namespace facebook::react

#endif // OSSLibraryExampleSpec_H
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#ifdef ANDROID
#include <folly/dynamic.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif

namespace facebook::react {
Expand All @@ -25,9 +23,6 @@ class SampleNativeComponentState {
folly::dynamic getDynamic() const {
return {};
};
MapBuffer getMapBuffer() const {
return MapBufferBuilder::EMPTY();
};
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
: TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}


private:
class Delegate : public NativeSampleModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {}
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {

}

double getRandomNumber(jsi::Runtime &rt) override {
static_assert(
Expand All @@ -54,6 +57,7 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
}

private:
friend class NativeSampleModuleCxxSpec;
T *instance_;
};

Expand Down

0 comments on commit 0deafd7

Please sign in to comment.