Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-native-test-library/apple/TestLibraryApple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

#import "TestLibraryApple.h"

// Synth library products are emitted as .library(type: .dynamic, ...), so SPM
Expand All @@ -25,3 +27,5 @@ @implementation TestLibraryApple
}

@end

#endif // !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

#import "TestLibraryCommon.h"

@implementation TestLibraryCommon
Expand All @@ -22,3 +24,5 @@ + (NSString *)defaultPrefix
}

@end

#endif // !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
4 changes: 4 additions & 0 deletions packages/react-native/React/Base/RCTBridgeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ RCT_EXTERN_C_END
*/
@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue RCT_DEPRECATED;

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

/**
* Wrap the parameter line of your method implementation with this macro to
* expose it to JS. By default the exposed method will match the first part of
Expand Down Expand Up @@ -371,6 +373,8 @@ RCT_EXTERN_C_END
return &config; \
}

#endif // !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

/**
* Most modules can be used from any thread. All of the modules exported non-sync method will be called on its
* methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native/React/CoreModules/RCTAppearance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ - (void)setColorScheme:(NSString *)style
}
}

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getColorScheme)
#else
- (NSString *)getColorScheme
#endif
{
return _currentColorScheme;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ - (void)setReloadAndProfileConfig:(JS::NativeReactDevToolsRuntimeSettingsModule:
}
}

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getReloadAndProfileConfig)
#else
- (id)getReloadAndProfileConfig
#endif
{
return @{
@"shouldReloadAndProfile" : @(_config.shouldReloadAndProfile),
Expand Down
8 changes: 8 additions & 0 deletions packages/react-native/React/Modules/RCTEventEmitter.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ - (void)invalidate
}
}

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
RCT_EXPORT_METHOD(addListener : (NSString *)eventName)
#else
- (void)addListener:(NSString *)eventName
#endif
{
if (_observationDisabled) {
return;
Expand All @@ -132,7 +136,11 @@ - (void)invalidate
}
}

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
RCT_EXPORT_METHOD(removeListeners : (double)count)
#else
- (void)removeListeners:(double)count
#endif
{
if (_observationDisabled) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

#import <XCTest/XCTest.h>

#import <React/RCTArrayBuffer.h>
Expand Down Expand Up @@ -397,3 +399,5 @@ - (void)testNativeBackedArrayBufferIsAliasedAndKeepsBackingStoreAlive
}

@end

#endif // !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)

#import "RCTSampleLegacyModule.h"

@implementation RCTSampleLegacyModule
Expand Down Expand Up @@ -202,3 +204,5 @@ - (NSDictionary *)constantsToExport
}

@end

#endif // !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
4 changes: 4 additions & 0 deletions packages/rn-tester/NativeModuleExample/Screenshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@

#import <React/RCTViewManager.h>

#ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP

@interface ScreenshotManager : RCTViewManager
@end

#endif // RCT_REMOVE_LEGACY_COMPONENT_INTEROP
4 changes: 4 additions & 0 deletions packages/rn-tester/NativeModuleExample/Screenshot.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#import <React/RCTUIManager.h>

#ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP

@implementation ScreenshotManager

RCT_EXPORT_MODULE();
Expand Down Expand Up @@ -83,3 +85,5 @@ @implementation ScreenshotManager
}

@end

#endif // RCT_REMOVE_LEGACY_COMPONENT_INTEROP
7 changes: 7 additions & 0 deletions packages/rn-tester/RNTesterUnitTests/RCTAllocationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ - (void)invalidate
self.valid = NO;
}

#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
RCT_EXPORT_METHOD(
test : (__unused NSString *)a : (__unused NSNumber *)b : (__unused RCTResponseSenderBlock)
c : (__unused RCTResponseErrorBlock)d)
#else
- (void)test:(__unused NSString *)
a:(__unused NSNumber *)b
:(__unused RCTResponseSenderBlock)c
:(__unused RCTResponseErrorBlock)d
#endif
{
}

Expand Down
Loading