react-native 0.88.0-rc.0 → 0.88.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/Renderer/implementations/ReactFabric-dev.js +3056 -1531
  3. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2239 -1011
  4. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2451 -1124
  5. package/React/Base/RCTVersion.m +1 -1
  6. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +3 -4
  7. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +8 -0
  8. package/ReactAndroid/gradle.properties +1 -1
  9. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  13. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  14. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +3 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  17. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -1
  18. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  19. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  20. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  21. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  22. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +74 -56
  23. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
  24. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  25. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +5 -1
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  28. package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +18 -65
  29. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +1 -2
  30. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +1 -2
  31. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +2 -9
  32. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +33 -71
  33. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  34. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  35. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +8 -19
  36. package/package.json +16 -13
  37. package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +18 -4
  38. package/scripts/setup-apple-spm.js +82 -4
  39. package/scripts/spm/autolinking-plugins.js +8 -5
  40. package/scripts/spm/expand-spm-dependencies.js +217 -156
  41. package/scripts/spm/generate-spm-autolinking.js +114 -88
  42. package/scripts/spm/generate-spm-xcodeproj.js +67 -22
  43. package/scripts/spm/ios-deployment-target.js +378 -0
  44. package/scripts/spm/read-podspec.js +156 -8
  45. package/scripts/spm/scaffold-package-swift.js +272 -105
  46. package/scripts/spm/spm-pbxproj.js +36 -21
  47. package/scripts/spm/spm-types.js +25 -8
  48. package/scripts/spm/spm-utils.js +26 -0
  49. package/scripts/spm/swiftpm-config.js +245 -0
  50. package/scripts/spm/sync-spm-autolinking.js +11 -2
  51. package/sdks/hermes-engine/version.properties +1 -1
  52. package/src/private/featureflags/ReactNativeFeatureFlags.js +10 -5
  53. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  54. package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -4
  55. package/src/private/webapis/dom/nodes/ReadOnlyText.js +6 -4
  56. package/src/react-private-interface.js +4 -0
  57. package/src/react-private-interface.js.flow +2 -0
  58. package/types_generated/Libraries/ReactNative/FabricUIManager.d.ts +47 -0
  59. package/types_generated/src/react-private-interface.d.ts +4 -1
  60. package/React/Base/RCTArrayBuffer.h +0 -64
  61. package/React/Base/RCTArrayBuffer.mm +0 -127
