react-native 0.88.0-rc.0 → 0.88.0-rc.1
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/ReactNativeVersion.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3056 -1531
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2239 -1011
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2451 -1124
- package/React/Base/RCTVersion.m +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +8 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +74 -56
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
- package/package.json +10 -10
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +18 -4
- package/scripts/setup-apple-spm.js +82 -4
- package/scripts/spm/autolinking-plugins.js +8 -5
- package/scripts/spm/expand-spm-dependencies.js +217 -156
- package/scripts/spm/generate-spm-autolinking.js +114 -88
- package/scripts/spm/generate-spm-xcodeproj.js +67 -22
- package/scripts/spm/ios-deployment-target.js +378 -0
- package/scripts/spm/read-podspec.js +156 -8
- package/scripts/spm/scaffold-package-swift.js +272 -105
- package/scripts/spm/spm-pbxproj.js +36 -21
- package/scripts/spm/spm-types.js +25 -8
- package/scripts/spm/spm-utils.js +26 -0
- package/scripts/spm/swiftpm-config.js +245 -0
- package/scripts/spm/sync-spm-autolinking.js +11 -2
- package/sdks/hermes-engine/version.properties +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +10 -5
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -4
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +6 -4
- package/src/react-private-interface.js +4 -0
- package/src/react-private-interface.js.flow +2 -0
- package/types_generated/Libraries/ReactNative/FabricUIManager.d.ts +47 -0
- package/types_generated/src/react-private-interface.d.ts +4 -1
package/scripts/spm/spm-types.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/*::
|
|
12
|
+
import type {SwiftpmNameOutcome} from './swiftpm-config';
|
|
12
13
|
export type SetupArgs = {
|
|
13
14
|
action: 'add' | 'update' | 'deinit' | 'sync' | 'codegen' | 'download' | 'scaffold' | null,
|
|
14
15
|
version: string | null,
|
|
@@ -66,6 +67,8 @@ export type AutolinkingArgs = {
|
|
|
66
67
|
autolinkingJson: string | null,
|
|
67
68
|
output: string | null,
|
|
68
69
|
xcframeworksPath: string | null,
|
|
70
|
+
// Platform floor of every manifest this run writes; sanitized by parseArgs.
|
|
71
|
+
iosDeploymentTarget: string,
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
export type SpmTarget = {
|
|
@@ -143,13 +146,19 @@ export type AutolinkedDep = {
|
|
|
143
146
|
name: string,
|
|
144
147
|
root: string,
|
|
145
148
|
platforms: {ios: AutolinkingIosPlatform, ...},
|
|
146
|
-
// Resolved Swift target / module / headers-subdir name
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
149
|
+
// Resolved Swift target / module / headers-subdir name — the name the library
|
|
150
|
+
// declares in `swiftpmConfig`, else its podspec's (see resolveSwiftName).
|
|
151
|
+
// Populated by expandSpmDependencies — always present after expansion;
|
|
152
|
+
// optional in the type so caller-side construction stays simple.
|
|
150
153
|
swiftName?: string,
|
|
151
|
-
//
|
|
152
|
-
//
|
|
154
|
+
// Where swiftName came from. Only a podspec-derived name is safe for the
|
|
155
|
+
// scaffolder to record in the library's package.json.
|
|
156
|
+
swiftNameSource?: 'config' | 'podspec' | 'npm',
|
|
157
|
+
// Which podspec field named it ('podspec' source only), so `spm scaffold` can
|
|
158
|
+
// report the choice it made between `header_dir` and `module_name`.
|
|
159
|
+
swiftNamePodspecKey?: 'header_dir' | 'module_name' | 'name',
|
|
160
|
+
// Populated by expandSpmDependencies from each dep's declared
|
|
161
|
+
// `dependencies` array.
|
|
153
162
|
spmDependencies?: Array<string>,
|
|
154
163
|
...
|
|
155
164
|
};
|
|
@@ -199,6 +208,7 @@ export type AggregatorInput = {
|
|
|
199
208
|
// the aggregator's package deps + the AutolinkedAggregate target deps.
|
|
200
209
|
pluginPackageDeps?: ReadonlyArray<PluginPackageDep>,
|
|
201
210
|
pluginProductDeps?: ReadonlyArray<PluginProductDep>,
|
|
211
|
+
iosDeploymentTarget?: ?string,
|
|
202
212
|
};
|
|
203
213
|
|
|
204
214
|
// --- Autolinking plugins (PREVIEW / unstable contract) ---
|
|
@@ -370,6 +380,7 @@ export type SynthPackageSpec = {
|
|
|
370
380
|
// `<react/renderer/components/safeareacontext/X.h>` resolve through the
|
|
371
381
|
// dep's own `common/cpp/` subtree.
|
|
372
382
|
headerSearchPaths?: ?Array<string>,
|
|
383
|
+
iosDeploymentTarget?: ?string,
|
|
373
384
|
};
|
|
374
385
|
|
|
375
386
|
|
|
@@ -422,6 +433,10 @@ export type PodspecModel = {
|
|
|
422
433
|
// physical source tree (SPM has no header_mappings_dir copy step).
|
|
423
434
|
headerMappingsDirs: Array<string>,
|
|
424
435
|
headerDir: ?string,
|
|
436
|
+
// What CocoaPods compiles the module as, and so what Swift and `@import`
|
|
437
|
+
// consumers spell (`s.module_name`). Defaults to the pod name in CocoaPods;
|
|
438
|
+
// null here when the podspec does not declare it.
|
|
439
|
+
moduleName: ?string,
|
|
425
440
|
frameworks: Array<string>,
|
|
426
441
|
weakFrameworks: Array<string>,
|
|
427
442
|
libraries: Array<string>,
|
|
@@ -462,8 +477,7 @@ export type PodspecModel = {
|
|
|
462
477
|
// Decouples podspec reading from SPM-specific shaping so each side can be
|
|
463
478
|
// tested in isolation.
|
|
464
479
|
export type SpmScaffoldSpec = {
|
|
465
|
-
// Swift target / module name
|
|
466
|
-
// by `header_dir` when present.
|
|
480
|
+
// Swift target / module name, as resolved by expandSpmDependencies.
|
|
467
481
|
swiftName: string,
|
|
468
482
|
// Source file paths relative to the dep root, ready for `sources: [...]`
|
|
469
483
|
// emission after the `root/` wrapper-dir prefix is applied at emit time.
|
|
@@ -522,6 +536,9 @@ export type ScaffoldResult =
|
|
|
522
536
|
// changed, --force, etc.); false on first-time scaffolds. The CLI
|
|
523
537
|
// orchestrator prompts only for first-time scaffolds.
|
|
524
538
|
previouslyExisted: boolean,
|
|
539
|
+
// What became of `swiftpmConfig.name` in the library's package.json.
|
|
540
|
+
// Absent when the name was not podspec-derived, so nothing was attempted.
|
|
541
|
+
swiftpmName?: SwiftpmNameOutcome,
|
|
525
542
|
}
|
|
526
543
|
| {
|
|
527
544
|
depName: string,
|
package/scripts/spm/spm-utils.js
CHANGED
|
@@ -171,6 +171,29 @@ function toSwiftName(name /*: string */) /*: string */ {
|
|
|
171
171
|
.join('');
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// The charset a declared SwiftPM name must satisfy — permissive on purpose,
|
|
175
|
+
// since it has to admit header-dir style (lowercase with hyphens) as well as
|
|
176
|
+
// Swift identifiers.
|
|
177
|
+
function isValidSwiftName(name /*: unknown */) /*: boolean */ {
|
|
178
|
+
return typeof name === 'string' && /^[A-Za-z_][A-Za-z0-9_-]*$/.test(name);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* SwiftPM's `c99name` — the identifier a target's module is compiled under,
|
|
183
|
+
* with every character C99 rejects replaced by `_`. `react-native-svg` and
|
|
184
|
+
* `react_native_svg` share one, so they cannot both be targets.
|
|
185
|
+
*/
|
|
186
|
+
function toC99Name(name /*: string */) /*: string */ {
|
|
187
|
+
const mangled = name.replace(/[^A-Za-z0-9_]/g, '_');
|
|
188
|
+
return /^[0-9]/.test(mangled) ? `_${mangled}` : mangled;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Collision key for a Swift target name: two names that share one collide, as a
|
|
192
|
+
// module (punctuation) or as a headers directory (case).
|
|
193
|
+
function swiftNameKey(name /*: string */) /*: string */ {
|
|
194
|
+
return toC99Name(name).toLowerCase();
|
|
195
|
+
}
|
|
196
|
+
|
|
174
197
|
/**
|
|
175
198
|
* Derive a default app name from the raw package name and source path.
|
|
176
199
|
* Prefers the source directory name when it's meaningful (e.g. "RNTester"),
|
|
@@ -743,6 +766,9 @@ module.exports = {
|
|
|
743
766
|
sharedCacheDir,
|
|
744
767
|
defaultCacheDir,
|
|
745
768
|
toSwiftName,
|
|
769
|
+
toC99Name,
|
|
770
|
+
swiftNameKey,
|
|
771
|
+
isValidSwiftName,
|
|
746
772
|
deriveAppName,
|
|
747
773
|
readPackageJson,
|
|
748
774
|
findProjectRoot,
|
|
@@ -0,0 +1,245 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const {isValidSwiftName, makeLogger} = require('./spm-utils');
|
|
14
|
+
const fs = require('node:fs');
|
|
15
|
+
const path = require('node:path');
|
|
16
|
+
|
|
17
|
+
const {log, warn} = makeLogger('swiftpm-config');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* swiftpm-config.js — one reader for a package's SwiftPM settings.
|
|
21
|
+
*
|
|
22
|
+
* They live in `swiftpmConfig` in the package's package.json:
|
|
23
|
+
*
|
|
24
|
+
* { "swiftpmConfig": { "name": "RNSVG" } }
|
|
25
|
+
*
|
|
26
|
+
* A library owns `name`, `dependencies`, `autolinkingPlugin` and `scaffold`;
|
|
27
|
+
* an app owns `modules` and `denyPlugins`. The `spm` block in
|
|
28
|
+
* react-native.config.js is the deprecated spelling of the same fields — still
|
|
29
|
+
* read so nothing breaks mid-migration, but package.json wins field by field.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/*::
|
|
33
|
+
export type SwiftpmNameOutcome =
|
|
34
|
+
| 'created'
|
|
35
|
+
| 'inserted'
|
|
36
|
+
| 'already-set'
|
|
37
|
+
| 'skipped'
|
|
38
|
+
| 'failed';
|
|
39
|
+
// User-authored, so values stay unknown and are validated where consumed.
|
|
40
|
+
export type SwiftpmConfig = {
|
|
41
|
+
readonly name?: unknown,
|
|
42
|
+
readonly dependencies?: unknown,
|
|
43
|
+
readonly autolinkingPlugin?: unknown,
|
|
44
|
+
readonly scaffold?: unknown,
|
|
45
|
+
readonly modules?: unknown,
|
|
46
|
+
readonly denyPlugins?: unknown,
|
|
47
|
+
...
|
|
48
|
+
};
|
|
49
|
+
type RnConfig = {...};
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
const SWIFTPM_FIELDS /*: ReadonlyArray<string> */ = [
|
|
53
|
+
'name',
|
|
54
|
+
'dependencies',
|
|
55
|
+
'autolinkingPlugin',
|
|
56
|
+
'scaffold',
|
|
57
|
+
'modules',
|
|
58
|
+
'denyPlugins',
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
// Config file paths already warned about, by kind of warning.
|
|
62
|
+
const deprecationsReported /*: Set<string> */ = new Set();
|
|
63
|
+
const unknownKeysReported /*: Set<string> */ = new Set();
|
|
64
|
+
|
|
65
|
+
function readPackageJson(
|
|
66
|
+
root /*: string */,
|
|
67
|
+
) /*: ?{readonly [string]: unknown} */ {
|
|
68
|
+
const pkgPath = path.join(root, 'package.json');
|
|
69
|
+
if (!fs.existsSync(pkgPath)) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const parsed = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
74
|
+
return parsed != null && typeof parsed === 'object' ? parsed : null;
|
|
75
|
+
} catch (e) {
|
|
76
|
+
warn(
|
|
77
|
+
`Failed to read ${pkgPath}: ${e.message}. 'swiftpmConfig' is ignored.`,
|
|
78
|
+
);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// A settings object, or null for anything else the author may have written
|
|
84
|
+
// there — an array included, since its indices are not fields.
|
|
85
|
+
function objectField(
|
|
86
|
+
source /*: ?{readonly [string]: unknown} */,
|
|
87
|
+
key /*: string */,
|
|
88
|
+
) /*: ?SwiftpmConfig */ {
|
|
89
|
+
const value = source?.[key];
|
|
90
|
+
return value != null && typeof value === 'object' && !Array.isArray(value)
|
|
91
|
+
? value
|
|
92
|
+
: null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function declaredFields(
|
|
96
|
+
config /*: ?{readonly [string]: unknown} */,
|
|
97
|
+
) /*: Array<string> */ {
|
|
98
|
+
return config == null
|
|
99
|
+
? []
|
|
100
|
+
: SWIFTPM_FIELDS.filter(field => config[field] !== undefined);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function stringList(value /*: unknown */) /*: Array<string> */ {
|
|
104
|
+
return Array.isArray(value) ? value.filter(v => typeof v === 'string') : [];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function reportDeprecation(
|
|
108
|
+
root /*: string */,
|
|
109
|
+
fields /*: Array<string> */,
|
|
110
|
+
) /*: void */ {
|
|
111
|
+
const configPath = path.join(root, 'react-native.config.js');
|
|
112
|
+
if (deprecationsReported.has(configPath)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
deprecationsReported.add(configPath);
|
|
116
|
+
warn(
|
|
117
|
+
`${configPath} declares SwiftPM settings in the deprecated 'spm' block (${fields.join(', ')}). ` +
|
|
118
|
+
`Move them to 'swiftpmConfig' in the package's package.json — the 'spm' block still works, but will stop being read.`,
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// A misspelled field would otherwise do nothing at all. Unknown keys are only
|
|
123
|
+
// reported, never rejected: a library may declare a field a newer React Native
|
|
124
|
+
// knows and this one does not.
|
|
125
|
+
function reportUnknownKeys(
|
|
126
|
+
root /*: string */,
|
|
127
|
+
config /*: SwiftpmConfig */,
|
|
128
|
+
) /*: void */ {
|
|
129
|
+
const pkgPath = path.join(root, 'package.json');
|
|
130
|
+
const unknown = Object.keys(config).filter(
|
|
131
|
+
key => !SWIFTPM_FIELDS.includes(key),
|
|
132
|
+
);
|
|
133
|
+
if (unknown.length === 0 || unknownKeysReported.has(pkgPath)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
unknownKeysReported.add(pkgPath);
|
|
137
|
+
warn(
|
|
138
|
+
`${pkgPath} declares 'swiftpmConfig' fields React Native does not know (${unknown.join(', ')}). ` +
|
|
139
|
+
`They are ignored — check the spelling against ${SWIFTPM_FIELDS.join(', ')}.`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The SwiftPM settings that apply to the package at `root`: `swiftpmConfig`
|
|
145
|
+
* from its package.json over the deprecated `spm` block of its already-loaded
|
|
146
|
+
* react-native.config.js. Null when the package declares neither.
|
|
147
|
+
*/
|
|
148
|
+
function readSwiftpmConfig(
|
|
149
|
+
root /*: string */,
|
|
150
|
+
rnConfig /*: ?RnConfig */,
|
|
151
|
+
) /*: ?SwiftpmConfig */ {
|
|
152
|
+
const fromPackageJson = objectField(readPackageJson(root), 'swiftpmConfig');
|
|
153
|
+
if (fromPackageJson != null) {
|
|
154
|
+
reportUnknownKeys(root, fromPackageJson);
|
|
155
|
+
}
|
|
156
|
+
const deprecated = objectField(rnConfig, 'spm');
|
|
157
|
+
const deprecatedFields = declaredFields(deprecated);
|
|
158
|
+
if (deprecatedFields.length > 0) {
|
|
159
|
+
reportDeprecation(root, deprecatedFields);
|
|
160
|
+
}
|
|
161
|
+
if (fromPackageJson == null) {
|
|
162
|
+
return deprecatedFields.length > 0 ? deprecated : null;
|
|
163
|
+
}
|
|
164
|
+
return {...deprecated, ...fromPackageJson};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// The file's own indentation, so writing a field back does not reformat it.
|
|
168
|
+
function detectIndent(source /*: string */) /*: string */ {
|
|
169
|
+
return /\n([ \t]+)"/.exec(source)?.[1] ?? ' ';
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Records `swiftName` as `swiftpmConfig.name` in the package's package.json —
|
|
174
|
+
* the scaffolder's migration step, which is what lets a library stop deriving
|
|
175
|
+
* its SwiftPM name from a podspec. A name the author already chose is never
|
|
176
|
+
* overwritten.
|
|
177
|
+
*/
|
|
178
|
+
function writeSwiftpmName(
|
|
179
|
+
root /*: string */,
|
|
180
|
+
swiftName /*: string */,
|
|
181
|
+
options /*:: ?: {dryRun?: boolean} */,
|
|
182
|
+
) /*: SwiftpmNameOutcome */ {
|
|
183
|
+
if (!isValidSwiftName(swiftName)) {
|
|
184
|
+
return 'skipped';
|
|
185
|
+
}
|
|
186
|
+
const pkgPath = path.join(root, 'package.json');
|
|
187
|
+
let source;
|
|
188
|
+
let pkg;
|
|
189
|
+
try {
|
|
190
|
+
source = fs.readFileSync(pkgPath, 'utf8');
|
|
191
|
+
pkg = JSON.parse(source);
|
|
192
|
+
} catch {
|
|
193
|
+
return 'skipped';
|
|
194
|
+
}
|
|
195
|
+
if (pkg == null || typeof pkg !== 'object') {
|
|
196
|
+
return 'skipped';
|
|
197
|
+
}
|
|
198
|
+
const existing = objectField(pkg, 'swiftpmConfig');
|
|
199
|
+
if (existing == null && pkg.swiftpmConfig !== undefined) {
|
|
200
|
+
warn(
|
|
201
|
+
`${pkgPath} has a 'swiftpmConfig' that is not an object; leaving it alone. ` +
|
|
202
|
+
`React Native resolved the name '${swiftName}' from the podspec.`,
|
|
203
|
+
);
|
|
204
|
+
return 'skipped';
|
|
205
|
+
}
|
|
206
|
+
const declaredName = existing?.name;
|
|
207
|
+
if (declaredName === swiftName) {
|
|
208
|
+
return 'already-set';
|
|
209
|
+
}
|
|
210
|
+
if (declaredName != null) {
|
|
211
|
+
warn(
|
|
212
|
+
`${pkgPath} already sets 'swiftpmConfig.name' to '${String(declaredName)}'; leaving it. ` +
|
|
213
|
+
`React Native resolved '${swiftName}' from the podspec — set them to the same value to silence this.`,
|
|
214
|
+
);
|
|
215
|
+
return 'skipped';
|
|
216
|
+
}
|
|
217
|
+
const outcome = existing == null ? 'created' : 'inserted';
|
|
218
|
+
pkg.swiftpmConfig = {...existing, name: swiftName};
|
|
219
|
+
if (options?.dryRun === true) {
|
|
220
|
+
log(`Would set 'swiftpmConfig.name' to '${swiftName}' in ${pkgPath}`);
|
|
221
|
+
return outcome;
|
|
222
|
+
}
|
|
223
|
+
const serialized = JSON.stringify(pkg, null, detectIndent(source));
|
|
224
|
+
const content = source.endsWith('\n') ? `${serialized}\n` : serialized;
|
|
225
|
+
// Staged and renamed, so an interrupted or out-of-space write cannot leave a
|
|
226
|
+
// third-party package.json truncated.
|
|
227
|
+
const tmpPath = `${pkgPath}.${process.pid}.tmp`;
|
|
228
|
+
try {
|
|
229
|
+
fs.writeFileSync(tmpPath, content, 'utf8');
|
|
230
|
+
fs.renameSync(tmpPath, pkgPath);
|
|
231
|
+
} catch (e) {
|
|
232
|
+
fs.rmSync(tmpPath, {force: true});
|
|
233
|
+
warn(
|
|
234
|
+
`Could not record 'swiftpmConfig.name' in ${pkgPath}: ${e.message}. The manifest is written; the name is not.`,
|
|
235
|
+
);
|
|
236
|
+
return 'failed';
|
|
237
|
+
}
|
|
238
|
+
return outcome;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
module.exports = {
|
|
242
|
+
readSwiftpmConfig,
|
|
243
|
+
stringList,
|
|
244
|
+
writeSwiftpmName,
|
|
245
|
+
};
|
|
@@ -82,6 +82,10 @@ async function main(
|
|
|
82
82
|
demandOption: true,
|
|
83
83
|
describe: 'Path to react-native package root',
|
|
84
84
|
})
|
|
85
|
+
.option('ios-deployment-target', {
|
|
86
|
+
type: 'string',
|
|
87
|
+
describe: 'Platform floor forwarded to the autolinker',
|
|
88
|
+
})
|
|
85
89
|
.help()
|
|
86
90
|
.parseSync();
|
|
87
91
|
|
|
@@ -115,12 +119,17 @@ async function main(
|
|
|
115
119
|
deps.installSpmCodegenTemplate(appRoot, reactNativeRoot, {log});
|
|
116
120
|
|
|
117
121
|
log('Re-generating build/generated/autolinking/Package.swift...');
|
|
118
|
-
|
|
122
|
+
const autolinkingArgv = [
|
|
119
123
|
'--app-root',
|
|
120
124
|
appRoot,
|
|
121
125
|
'--react-native-root',
|
|
122
126
|
reactNativeRoot,
|
|
123
|
-
]
|
|
127
|
+
];
|
|
128
|
+
const iosDeploymentTarget = parsed['ios-deployment-target'];
|
|
129
|
+
if (iosDeploymentTarget != null) {
|
|
130
|
+
autolinkingArgv.push('--ios-deployment-target', iosDeploymentTarget);
|
|
131
|
+
}
|
|
132
|
+
deps.generateAutolinking(autolinkingArgv);
|
|
124
133
|
|
|
125
134
|
// Rebuild the per-app generated-headers farm (vended as the ReactAppHeaders
|
|
126
135
|
// SPM target inside the codegen package). React core headers need no trees
|
|
@@ -1 +1 @@
|
|
|
1
|
-
HERMES_VERSION_NAME=260318099.0.
|
|
1
|
+
HERMES_VERSION_NAME=260318099.0.3
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<52d39a196023796eed43d419c5a0b855>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
* @noformat
|
|
10
10
|
*/
|
|
@@ -34,7 +34,7 @@ export type ReactNativeFeatureFlagsJsOnly = Readonly<{
|
|
|
34
34
|
animatedKeepListenersOnDetach: Getter<boolean>,
|
|
35
35
|
animatedShouldSyncValueBeforeStartCallback: Getter<boolean>,
|
|
36
36
|
deferFlatListFocusChangeRenderUpdate: Getter<boolean>,
|
|
37
|
-
|
|
37
|
+
enableImperativeEvents_DEPRECATED: Getter<boolean>,
|
|
38
38
|
enableNativeEventTargetEventDispatching: Getter<boolean>,
|
|
39
39
|
externalElementInspectionEnabled: Getter<boolean>,
|
|
40
40
|
fixVirtualizeListCollapseWindowSize: Getter<boolean>,
|
|
@@ -80,6 +80,7 @@ export type ReactNativeFeatureFlags = Readonly<{
|
|
|
80
80
|
enableImagePrefetchingAndroid: Getter<boolean>,
|
|
81
81
|
enableImageTransparentTintColor: Getter<boolean>,
|
|
82
82
|
enableImmediateUpdateModeForContentOffsetChanges: Getter<boolean>,
|
|
83
|
+
enableImperativeEvents: Getter<boolean>,
|
|
83
84
|
enableImperativeFocus: Getter<boolean>,
|
|
84
85
|
enableInteropViewManagerClassLookUpOptimizationIOS: Getter<boolean>,
|
|
85
86
|
enableIntersectionObserverByDefault: Getter<boolean>,
|
|
@@ -168,14 +169,14 @@ export const animatedShouldSyncValueBeforeStartCallback: Getter<boolean> = creat
|
|
|
168
169
|
export const deferFlatListFocusChangeRenderUpdate: Getter<boolean> = createJavaScriptFlagGetter('deferFlatListFocusChangeRenderUpdate', false);
|
|
169
170
|
|
|
170
171
|
/**
|
|
171
|
-
*
|
|
172
|
+
* Deprecated in favor of the common flag with the same name, which is the one that can be configured by OSS release stage. This is only kept so JS bundles delivered to older native builds, where the common flag is unavailable, can still enable the feature.
|
|
172
173
|
*/
|
|
173
|
-
export const
|
|
174
|
+
export const enableImperativeEvents_DEPRECATED: Getter<boolean> = createJavaScriptFlagGetter('enableImperativeEvents_DEPRECATED', false);
|
|
174
175
|
|
|
175
176
|
/**
|
|
176
177
|
* When enabled, the React Native renderer dispatches events through the W3C EventTarget API (addEventListener/dispatchEvent) instead of the legacy plugin-based system.
|
|
177
178
|
*/
|
|
178
|
-
export const enableNativeEventTargetEventDispatching: Getter<boolean> = createJavaScriptFlagGetter('enableNativeEventTargetEventDispatching',
|
|
179
|
+
export const enableNativeEventTargetEventDispatching: Getter<boolean> = createJavaScriptFlagGetter('enableNativeEventTargetEventDispatching', true);
|
|
179
180
|
|
|
180
181
|
/**
|
|
181
182
|
* Enable the external inspection API for DevTools to communicate with the Inspector overlay.
|
|
@@ -335,6 +336,10 @@ export const enableImageTransparentTintColor: Getter<boolean> = createNativeFlag
|
|
|
335
336
|
* Dispatches state updates for content offset changes synchronously on the main thread.
|
|
336
337
|
*/
|
|
337
338
|
export const enableImmediateUpdateModeForContentOffsetChanges: Getter<boolean> = createNativeFlagGetter('enableImmediateUpdateModeForContentOffsetChanges', false);
|
|
339
|
+
/**
|
|
340
|
+
* When enabled, ReactNativeElement and ReadOnlyText expose the public EventTarget API (addEventListener, removeEventListener, dispatchEvent). When disabled, those methods are removed from those final classes.
|
|
341
|
+
*/
|
|
342
|
+
export const enableImperativeEvents: Getter<boolean> = createNativeFlagGetter('enableImperativeEvents', false);
|
|
338
343
|
/**
|
|
339
344
|
* Enable ref.focus() and ref.blur() for all views, not just TextInput.
|
|
340
345
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<d6c54d6154c0f0771c211424e608f182>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
* @noformat
|
|
10
10
|
*/
|
|
@@ -56,6 +56,7 @@ export interface Spec extends TurboModule {
|
|
|
56
56
|
readonly enableImagePrefetchingAndroid?: () => boolean;
|
|
57
57
|
readonly enableImageTransparentTintColor?: () => boolean;
|
|
58
58
|
readonly enableImmediateUpdateModeForContentOffsetChanges?: () => boolean;
|
|
59
|
+
readonly enableImperativeEvents?: () => boolean;
|
|
59
60
|
readonly enableImperativeFocus?: () => boolean;
|
|
60
61
|
readonly enableInteropViewManagerClassLookUpOptimizationIOS?: () => boolean;
|
|
61
62
|
readonly enableIntersectionObserverByDefault?: () => boolean;
|
|
@@ -360,12 +360,14 @@ ReactNativeElement_public.prototype = ReactNativeElement.prototype;
|
|
|
360
360
|
// `removeEventListener`, `dispatchEvent`) is only inherited by this final class
|
|
361
361
|
// when `enableNativeEventTargetEventDispatching` is enabled (which makes
|
|
362
362
|
// `ReadOnlyNode` extend `EventTarget`). Until that public API is finalized, it
|
|
363
|
-
// is gated behind `enableImperativeEvents
|
|
364
|
-
//
|
|
365
|
-
//
|
|
363
|
+
// is gated behind `enableImperativeEvents` (or its deprecated JS-only
|
|
364
|
+
// counterpart, `enableImperativeEvents_DEPRECATED`): when both flags are off we
|
|
365
|
+
// remove those methods from this final class. Native/internal event dispatch
|
|
366
|
+
// does not rely on these public methods, so removing them is safe.
|
|
366
367
|
if (
|
|
367
368
|
ReactNativeFeatureFlags.enableNativeEventTargetEventDispatching() &&
|
|
368
|
-
!ReactNativeFeatureFlags.enableImperativeEvents()
|
|
369
|
+
!ReactNativeFeatureFlags.enableImperativeEvents() &&
|
|
370
|
+
!ReactNativeFeatureFlags.enableImperativeEvents_DEPRECATED()
|
|
369
371
|
) {
|
|
370
372
|
const prototype: interface {
|
|
371
373
|
addEventListener?: unknown,
|
|
@@ -45,12 +45,14 @@ ReadOnlyText_public.prototype = ReadOnlyText.prototype;
|
|
|
45
45
|
// `removeEventListener`, `dispatchEvent`) is only inherited by this final class
|
|
46
46
|
// when `enableNativeEventTargetEventDispatching` is enabled (which makes
|
|
47
47
|
// `ReadOnlyNode` extend `EventTarget`). Until that public API is finalized, it
|
|
48
|
-
// is gated behind `enableImperativeEvents
|
|
49
|
-
//
|
|
50
|
-
//
|
|
48
|
+
// is gated behind `enableImperativeEvents` (or its deprecated JS-only
|
|
49
|
+
// counterpart, `enableImperativeEvents_DEPRECATED`): when both flags are off we
|
|
50
|
+
// remove those methods from this final class. Native/internal event dispatch
|
|
51
|
+
// does not rely on these public methods, so removing them is safe.
|
|
51
52
|
if (
|
|
52
53
|
ReactNativeFeatureFlags.enableNativeEventTargetEventDispatching() &&
|
|
53
|
-
!ReactNativeFeatureFlags.enableImperativeEvents()
|
|
54
|
+
!ReactNativeFeatureFlags.enableImperativeEvents() &&
|
|
55
|
+
!ReactNativeFeatureFlags.enableImperativeEvents_DEPRECATED()
|
|
54
56
|
) {
|
|
55
57
|
const prototype: interface {
|
|
56
58
|
addEventListener?: unknown,
|
|
@@ -29,6 +29,7 @@ import typeof ExceptionsManager from '../Libraries/Core/ExceptionsManager';
|
|
|
29
29
|
import typeof RawEventEmitter from '../Libraries/Core/RawEventEmitter';
|
|
30
30
|
import typeof ReactFiberErrorDialog from '../Libraries/Core/ReactFiberErrorDialog';
|
|
31
31
|
import typeof RCTEventEmitter from '../Libraries/EventEmitter/RCTEventEmitter';
|
|
32
|
+
import type {Spec as FabricUIManager} from '../Libraries/ReactNative/FabricUIManager';
|
|
32
33
|
import typeof {
|
|
33
34
|
createPublicInstance,
|
|
34
35
|
createPublicRootInstance,
|
|
@@ -78,6 +79,9 @@ module.exports = {
|
|
|
78
79
|
get UIManager(): UIManager {
|
|
79
80
|
return require('../Libraries/ReactNative/UIManager').default;
|
|
80
81
|
},
|
|
82
|
+
get fabricUIManager(): ?FabricUIManager {
|
|
83
|
+
return require('../Libraries/ReactNative/FabricUIManager').getFabricUIManager();
|
|
84
|
+
},
|
|
81
85
|
// TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads`
|
|
82
86
|
get deepDiffer(): deepDiffer {
|
|
83
87
|
return require('../Libraries/Utilities/differ/deepDiffer').default;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// IMPORTANT: Keep this file in sync with react-private-interface.js.
|
|
15
15
|
// ----------------------------------------------------------------------------
|
|
16
16
|
|
|
17
|
+
import type {Spec as FabricUIManager} from '../Libraries/ReactNative/FabricUIManager';
|
|
17
18
|
import typeof {createPublicTextInstance as createPublicTextInstanceT} from '../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
18
19
|
|
|
19
20
|
export type {PublicRootInstance} from '../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
|
|
@@ -26,6 +27,7 @@ export {default as RCTEventEmitter} from '../Libraries/EventEmitter/RCTEventEmit
|
|
|
26
27
|
export * as ReactNativeViewConfigRegistry from '../Libraries/Renderer/shims/ReactNativeViewConfigRegistry';
|
|
27
28
|
export {default as TextInputState} from '../Libraries/Components/TextInput/TextInputState';
|
|
28
29
|
export {default as UIManager} from '../Libraries/ReactNative/UIManager';
|
|
30
|
+
declare export const fabricUIManager: ?FabricUIManager;
|
|
29
31
|
export {default as deepDiffer} from '../Libraries/Utilities/differ/deepDiffer';
|
|
30
32
|
export {default as deepFreezeAndThrowOnMutationInDev} from '../Libraries/Utilities/deepFreezeAndThrowOnMutationInDev';
|
|
31
33
|
export {default as flattenStyle} from '../Libraries/StyleSheet/flattenStyle';
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
* @generated SignedSource<<7798de311e4858731ccfd93f6ba077fd>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/ReactNative/FabricUIManager.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, MeasureOnSuccessCallback } from "../../src/private/types/HostInstance";
|
|
14
|
+
import type { NativeElementReference } from "../../src/private/webapis/dom/nodes/specs/NativeDOM";
|
|
15
|
+
import type { InternalInstanceHandle, LayoutAnimationConfig, Node } from "../Renderer/shims/ReactNativeTypes";
|
|
16
|
+
import type { RootTag } from "../Types/RootTagTypes";
|
|
17
|
+
export type NodeSet = Array<Node>;
|
|
18
|
+
export type NodeProps = {};
|
|
19
|
+
export interface Spec {
|
|
20
|
+
readonly createNode: (reactTag: number, viewName: string, rootTag: RootTag, props: NodeProps, instanceHandle: InternalInstanceHandle) => Node;
|
|
21
|
+
readonly cloneNode: (node: Node) => Node;
|
|
22
|
+
readonly cloneNodeWithNewChildren: (node: Node) => Node;
|
|
23
|
+
readonly cloneNodeWithNewProps: (node: Node, newProps: NodeProps) => Node;
|
|
24
|
+
readonly cloneNodeWithNewChildrenAndProps: (node: Node, newProps: NodeProps) => Node;
|
|
25
|
+
readonly createChildSet: (rootTag: RootTag) => NodeSet;
|
|
26
|
+
readonly appendChild: (parentNode: Node, child: Node) => Node;
|
|
27
|
+
readonly appendChildToSet: (childSet: NodeSet, child: Node) => void;
|
|
28
|
+
readonly completeRoot: (rootTag: RootTag, childSet: NodeSet) => void;
|
|
29
|
+
readonly measure: (node: Node | NativeElementReference, callback: MeasureOnSuccessCallback) => void;
|
|
30
|
+
readonly measureInWindow: (node: Node | NativeElementReference, callback: MeasureInWindowOnSuccessCallback) => void;
|
|
31
|
+
readonly measureLayout: (node: Node | NativeElementReference, relativeNode: Node | NativeElementReference, onFail: () => void, onSuccess: MeasureLayoutOnSuccessCallback) => void;
|
|
32
|
+
readonly configureNextLayoutAnimation: (config: LayoutAnimationConfig, callback: () => void, errorCallback: () => void) => void;
|
|
33
|
+
readonly sendAccessibilityEvent: (node: Node, eventType: string) => void;
|
|
34
|
+
readonly findShadowNodeByTag_DEPRECATED: (reactTag: number) => Node | undefined;
|
|
35
|
+
readonly setNativeProps: (node: Node | NativeElementReference, newProps: NodeProps) => void;
|
|
36
|
+
readonly dispatchCommand: (node: Node, commandName: string, args: Array<unknown>) => void;
|
|
37
|
+
readonly findNodeAtPoint: (node: Node, locationX: number, locationY: number, callback: (instanceHandle: InternalInstanceHandle | undefined) => void) => void;
|
|
38
|
+
readonly compareDocumentPosition: (node: Node | NativeElementReference, otherNode: Node | NativeElementReference) => number;
|
|
39
|
+
readonly getBoundingClientRect: (node: Node | NativeElementReference, includeTransform: boolean) => [number, number, number, number] | undefined;
|
|
40
|
+
readonly setIsJSResponder: (node: Node | NativeElementReference, isJSResponder: boolean, blockNativeResponder: boolean) => void;
|
|
41
|
+
readonly unstable_DefaultEventPriority: number;
|
|
42
|
+
readonly unstable_DiscreteEventPriority: number;
|
|
43
|
+
readonly unstable_ContinuousEventPriority: number;
|
|
44
|
+
readonly unstable_IdleEventPriority: number;
|
|
45
|
+
readonly unstable_getCurrentEventPriority: () => number;
|
|
46
|
+
}
|
|
47
|
+
export declare function getFabricUIManager(): null | undefined | Spec;
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<15c92ca112f9f20e0cf4bade86cf466f>>
|
|
8
8
|
*
|
|
9
9
|
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
10
|
* Original file: packages/react-native/src/react-private-interface.js.flow
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import type { Spec as FabricUIManager } from "../Libraries/ReactNative/FabricUIManager";
|
|
13
14
|
import type { createPublicTextInstance as $$IMPORT_TYPEOF_1$$ } from "../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance";
|
|
14
15
|
type createPublicTextInstanceT = typeof $$IMPORT_TYPEOF_1$$;
|
|
15
16
|
export type { PublicRootInstance } from "../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance";
|
|
@@ -21,6 +22,8 @@ export { default as RCTEventEmitter } from "../Libraries/EventEmitter/RCTEventEm
|
|
|
21
22
|
export * as ReactNativeViewConfigRegistry from "../Libraries/Renderer/shims/ReactNativeViewConfigRegistry";
|
|
22
23
|
export { default as TextInputState } from "../Libraries/Components/TextInput/TextInputState";
|
|
23
24
|
export { default as UIManager } from "../Libraries/ReactNative/UIManager";
|
|
25
|
+
export declare const fabricUIManager: null | undefined | FabricUIManager;
|
|
26
|
+
export declare type fabricUIManager = typeof fabricUIManager;
|
|
24
27
|
export { default as deepDiffer } from "../Libraries/Utilities/differ/deepDiffer";
|
|
25
28
|
export { default as deepFreezeAndThrowOnMutationInDev } from "../Libraries/Utilities/deepFreezeAndThrowOnMutationInDev";
|
|
26
29
|
export { default as flattenStyle } from "../Libraries/StyleSheet/flattenStyle";
|