feat: add Fabric on iOS without ComponentViews (#1821)

Version of #1754 without usage of ComponentViews. It seems like a more proper way, but introduces the necessity of clearing whole state of each component on recycling for it not to be used when view is recycled.

Still known problems:

We stringify props of type NumberProp since codegen only accepts props of a single type. It is the fastest way of dealing with it, but maybe there could be a better way to handle it.
Image resolving should be probably handled the same as in RN core
SvgView needs to set opaque = NO so it is does not have black background (it comes from the fact that RCTViewComponentView overrides backgroundColor setter which in turn somehow messes with the view being opaque). All other svg components do it already so maybe it is not such an issue.
transform prop won't work when set natively since it is not parsed in Fabric
This commit is contained in:
Wojciech Lewicki
2022-08-11 14:08:11 +02:00
committed by GitHub
parent f1fa606664
commit 8f1bda4856
228 changed files with 18136 additions and 1102 deletions

View File

@@ -6,10 +6,15 @@
* LICENSE file in the root directory of this source tree.
*/
#import "RNSVGSvgView.h"
#import <React/UIView+React.h>
#import <React/RCTPointerEvents.h>
#import "RNSVGCGFCRule.h"
#import "RNSVGSvgView.h"
#ifdef RN_FABRIC_ENABLED
#import <React/RCTViewComponentView.h>
#endif // RN_FABRIC_ENABLED
@class RNSVGGroup;
/**
@@ -17,8 +22,12 @@
interfaces for all non-definition nodes.
*/
@interface RNSVGNode : RNSVGView
@interface RNSVGNode :
#ifdef RN_FABRIC_ENABLED
RCTViewComponentView
#else
RNSVGView
#endif // RN_FABRIC_ENABLED
/*
N[1/Sqrt[2], 36]
The inverse of the square root of 2.
@@ -36,6 +45,7 @@ extern CGFloat const RNSVG_DEFAULT_FONT_SIZE;
@property (nonatomic, strong) NSString *markerStart;
@property (nonatomic, strong) NSString *markerMid;
@property (nonatomic, strong) NSString *markerEnd;
@property (nonatomic, strong) RNSVGPlatformView *parentComponentView;
/**
* Used to control how touch events are processed.