react-native 0.87.0-rc.0 → 0.87.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.
- package/Libraries/Core/InitializeCore.js +9 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +2 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -116
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -31
- package/React/Base/RCTVersion.m +1 -1
- package/React/I18n/RCTLocalizedString.mm +38 -2
- package/React-Core-prebuilt.podspec +45 -17
- package/React-Core.podspec +9 -2
- package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +8 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/index.js +15 -3
- package/index.js.flow +0 -2
- package/package.json +27 -29
- package/react-native.config.js +81 -0
- package/scripts/cocoapods/fabric.rb +1 -1
- package/scripts/cocoapods/rncore.rb +35 -78
- package/scripts/cocoapods/rncore_facades.rb +232 -0
- package/scripts/cocoapods/rndependencies.rb +64 -3
- package/scripts/cocoapods/rndeps_facades.rb +193 -0
- package/scripts/cocoapods/spm.rb +78 -11
- package/scripts/codegen/templates/Package.swift.spm-template +97 -0
- package/scripts/react-native-xcode.sh +20 -0
- package/scripts/react_native_pods.rb +65 -16
- package/scripts/replace-rncore-version.js +53 -6
- package/scripts/setup-apple-spm.js +1165 -0
- package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
- package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
- package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
- package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
- package/scripts/spm/__doc__/spm-scripts.md +451 -0
- package/scripts/spm/autolinking-plugins.js +331 -0
- package/scripts/spm/download-spm-artifacts.js +1409 -0
- package/scripts/spm/expand-spm-dependencies.js +216 -0
- package/scripts/spm/flavored-frameworks.js +1008 -0
- package/scripts/spm/generate-spm-autolinking-config.js +161 -0
- package/scripts/spm/generate-spm-autolinking.js +1888 -0
- package/scripts/spm/generate-spm-package.js +302 -0
- package/scripts/spm/generate-spm-xcodeproj.js +2224 -0
- package/scripts/spm/read-podspec.js +695 -0
- package/scripts/spm/scaffold-package-swift.js +1206 -0
- package/scripts/spm/spm-pbxproj.js +654 -0
- package/scripts/spm/spm-types.js +517 -0
- package/scripts/spm/spm-utils.js +645 -0
- package/scripts/spm/sync-spm-autolinking.js +160 -0
- package/sdks/.hermesv1version +1 -0
- package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
- package/sdks/hermes-engine/version.properties +1 -1
- package/src/asset-registry.js +1 -1
- package/src/react-private-interface.js +145 -0
- package/src/react-private-interface.js.flow +48 -0
- package/src/setup-env.js +22 -0
- package/src/unstable-internals-do-not-use.d.ts +214 -0
- package/src/unstable-internals-do-not-use.js +76 -0
- package/third-party-podspecs/ReactNativeDependencies.podspec +2 -2
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +2 -2
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +6 -21
- package/types_generated/index.d.ts +1 -2
- package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
- package/types_generated/src/react-private-interface.d.ts +33 -0
- package/Libraries/Utilities/SceneTracker.js +0 -42
- package/jest-preset.js +0 -26
- package/rn-get-polyfills.js +0 -13
- package/types/tsconfig.json +0 -17
- package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +0 -261
- package/types_generated/tsconfig.test.json +0 -17
|
@@ -22,8 +22,16 @@
|
|
|
22
22
|
* 1. Require system.
|
|
23
23
|
* 2. Bridged modules.
|
|
24
24
|
*
|
|
25
|
+
* @deprecated Since 0.87. Use `'react-native/setup-env'` instead.
|
|
25
26
|
*/
|
|
26
27
|
|
|
27
28
|
'use strict';
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
// NOTE: This delegates to the `'react-native/setup-env'` entry point (rather
|
|
31
|
+
// than calling `setUpDefaultReactNativeEnvironment` directly) so that
|
|
32
|
+
// `src/setup-env.js` is pulled into the module graph. Metro's
|
|
33
|
+
// `getModulesRunBeforeMainModule` only runs modules that are already part of
|
|
34
|
+
// the bundle, and `InitializeCore` is a guaranteed graph entry (via
|
|
35
|
+
// `ReactNativePrivateInitializeCore`). This keeps `'react-native/setup-env'`
|
|
36
|
+
// reachable so it runs before the main module.
|
|
37
|
+
require('../../src/setup-env');
|
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 87;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = 'rc.
|
|
32
|
+
static prerelease: string | null = 'rc.2';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -22,7 +22,6 @@ import type {
|
|
|
22
22
|
WrapperComponentProvider,
|
|
23
23
|
} from './AppRegistry.flow';
|
|
24
24
|
|
|
25
|
-
import SceneTracker from '../Utilities/SceneTracker';
|
|
26
25
|
import DeprecatedPerformanceLoggerStub from './DeprecatedPerformanceLoggerStub';
|
|
27
26
|
import {coerceDisplayMode} from './DisplayMode';
|
|
28
27
|
import HeadlessJsTaskError from './HeadlessJsTaskError';
|
|
@@ -105,7 +104,8 @@ export function registerComponent(
|
|
|
105
104
|
initialProps: appParameters.initialProps,
|
|
106
105
|
rootTag: appParameters.rootTag,
|
|
107
106
|
WrapperComponent:
|
|
108
|
-
wrapperComponentProvider &&
|
|
107
|
+
wrapperComponentProvider &&
|
|
108
|
+
wrapperComponentProvider(appParameters, appKey),
|
|
109
109
|
rootViewStyle:
|
|
110
110
|
rootViewStyleProvider && rootViewStyleProvider(appParameters),
|
|
111
111
|
isLogBox: appKey === 'LogBox',
|
|
@@ -212,7 +212,6 @@ export function runApplication(
|
|
|
212
212
|
"* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.",
|
|
213
213
|
);
|
|
214
214
|
|
|
215
|
-
SceneTracker.setActiveScene({name: appKey});
|
|
216
215
|
runnables[appKey](appParameters, coerceDisplayMode(displayMode));
|
|
217
216
|
}
|
|
218
217
|
|
|
@@ -8,124 +8,13 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import typeof
|
|
12
|
-
import typeof CustomEvent from '../../src/private/webapis/dom/events/CustomEvent';
|
|
13
|
-
import typeof BatchedBridge from '../BatchedBridge/BatchedBridge';
|
|
14
|
-
import typeof legacySendAccessibilityEvent from '../Components/AccessibilityInfo/legacySendAccessibilityEvent';
|
|
15
|
-
import typeof TextInputState from '../Components/TextInput/TextInputState';
|
|
16
|
-
import typeof ExceptionsManager from '../Core/ExceptionsManager';
|
|
17
|
-
import typeof RawEventEmitter from '../Core/RawEventEmitter';
|
|
18
|
-
import typeof ReactFiberErrorDialog from '../Core/ReactFiberErrorDialog';
|
|
19
|
-
import typeof RCTEventEmitter from '../EventEmitter/RCTEventEmitter';
|
|
20
|
-
import typeof {
|
|
21
|
-
createPublicInstance,
|
|
22
|
-
createPublicRootInstance,
|
|
23
|
-
createPublicTextInstance,
|
|
24
|
-
getInternalInstanceHandleFromPublicInstance,
|
|
25
|
-
getNativeTagFromPublicInstance,
|
|
26
|
-
getNodeFromPublicInstance,
|
|
27
|
-
} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
28
|
-
import typeof {
|
|
29
|
-
create as createAttributePayload,
|
|
30
|
-
diff as diffAttributePayloads,
|
|
31
|
-
} from '../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload';
|
|
32
|
-
import typeof UIManager from '../ReactNative/UIManager';
|
|
33
|
-
import typeof * as ReactNativeViewConfigRegistry from '../Renderer/shims/ReactNativeViewConfigRegistry';
|
|
34
|
-
import typeof flattenStyle from '../StyleSheet/flattenStyle';
|
|
35
|
-
import type {DangerouslyImpreciseStyleProp} from '../StyleSheet/StyleSheet';
|
|
36
|
-
import typeof deepFreezeAndThrowOnMutationInDev from '../Utilities/deepFreezeAndThrowOnMutationInDev';
|
|
37
|
-
import typeof deepDiffer from '../Utilities/differ/deepDiffer';
|
|
38
|
-
import typeof Platform from '../Utilities/Platform';
|
|
11
|
+
import typeof {createPublicTextInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
39
12
|
|
|
40
13
|
export type {PublicRootInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
41
14
|
export type PublicTextInstance = ReturnType<createPublicTextInstance>;
|
|
42
15
|
|
|
43
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Since 0.88. Use 'react-native/react-private-interface' instead.
|
|
18
|
+
*/
|
|
44
19
|
// eslint-disable-next-line @react-native/monorepo/no-commonjs-exports
|
|
45
|
-
module.exports =
|
|
46
|
-
get BatchedBridge(): BatchedBridge {
|
|
47
|
-
return require('../BatchedBridge/BatchedBridge').default;
|
|
48
|
-
},
|
|
49
|
-
get ExceptionsManager(): ExceptionsManager {
|
|
50
|
-
return require('../Core/ExceptionsManager').default;
|
|
51
|
-
},
|
|
52
|
-
get Platform(): Platform {
|
|
53
|
-
return require('../Utilities/Platform').default;
|
|
54
|
-
},
|
|
55
|
-
get RCTEventEmitter(): RCTEventEmitter {
|
|
56
|
-
return require('../EventEmitter/RCTEventEmitter').default;
|
|
57
|
-
},
|
|
58
|
-
get ReactNativeViewConfigRegistry(): ReactNativeViewConfigRegistry {
|
|
59
|
-
return require('../Renderer/shims/ReactNativeViewConfigRegistry');
|
|
60
|
-
},
|
|
61
|
-
get TextInputState(): TextInputState {
|
|
62
|
-
return require('../Components/TextInput/TextInputState').default;
|
|
63
|
-
},
|
|
64
|
-
get UIManager(): UIManager {
|
|
65
|
-
return require('../ReactNative/UIManager').default;
|
|
66
|
-
},
|
|
67
|
-
// TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads`
|
|
68
|
-
get deepDiffer(): deepDiffer {
|
|
69
|
-
return require('../Utilities/differ/deepDiffer').default;
|
|
70
|
-
},
|
|
71
|
-
get deepFreezeAndThrowOnMutationInDev(): deepFreezeAndThrowOnMutationInDev<
|
|
72
|
-
{...} | Array<unknown>,
|
|
73
|
-
> {
|
|
74
|
-
return require('../Utilities/deepFreezeAndThrowOnMutationInDev').default;
|
|
75
|
-
},
|
|
76
|
-
// TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads`
|
|
77
|
-
get flattenStyle(): flattenStyle<DangerouslyImpreciseStyleProp> {
|
|
78
|
-
// $FlowFixMe[underconstrained-implicit-instantiation]
|
|
79
|
-
// $FlowFixMe[incompatible-type]
|
|
80
|
-
return require('../StyleSheet/flattenStyle').default;
|
|
81
|
-
},
|
|
82
|
-
get ReactFiberErrorDialog(): ReactFiberErrorDialog {
|
|
83
|
-
return require('../Core/ReactFiberErrorDialog').default;
|
|
84
|
-
},
|
|
85
|
-
get legacySendAccessibilityEvent(): legacySendAccessibilityEvent {
|
|
86
|
-
return require('../Components/AccessibilityInfo/legacySendAccessibilityEvent')
|
|
87
|
-
.default;
|
|
88
|
-
},
|
|
89
|
-
get RawEventEmitter(): RawEventEmitter {
|
|
90
|
-
return require('../Core/RawEventEmitter').default;
|
|
91
|
-
},
|
|
92
|
-
get CustomEvent(): CustomEvent {
|
|
93
|
-
return require('../../src/private/webapis/dom/events/CustomEvent').default;
|
|
94
|
-
},
|
|
95
|
-
get createAttributePayload(): createAttributePayload {
|
|
96
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload')
|
|
97
|
-
.create;
|
|
98
|
-
},
|
|
99
|
-
get diffAttributePayloads(): diffAttributePayloads {
|
|
100
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload')
|
|
101
|
-
.diff;
|
|
102
|
-
},
|
|
103
|
-
get createPublicRootInstance(): createPublicRootInstance {
|
|
104
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
105
|
-
.createPublicRootInstance;
|
|
106
|
-
},
|
|
107
|
-
get createPublicInstance(): createPublicInstance {
|
|
108
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
109
|
-
.createPublicInstance;
|
|
110
|
-
},
|
|
111
|
-
get createPublicTextInstance(): createPublicTextInstance {
|
|
112
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
113
|
-
.createPublicTextInstance;
|
|
114
|
-
},
|
|
115
|
-
get getNativeTagFromPublicInstance(): getNativeTagFromPublicInstance {
|
|
116
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
117
|
-
.getNativeTagFromPublicInstance;
|
|
118
|
-
},
|
|
119
|
-
get getNodeFromPublicInstance(): getNodeFromPublicInstance {
|
|
120
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
121
|
-
.getNodeFromPublicInstance;
|
|
122
|
-
},
|
|
123
|
-
get getInternalInstanceHandleFromPublicInstance(): getInternalInstanceHandleFromPublicInstance {
|
|
124
|
-
return require('../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')
|
|
125
|
-
.getInternalInstanceHandleFromPublicInstance;
|
|
126
|
-
},
|
|
127
|
-
get dispatchNativeEvent(): dispatchNativeEvent {
|
|
128
|
-
return require('../../src/private/renderer/events/dispatchNativeEvent')
|
|
129
|
-
.default;
|
|
130
|
-
},
|
|
131
|
-
};
|
|
20
|
+
module.exports = require('../../src/react-private-interface');
|
|
@@ -8,34 +8,8 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type
|
|
15
|
-
|
|
16
|
-
export {default as BatchedBridge} from '../BatchedBridge/BatchedBridge';
|
|
17
|
-
export {default as ExceptionsManager} from '../Core/ExceptionsManager';
|
|
18
|
-
export {default as Platform} from '../Utilities/Platform';
|
|
19
|
-
export {default as RCTEventEmitter} from '../EventEmitter/RCTEventEmitter';
|
|
20
|
-
export * as ReactNativeViewConfigRegistry from '../Renderer/shims/ReactNativeViewConfigRegistry';
|
|
21
|
-
export {default as TextInputState} from '../Components/TextInput/TextInputState';
|
|
22
|
-
export {default as UIManager} from '../ReactNative/UIManager';
|
|
23
|
-
export {default as deepDiffer} from '../Utilities/differ/deepDiffer';
|
|
24
|
-
export {default as deepFreezeAndThrowOnMutationInDev} from '../Utilities/deepFreezeAndThrowOnMutationInDev';
|
|
25
|
-
export {default as flattenStyle} from '../StyleSheet/flattenStyle';
|
|
26
|
-
export {default as ReactFiberErrorDialog} from '../Core/ReactFiberErrorDialog';
|
|
27
|
-
export {default as legacySendAccessibilityEvent} from '../Components/AccessibilityInfo/legacySendAccessibilityEvent';
|
|
28
|
-
export {default as RawEventEmitter} from '../Core/RawEventEmitter';
|
|
29
|
-
export {default as CustomEvent} from '../../src/private/webapis/dom/events/CustomEvent';
|
|
30
|
-
export {
|
|
31
|
-
create as createAttributePayload,
|
|
32
|
-
diff as diffAttributePayloads,
|
|
33
|
-
} from '../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload';
|
|
34
|
-
export {
|
|
35
|
-
createPublicRootInstance,
|
|
36
|
-
createPublicInstance,
|
|
37
|
-
createPublicTextInstance,
|
|
38
|
-
getNativeTagFromPublicInstance,
|
|
39
|
-
getNodeFromPublicInstance,
|
|
40
|
-
getInternalInstanceHandleFromPublicInstance,
|
|
41
|
-
} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Since 0.88. Use 'react-native/react-private-interface' instead.
|
|
13
|
+
*/
|
|
14
|
+
export type * from '../../src/react-private-interface';
|
|
15
|
+
export * from '../../src/react-private-interface';
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -7,8 +7,45 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RCTLocalizedString.h"
|
|
9
9
|
|
|
10
|
+
#import <React/RCTLog.h>
|
|
11
|
+
|
|
10
12
|
#if !defined(WITH_FBI18N) || !(WITH_FBI18N)
|
|
11
13
|
|
|
14
|
+
// Anchors resource lookups to the bundle that contains this code: React.framework
|
|
15
|
+
// when React Native is consumed prebuilt / via SwiftPM, or the app's main bundle
|
|
16
|
+
// for static source builds.
|
|
17
|
+
@interface RCTI18nStringsAnchor : NSObject
|
|
18
|
+
@end
|
|
19
|
+
@implementation RCTI18nStringsAnchor
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
// Resolves RCTI18nStrings.bundle wherever it ships: the code's own bundle first
|
|
23
|
+
// (prebuilt/SwiftPM embed it inside React.framework), then the app's main bundle
|
|
24
|
+
// (source builds copy it there via the podspec resource_bundles). Returns nil
|
|
25
|
+
// when absent, so the caller falls back to the untranslated default value.
|
|
26
|
+
static NSBundle *RCTI18nStringsBundle(void)
|
|
27
|
+
{
|
|
28
|
+
NSBundle *codeBundle = [NSBundle bundleForClass:[RCTI18nStringsAnchor class]];
|
|
29
|
+
NSURL *url = [codeBundle URLForResource:@"RCTI18nStrings" withExtension:@"bundle"];
|
|
30
|
+
if (url != nil) {
|
|
31
|
+
return [NSBundle bundleWithURL:url];
|
|
32
|
+
}
|
|
33
|
+
NSString *mainPath = [[NSBundle mainBundle] pathForResource:@"RCTI18nStrings" ofType:@"bundle"];
|
|
34
|
+
if (mainPath != nil) {
|
|
35
|
+
return [NSBundle bundleWithPath:mainPath];
|
|
36
|
+
}
|
|
37
|
+
#if RCT_DEV
|
|
38
|
+
// Missing resources are otherwise silent (every lookup falls back to the
|
|
39
|
+
// untranslated default and the privacy manifest quietly drops out of the
|
|
40
|
+
// app's aggregated privacy report). Called once — the caller caches.
|
|
41
|
+
RCTLogWarn(
|
|
42
|
+
@"RCTI18nStrings.bundle not found in React.framework or the app bundle. Localized strings will use their "
|
|
43
|
+
@"untranslated defaults, and React's PrivacyInfo.xcprivacy may be missing from the app's privacy report. "
|
|
44
|
+
@"When consuming the prebuilt React.framework, verify it is embedded into the app with its resources intact.");
|
|
45
|
+
#endif
|
|
46
|
+
return nil;
|
|
47
|
+
}
|
|
48
|
+
|
|
12
49
|
extern "C" {
|
|
13
50
|
|
|
14
51
|
static NSString *FBTStringByConvertingIntegerToBase64(uint64_t number)
|
|
@@ -33,8 +70,7 @@ __attribute__((noinline)) uint64_t FBcoreLocalexxHash48(const char *input, uint6
|
|
|
33
70
|
|
|
34
71
|
NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue)
|
|
35
72
|
{
|
|
36
|
-
static NSBundle *bundle =
|
|
37
|
-
ofType:@"bundle"]];
|
|
73
|
+
static NSBundle *bundle = RCTI18nStringsBundle();
|
|
38
74
|
if (bundle == nil) {
|
|
39
75
|
return defaultValue;
|
|
40
76
|
} else {
|
|
@@ -17,36 +17,64 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
18
18
|
s.platforms = min_supported_versions
|
|
19
19
|
s.source = source
|
|
20
|
+
|
|
21
|
+
# We vend two xcframeworks that ship together in the prebuilt tarball:
|
|
22
|
+
# - React.xcframework: the compiled core. Its per-slice React.framework carries
|
|
23
|
+
# every <React/...> header + the framework module map, so `#import <React/...>`
|
|
24
|
+
# and `@import React;` resolve through FRAMEWORK_SEARCH_PATHS automatically.
|
|
25
|
+
# - ReactNativeHeaders.xcframework: headers-only, PURE-RN. Carries every other
|
|
26
|
+
# RN namespace (<react/...>, <yoga/...>, ...). Its headers are flattened into
|
|
27
|
+
# a top-level Headers/ (see prepare_command) and exposed via the standard pod
|
|
28
|
+
# header search path. The third-party deps namespaces (folly/glog/boost/...)
|
|
29
|
+
# are NOT here — the ReactNativeDependencies pod serves them from its own
|
|
30
|
+
# artifact (see scripts/cocoapods/__docs__/prebuilt-deps.md), wired through
|
|
31
|
+
# add_rn_third_party_dependencies below. (<hermes/...> is supplied by the
|
|
32
|
+
# hermes-engine pod here; it is folded into ReactNativeHeaders only on the
|
|
33
|
+
# SwiftPM consumer side.)
|
|
34
|
+
# There is no clang VFS overlay.
|
|
20
35
|
s.vendored_frameworks = "React.xcframework"
|
|
21
36
|
|
|
22
37
|
s.preserve_paths = '**/*.*'
|
|
23
|
-
s.header_mappings_dir = '
|
|
24
|
-
s.source_files = '
|
|
25
|
-
|
|
26
|
-
s.module_name = 'React'
|
|
27
|
-
s.module_map = 'React.xcframework/Modules/module.modulemap'
|
|
28
|
-
s.public_header_files = 'React.xcframework/Headers/**/*.h'
|
|
38
|
+
s.header_mappings_dir = 'Headers'
|
|
39
|
+
s.source_files = 'Headers/**/*.{h,hpp}'
|
|
40
|
+
s.public_header_files = 'Headers/**/*.h'
|
|
29
41
|
|
|
30
42
|
add_rn_third_party_dependencies(s)
|
|
31
43
|
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
# than the one from the maven repo
|
|
44
|
+
# The downloaded tarball ships React.xcframework and ReactNativeHeaders.xcframework
|
|
45
|
+
# at its root. We make sure React.xcframework is in its own subdirectory (the Maven
|
|
46
|
+
# tarball lays the framework contents at the root; the local tar.gz has a different
|
|
47
|
+
# structure) and flatten ReactNativeHeaders' headers into a top-level Headers/ dir
|
|
48
|
+
# so CocoaPods exposes them on the header search path.
|
|
38
49
|
s.prepare_command = <<~'CMD'
|
|
39
50
|
CURRENT_PATH=$(pwd)
|
|
40
51
|
XCFRAMEWORK_PATH="${CURRENT_PATH}/React.xcframework"
|
|
41
52
|
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
# Flatten ReactNativeHeaders' headers (identical across slices) into Headers/
|
|
54
|
+
# BEFORE we sweep stray root entries into React.xcframework. Fail closed:
|
|
55
|
+
# a tarball without ReactNativeHeaders.xcframework (an artifact published
|
|
56
|
+
# before the headers-spec layout, or a truncated download) would otherwise
|
|
57
|
+
# yield a green install with an empty Headers/ and every <react/...> or
|
|
58
|
+
# <yoga/...> include failing much later, far from the cause.
|
|
59
|
+
mkdir -p Headers
|
|
60
|
+
RNH_XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeHeaders.xcframework" | head -n 1)
|
|
61
|
+
if [ -z "$RNH_XCFRAMEWORK_PATH" ]; then
|
|
62
|
+
echo "[React-Core-prebuilt] ERROR: ReactNativeHeaders.xcframework not found in the prebuilt tarball." >&2
|
|
63
|
+
echo "The artifact predates the headers-spec layout or is incomplete; use a matching react-native version." >&2
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
RNH_HEADERS_PATH=$(find "$RNH_XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
|
|
67
|
+
if [ -z "$RNH_HEADERS_PATH" ]; then
|
|
68
|
+
echo "[React-Core-prebuilt] ERROR: no Headers directory inside $RNH_XCFRAMEWORK_PATH." >&2
|
|
69
|
+
exit 1
|
|
46
70
|
fi
|
|
71
|
+
cp -R "$RNH_HEADERS_PATH/." Headers
|
|
72
|
+
rm -rf "$RNH_XCFRAMEWORK_PATH"
|
|
47
73
|
|
|
48
74
|
mkdir -p "${XCFRAMEWORK_PATH}"
|
|
49
|
-
find "$CURRENT_PATH" -mindepth 1 -maxdepth 1
|
|
75
|
+
find "$CURRENT_PATH" -mindepth 1 -maxdepth 1 \
|
|
76
|
+
! -name "$(basename "$XCFRAMEWORK_PATH")" ! -name "Headers" \
|
|
77
|
+
-exec mv {} "$XCFRAMEWORK_PATH" \;
|
|
50
78
|
CMD
|
|
51
79
|
|
|
52
80
|
# If we are passing a local tarball, we don't want to switch between Debug and Release
|
package/React-Core.podspec
CHANGED
|
@@ -51,7 +51,6 @@ Pod::Spec.new do |s|
|
|
|
51
51
|
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
52
52
|
s.platforms = min_supported_versions
|
|
53
53
|
s.source = source
|
|
54
|
-
s.resource_bundle = { "RCTI18nStrings" => ["React/I18n/strings/*.lproj"]}
|
|
55
54
|
s.compiler_flags = js_engine_flags()
|
|
56
55
|
s.header_dir = "React"
|
|
57
56
|
s.weak_framework = "JavaScriptCore"
|
|
@@ -122,7 +121,15 @@ Pod::Spec.new do |s|
|
|
|
122
121
|
s.dependency "React-hermes"
|
|
123
122
|
end
|
|
124
123
|
|
|
125
|
-
s
|
|
124
|
+
# Both bundles in one declaration: a second `resource_bundle(s) =` would replace
|
|
125
|
+
# (not merge) the first. RCTI18nStrings holds React-Core's localized strings
|
|
126
|
+
# (loaded by RCTLocalizedString); React-Core_privacy is the privacy manifest.
|
|
127
|
+
# (Prebuilt/SwiftPM get both from inside React.xcframework instead — see
|
|
128
|
+
# scripts/ios-prebuild/framework-resources.js — but source builds ship them here.)
|
|
129
|
+
s.resource_bundles = {
|
|
130
|
+
'RCTI18nStrings' => ['React/I18n/strings/*.lproj'],
|
|
131
|
+
'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy',
|
|
132
|
+
}
|
|
126
133
|
|
|
127
134
|
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
|
128
135
|
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
|
|
@@ -53,6 +53,30 @@ val reactNativeDependenciesReleaseDSYMArtifact: PublishArtifact =
|
|
|
53
53
|
classifier = "reactnative-dependencies-dSYM-release"
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// [iOS] React Native Dependencies Headers — the headers-only LIBRARY-type
|
|
57
|
+
// sidecar (per-slice Headers/ + HeadersPath) that SwiftPM auto-serves; the
|
|
58
|
+
// binary xcframework above is framework-type and cannot expose headers to
|
|
59
|
+
// SwiftPM binaryTargets. Also shipped INSIDE the deps tarball for CocoaPods.
|
|
60
|
+
val reactNativeDependenciesHeadersDebugArtifactFile: RegularFile =
|
|
61
|
+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesHeadersDebug.xcframework.tar.gz")
|
|
62
|
+
val reactNativeDependenciesHeadersDebugArtifact: PublishArtifact =
|
|
63
|
+
artifacts.add("externalArtifacts", reactNativeDependenciesHeadersDebugArtifactFile) {
|
|
64
|
+
type = "tgz"
|
|
65
|
+
extension = "tar.gz"
|
|
66
|
+
classifier = "reactnative-dependencies-headers-debug"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
val reactNativeDependenciesHeadersReleaseArtifactFile: RegularFile =
|
|
70
|
+
layout.projectDirectory.file(
|
|
71
|
+
"artifacts/ReactNativeDependenciesHeadersRelease.xcframework.tar.gz"
|
|
72
|
+
)
|
|
73
|
+
val reactNativeDependenciesHeadersReleaseArtifact: PublishArtifact =
|
|
74
|
+
artifacts.add("externalArtifacts", reactNativeDependenciesHeadersReleaseArtifactFile) {
|
|
75
|
+
type = "tgz"
|
|
76
|
+
extension = "tar.gz"
|
|
77
|
+
classifier = "reactnative-dependencies-headers-release"
|
|
78
|
+
}
|
|
79
|
+
|
|
56
80
|
// [iOS] React Native Core
|
|
57
81
|
val reactCoreDebugArtifactFile: RegularFile =
|
|
58
82
|
layout.projectDirectory.file("artifacts/ReactCoreDebug.xcframework.tar.gz")
|
|
@@ -89,6 +113,27 @@ val reactCoreReleaseDSYMArtifact: PublishArtifact =
|
|
|
89
113
|
classifier = "reactnative-core-dSYM-release"
|
|
90
114
|
}
|
|
91
115
|
|
|
116
|
+
// [iOS] React Native Headers — the pure-RN headers-only xcframework, published
|
|
117
|
+
// standalone (it also ships inside the ReactCore tarball for CocoaPods) so
|
|
118
|
+
// SwiftPM consumers can wire it as its own binaryTarget.
|
|
119
|
+
val reactNativeHeadersDebugArtifactFile: RegularFile =
|
|
120
|
+
layout.projectDirectory.file("artifacts/ReactNativeHeadersDebug.xcframework.tar.gz")
|
|
121
|
+
val reactNativeHeadersDebugArtifact: PublishArtifact =
|
|
122
|
+
artifacts.add("externalArtifacts", reactNativeHeadersDebugArtifactFile) {
|
|
123
|
+
type = "tgz"
|
|
124
|
+
extension = "tar.gz"
|
|
125
|
+
classifier = "reactnative-headers-debug"
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
val reactNativeHeadersReleaseArtifactFile: RegularFile =
|
|
129
|
+
layout.projectDirectory.file("artifacts/ReactNativeHeadersRelease.xcframework.tar.gz")
|
|
130
|
+
val reactNativeHeadersReleaseArtifact: PublishArtifact =
|
|
131
|
+
artifacts.add("externalArtifacts", reactNativeHeadersReleaseArtifactFile) {
|
|
132
|
+
type = "tgz"
|
|
133
|
+
extension = "tar.gz"
|
|
134
|
+
classifier = "reactnative-headers-release"
|
|
135
|
+
}
|
|
136
|
+
|
|
92
137
|
apply(from = "../publish.gradle")
|
|
93
138
|
|
|
94
139
|
publishing {
|
|
@@ -99,10 +144,14 @@ publishing {
|
|
|
99
144
|
artifact(reactNativeDependenciesReleaseArtifact)
|
|
100
145
|
artifact(reactNativeDependenciesDebugDSYMArtifact)
|
|
101
146
|
artifact(reactNativeDependenciesReleaseDSYMArtifact)
|
|
147
|
+
artifact(reactNativeDependenciesHeadersDebugArtifact)
|
|
148
|
+
artifact(reactNativeDependenciesHeadersReleaseArtifact)
|
|
102
149
|
artifact(reactCoreDebugArtifact)
|
|
103
150
|
artifact(reactCoreReleaseArtifact)
|
|
104
151
|
artifact(reactCoreDebugDSYMArtifact)
|
|
105
152
|
artifact(reactCoreReleaseDSYMArtifact)
|
|
153
|
+
artifact(reactNativeHeadersDebugArtifact)
|
|
154
|
+
artifact(reactNativeHeadersReleaseArtifact)
|
|
106
155
|
}
|
|
107
156
|
}
|
|
108
157
|
}
|
|
@@ -28,8 +28,14 @@ internal class SynchronousMountItem(private val reactTag: Int, private val props
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
override fun toString(): String {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// NOTE: Intentionally written as an early return rather than assigning the result of an
|
|
32
|
+
// `if` expression to a local `val`. The latter shape triggers a crash in the Android lint
|
|
33
|
+
// K2 UAST analyzer (resolveSyntheticJavaPropertyAccessorCall) while resolving the local
|
|
34
|
+
// variable's `if`-expression initializer, failing `lintVitalAnalyzeRelease`.
|
|
35
|
+
if (!IS_DEVELOPMENT_ENVIRONMENT) {
|
|
36
|
+
return "SYNC UPDATE PROPS [$reactTag]: <hidden>"
|
|
37
|
+
}
|
|
38
|
+
return "SYNC UPDATE PROPS [$reactTag]: ${props.toHashMap()}"
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
override fun getSurfaceId(): Int = View.NO_ID
|
package/index.js
CHANGED
|
@@ -149,9 +149,6 @@ module.exports = {
|
|
|
149
149
|
get TextInput() {
|
|
150
150
|
return require('./Libraries/Components/TextInput/TextInput').default;
|
|
151
151
|
},
|
|
152
|
-
get Touchable() {
|
|
153
|
-
return require('./Libraries/Components/Touchable/Touchable').default;
|
|
154
|
-
},
|
|
155
152
|
get TouchableHighlight() {
|
|
156
153
|
return require('./Libraries/Components/Touchable/TouchableHighlight')
|
|
157
154
|
.default;
|
|
@@ -412,6 +409,21 @@ module.exports = {
|
|
|
412
409
|
// #endregion
|
|
413
410
|
} as ReactNativePublicAPI;
|
|
414
411
|
|
|
412
|
+
// `Touchable` has been removed from the public API types, but remains
|
|
413
|
+
// re-exported at runtime here because of a hanging `react-native-svg` call
|
|
414
|
+
// site (fbsource).
|
|
415
|
+
// TODO(huntie): Remove this re-export once `react-native-svg` is updated.
|
|
416
|
+
/* $FlowFixMe[prop-missing] This is intentional: `Touchable` is a value-only
|
|
417
|
+
* re-export that is absent from the public API types. */
|
|
418
|
+
/* $FlowFixMe[invalid-export] This is intentional: `Touchable` is a value-only
|
|
419
|
+
* re-export that is absent from the public API types. */
|
|
420
|
+
Object.defineProperty(module.exports, 'Touchable', {
|
|
421
|
+
configurable: true,
|
|
422
|
+
get() {
|
|
423
|
+
return require('./Libraries/Components/Touchable/Touchable').default;
|
|
424
|
+
},
|
|
425
|
+
});
|
|
426
|
+
|
|
415
427
|
if (__DEV__) {
|
|
416
428
|
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
|
417
429
|
* attempting to access InteractionManager. */
|
package/index.js.flow
CHANGED
|
@@ -175,8 +175,6 @@ export type {
|
|
|
175
175
|
} from './Libraries/Components/TextInput/TextInput';
|
|
176
176
|
export {default as TextInput} from './Libraries/Components/TextInput/TextInput';
|
|
177
177
|
|
|
178
|
-
export {default as Touchable} from './Libraries/Components/Touchable/Touchable';
|
|
179
|
-
|
|
180
178
|
export type {
|
|
181
179
|
TouchableHighlightInstance,
|
|
182
180
|
TouchableHighlightProps,
|