Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change fabric flag #1979

Merged
merged 2 commits into from
Jan 31, 2023
Merged
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
2 changes: 1 addition & 1 deletion FabricExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ SPEC CHECKSUMS:
React-rncore: cfeb5532ec459f562410e8058b8f49e07cd215d4
React-runtimeexecutor: ac80782d9d76ba2b0f709f4de0c427fe33c352dc
ReactCommon: 20e38a9be5fe1341b5e422220877cc94034776ba
RNSVG: f49e247b4ea8b56c27ac52aa92259361b202ba7e
RNSVG: 27a7d7438182ca3323de0c57695e3bdaf1aa5eb4
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: c618b544ff8bd8865cdca602f00cbcdb92fd6d31
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
Expand Down
2 changes: 1 addition & 1 deletion RNSVG.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
}
s.platforms = { ios: '11.0', tvos: '11.0' }
s.compiler_flags = folly_compiler_flags + ' -DRN_FABRIC_ENABLED'
s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
s.source_files = 'apple/**/*.{h,m,mm,cpp}'
s.ios.exclude_files = '**/*.macos.{h,m,mm,cpp}'
s.tvos.exclude_files = '**/*.macos.{h,m,mm,cpp}'
Expand Down
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGClipPath.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

#import "RNSVGClipPath.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGClipPath

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -48,7 +48,7 @@ - (void)prepareForRecycle
{
[super prepareForRecycle];
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (void)parseReference
{
Expand All @@ -70,9 +70,9 @@ - (BOOL)isSimpleClipPath

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGClipPathCls(void)
{
return RNSVGClipPath.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGDefs.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
*/
#import "RNSVGDefs.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGDefs

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand All @@ -35,7 +35,7 @@ + (ComponentDescriptorProvider)componentDescriptorProvider
{
return concreteComponentDescriptorProvider<RNSVGDefsComponentDescriptor>();
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (void)renderTo:(CGContextRef)context
{
Expand All @@ -60,9 +60,9 @@ - (RNSVGPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGDefsCls(void)
{
return RNSVGDefs.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGForeignObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
#import "RNSVGMask.h"
#import "RNSVGNode.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGForeignObject

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -68,7 +68,7 @@ - (void)prepareForRecycle
_foreignObjectheight = nil;
_foreignObjectwidth = nil;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
- (RNSVGPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
return nil;
Expand Down Expand Up @@ -211,9 +211,9 @@ - (void)setForeignObjectheight:(RNSVGLength *)foreignObjectheight

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGForeignObjectCls(void)
{
return RNSVGForeignObject.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGGroup.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
#import "RNSVGClipPath.h"
#import "RNSVGMask.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGGroup {
RNSVGGlyphContext *_glyphContext;
}

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -55,7 +55,7 @@ - (void)prepareForRecycle
_font = nil;
_glyphContext = nil;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (void)setFont:(NSDictionary *)font
{
Expand Down Expand Up @@ -293,9 +293,9 @@ - (void)resetProperties

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGGroupCls(void)
{
return RNSVGGroup.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
4 changes: 2 additions & 2 deletions apple/Elements/RNSVGImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

#import <React/RCTImageSource.h>

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTImageResponseDelegate.h>
#endif

@interface RNSVGImage : RNSVGRenderable
#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
<RCTImageResponseDelegate>
#endif

Expand Down
24 changes: 11 additions & 13 deletions apple/Elements/RNSVGImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#import <React/RCTImageURLLoader.h>
#import <React/RCTImageView.h>

#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

#import <React/RCTBridge.h>
#import <React/RCTLog.h>
#import "RNSVGViewBox.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <React/RCTImageResponseObserverProxy.h>
Expand All @@ -38,29 +38,27 @@
#import "RNSVGFabricConversions.h"

using namespace facebook::react;
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGImage {
CGImageRef _image;
CGSize _imageSize;
RCTImageLoaderCancellationBlock _reloadImageCancellationBlock;

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
RNSVGImageShadowNode::ConcreteState::Shared _state;
RCTImageResponseObserverProxy _imageResponseObserverProxy;
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
}
#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED

- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
static const auto defaultProps = std::make_shared<const RNSVGImageProps>();
_props = defaultProps;

#ifdef RN_FABRIC_ENABLED
_imageResponseObserverProxy = RCTImageResponseObserverProxy(self);
#endif
}
return self;
}
Expand Down Expand Up @@ -168,11 +166,11 @@ - (void)prepareForRecycle
_imageSize = CGSizeZero;
_reloadImageCancellationBlock = nil;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (void)setSrc:(RCTImageSource *)src
{
#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#else
if (src == _src) {
return;
Expand Down Expand Up @@ -201,7 +199,7 @@ - (void)setSrc:(RCTImageSource *)src
[self invalidate];
});
}];
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
}

- (void)setX:(RNSVGLength *)x
Expand Down Expand Up @@ -337,9 +335,9 @@ - (CGPathRef)getPath:(CGContextRef)context

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGImageCls(void)
{
return RNSVGImage.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGLinearGradient.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
#import "RNSVGBrushType.h"
#import "RNSVGPainter.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGLinearGradient

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -79,7 +79,7 @@ - (void)prepareForRecycle
_gradientUnits = kRNSVGUnitsObjectBoundingBox;
_gradientTransform = CGAffineTransformIdentity;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (instancetype)init
{
Expand Down Expand Up @@ -177,9 +177,9 @@ - (void)parseReference
}
@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGLinearGradientCls(void)
{
return RNSVGLinearGradient.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
12 changes: 6 additions & 6 deletions apple/Elements/RNSVGMarker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#import "RNSVGPainter.h"
#import "RNSVGViewBox.h"

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
#import <React/RCTConversions.h>
#import <React/RCTFabricComponentsPlugins.h>
#import <react/renderer/components/rnsvg/ComponentDescriptors.h>
#import <react/renderer/components/view/conversions.h>
#import "RNSVGFabricConversions.h"
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

@implementation RNSVGMarker

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;

- (instancetype)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -79,7 +79,7 @@ - (void)prepareForRecycle
_align = nil;
_meetOrSlice = kRNSVGVBMOSMeet;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED

- (RNSVGPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
Expand Down Expand Up @@ -271,9 +271,9 @@ - (void)renderMarker:(CGContextRef)context

@end

#ifdef RN_FABRIC_ENABLED
#ifdef RCT_NEW_ARCH_ENABLED
Class<RCTComponentViewProtocol> RNSVGMarkerCls(void)
{
return RNSVGMarker.class;
}
#endif // RN_FABRIC_ENABLED
#endif // RCT_NEW_ARCH_ENABLED
Loading