@@ -1,64 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- NS_ASSUME_NONNULL_BEGIN
11
-
12
- /**
13
- * A fixed-length byte buffer shared between JS `ArrayBuffer`s and ObjC TurboModules. Fixed
14
- * length lets the backing store alias JS memory; `NSMutableData` cannot do that.
15
- *
16
- * `isOwningBytes`:
17
- * - `YES` — safe to retain and use from any thread (synchronize if aliasing JS
18
- * memory).
19
- * - `NO` — valid only during the synchronous call on the calling thread; copy with
20
- * `arrayBufferWithCopiedBytes:length:` to keep the bytes.
21
- */
22
- @interface RCTArrayBuffer : NSObject
23
-
24
- /**
25
- * NULL when `length` is 0, non-NULL otherwise, matching `NSData.bytes`.
26
- */
27
- @property (nonatomic, readonly, nullable) void *mutableBytes NS_RETURNS_INNER_POINTER;
28
-
29
- @property (nonatomic, readonly) NSUInteger length;
30
-
31
- /** Whether the buffer owns its bytes. See the class comment. */
32
- @property (nonatomic, readonly, getter=isOwningBytes) BOOL owningBytes;
33
-
34
- /**
35
- * A new zero-filled owning buffer.
36
- */
37
- + (instancetype)arrayBufferWithLength:(NSUInteger)length;
38
-
39
- /**
40
- * A new owning buffer holding a copy of `bytes`. Passing NULL zero-fills.
41
- */
42
- + (instancetype)arrayBufferWithCopiedBytes:(const void *_Nullable)bytes length:(NSUInteger)length;
43
-
44
- /**
45
- * An owning buffer aliasing `bytes` without copying. If `cleanup` is non-nil, it runs on dealloc,
46
- * like `-[NSData dataWithBytesNoCopy:length:freeWhenDone:YES]`; if nil, the caller must keep
47
- * `bytes` valid until dealloc. NULL `bytes` with non-zero `length` raises NSInvalidArgumentException.
48
- */
49
- + (instancetype)arrayBufferWithOwnedBytes:(nullable void *)bytes
50
- length:(NSUInteger)length
51
- cleanup:(nullable void (^)(void))cleanup;
52
-
53
- /**
54
- * A non-owning, zero-copy alias of `bytes`. See the class comment for lifetime rules. NULL `bytes`
55
- * with non-zero `length` raises NSInvalidArgumentException.
56
- */
57
- + (instancetype)arrayBufferWithUnownedBytes:(nullable void *)bytes length:(NSUInteger)length;
58
-
59
- - (instancetype)init NS_UNAVAILABLE;
60
- + (instancetype)new NS_UNAVAILABLE;
61
-
62
- @end
63
-
64
- NS_ASSUME_NONNULL_END
@@ -1,127 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import "RCTArrayBuffer.h"
9
-
10
- #include <cstdint>
11
- #include <cstring>
12
- #include <utility>
13
- #include <vector>
14
-
15
- @interface RCTArrayBuffer ()
16
-
17
- - (instancetype)initWithBytesNoCopy:(nullable void *)bytes
18
- length:(NSUInteger)length
19
- owningBytes:(BOOL)owningBytes
20
- cleanup:(nullable void (^)(void))cleanup NS_DESIGNATED_INITIALIZER;
21
- - (instancetype)initWithCopiedBytes:(const void *_Nullable)bytes length:(NSUInteger)length;
22
-
23
- @end
24
-
25
- @implementation RCTArrayBuffer {
26
- void *_bytes;
27
- NSUInteger _length;
28
- BOOL _owningBytes;
29
- void (^_cleanup)(void);
30
- std::vector<uint8_t> _copiedBytes;
31
- }
32
-
33
- #pragma mark - Initializers
34
-
35
- - (instancetype)initWithBytesNoCopy:(void *)bytes
36
- length:(NSUInteger)length
37
- owningBytes:(BOOL)owningBytes
38
- cleanup:(void (^)(void))cleanup
39
- {
40
- if (bytes == NULL && length != 0) {
41
- [NSException raise:NSInvalidArgumentException
42
- format:@"RCTArrayBuffer: NULL bytes with length %lu", (unsigned long)length];
43
- }
44
-
45
- if (self = [super init]) {
46
- _bytes = bytes;
47
- _length = length;
48
- _owningBytes = owningBytes;
49
- _cleanup = [cleanup copy];
50
- }
51
- return self;
52
- }
53
-
54
- - (instancetype)initWithCopiedBytes:(const void *)bytes length:(NSUInteger)length
55
- {
56
- if (length == 0) {
57
- return [self initWithBytesNoCopy:NULL length:0 owningBytes:YES cleanup:nil];
58
- }
59
-
60
- std::vector<uint8_t> copy(length);
61
- if (bytes != NULL) {
62
- std::memcpy(copy.data(), bytes, length);
63
- }
64
-
65
- // Moving a vector hands over its heap buffer, so `data()` stays valid in `_copiedBytes`.
66
- if (self = [self initWithBytesNoCopy:copy.data() length:length owningBytes:YES cleanup:nil]) {
67
- _copiedBytes = std::move(copy);
68
- }
69
- return self;
70
- }
71
-
72
- + (instancetype)arrayBufferWithLength:(NSUInteger)length
73
- {
74
- return [[self alloc] initWithCopiedBytes:NULL length:length];
75
- }
76
-
77
- + (instancetype)arrayBufferWithCopiedBytes:(const void *)bytes length:(NSUInteger)length
78
- {
79
- return [[self alloc] initWithCopiedBytes:bytes length:length];
80
- }
81
-
82
- + (instancetype)arrayBufferWithOwnedBytes:(void *)bytes
83
- length:(NSUInteger)length
84
- cleanup:(nullable void (^)(void))cleanup
85
- {
86
- return [[self alloc] initWithBytesNoCopy:bytes length:length owningBytes:YES cleanup:cleanup];
87
- }
88
-
89
- + (instancetype)arrayBufferWithUnownedBytes:(void *)bytes length:(NSUInteger)length
90
- {
91
- return [[self alloc] initWithBytesNoCopy:bytes length:length owningBytes:NO cleanup:nil];
92
- }
93
-
94
- #pragma mark - Accessors
95
-
96
- - (void *)mutableBytes
97
- {
98
- return _bytes;
99
- }
100
-
101
- - (NSUInteger)length
102
- {
103
- return _length;
104
- }
105
-
106
- - (BOOL)isOwningBytes
107
- {
108
- return _owningBytes;
109
- }
110
-
111
- - (NSString *)description
112
- {
113
- return [NSString stringWithFormat:@"<%@: %p; length = %lu; owningBytes = %@>",
114
- NSStringFromClass([self class]),
115
- self,
116
- (unsigned long)_length,
117
- _owningBytes ? @"YES" : @"NO"];
118
- }
119
-
120
- - (void)dealloc
121
- {
122
- if (_cleanup != nil) {
123
- _cleanup();
124
- }
125
- }
126
-
127
- @end