react-native 0.87.0-rc.1 → 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.
Files changed (51) hide show
  1. package/Libraries/Core/InitializeCore.js +8 -1
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
  4. package/Libraries/ReactNative/AppRegistryImpl.js +2 -3
  5. package/React/Base/RCTVersion.m +1 -1
  6. package/React/I18n/RCTLocalizedString.mm +38 -2
  7. package/React-Core-prebuilt.podspec +45 -17
  8. package/React-Core.podspec +9 -2
  9. package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
  10. package/ReactAndroid/gradle.properties +1 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +8 -2
  12. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  13. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  14. package/package.json +10 -8
  15. package/react-native.config.js +81 -0
  16. package/scripts/cocoapods/fabric.rb +1 -1
  17. package/scripts/cocoapods/rncore.rb +35 -78
  18. package/scripts/cocoapods/rncore_facades.rb +232 -0
  19. package/scripts/cocoapods/rndependencies.rb +64 -3
  20. package/scripts/cocoapods/rndeps_facades.rb +193 -0
  21. package/scripts/cocoapods/spm.rb +78 -11
  22. package/scripts/codegen/templates/Package.swift.spm-template +97 -0
  23. package/scripts/react-native-xcode.sh +20 -0
  24. package/scripts/react_native_pods.rb +65 -16
  25. package/scripts/replace-rncore-version.js +53 -6
  26. package/scripts/setup-apple-spm.js +1165 -0
  27. package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
  28. package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
  29. package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
  30. package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
  31. package/scripts/spm/__doc__/spm-scripts.md +451 -0
  32. package/scripts/spm/autolinking-plugins.js +331 -0
  33. package/scripts/spm/download-spm-artifacts.js +1409 -0
  34. package/scripts/spm/expand-spm-dependencies.js +216 -0
  35. package/scripts/spm/flavored-frameworks.js +1008 -0
  36. package/scripts/spm/generate-spm-autolinking-config.js +161 -0
  37. package/scripts/spm/generate-spm-autolinking.js +1888 -0
  38. package/scripts/spm/generate-spm-package.js +302 -0
  39. package/scripts/spm/generate-spm-xcodeproj.js +2224 -0
  40. package/scripts/spm/read-podspec.js +695 -0
  41. package/scripts/spm/scaffold-package-swift.js +1206 -0
  42. package/scripts/spm/spm-pbxproj.js +654 -0
  43. package/scripts/spm/spm-types.js +517 -0
  44. package/scripts/spm/spm-utils.js +645 -0
  45. package/scripts/spm/sync-spm-autolinking.js +160 -0
  46. package/sdks/.hermesv1version +1 -0
  47. package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
  48. package/sdks/hermes-engine/version.properties +1 -1
  49. package/third-party-podspecs/ReactNativeDependencies.podspec +2 -2
  50. package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +2 -2
  51. package/Libraries/Utilities/SceneTracker.js +0 -42
@@ -27,4 +27,11 @@
27
27
 
28
28
  'use strict';
29
29
 
30
- require('../../src/private/setup/setUpDefaultReactNativeEnvironment').default();
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.1';
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}` : ''}`;
@@ -44,5 +44,6 @@ export type Registry = {
44
44
  };
45
45
  export type WrapperComponentProvider = (
46
46
  appParameters: Object,
47
+ appKey?: string,
47
48
  ) => React.ComponentType<any>;
48
49
  export type RootViewStyleProvider = (appParameters: Object) => ViewStyleProp;
@@ -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 && wrapperComponentProvider(appParameters),
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
 
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(87),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.1",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -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 = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"RCTI18nStrings"
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 = 'React.xcframework/Headers'
24
- s.source_files = 'React.xcframework/Headers/**/*.{h,hpp}'
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
- # We need to make sure that the React.xcframework is copied correctly - in the downloaded tarball
33
- # the root directory is the framework, but when using it we need to have it in a subdirectory
34
- # called React.xcframework, so we need to move the contents of the tarball into that directory.
35
- # This is done in the prepare_command.
36
- # We need to make sure that the headers are copied to the right place - local tar.gz has a different structure
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
- # Check if XCFRAMEWORK_PATH is empty
43
- if [ -z "$XCFRAMEWORK_PATH" ]; then
44
- echo "ERROR: XCFRAMEWORK_PATH is empty."
45
- exit 0
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 ! -name "$(basename "$XCFRAMEWORK_PATH")" -exec mv {} "$XCFRAMEWORK_PATH" \;
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
@@ -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.resource_bundles = {'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy'}
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
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.87.0-rc.1
1
+ VERSION_NAME=0.87.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
  react.internal.hermesPublishingGroup=com.facebook.hermes
4
4
 
@@ -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
- val propsString = if (IS_DEVELOPMENT_ENVIRONMENT) props.toHashMap().toString() else "<hidden>"
32
- return "SYNC UPDATE PROPS [$reactTag]: $propsString"
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
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 87,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.1"
18
+ "prerelease" to "rc.2"
19
19
  )
20
20
  }
@@ -22,7 +22,7 @@ struct ReactNativeVersionType {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 87;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "rc.1";
25
+ std::string_view Prerelease = "rc.2";
26
26
  };
27
27
 
28
28
  constexpr ReactNativeVersionType ReactNativeVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.87.0-rc.1",
3
+ "version": "0.87.0-rc.2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -112,6 +112,8 @@
112
112
  "scripts/react_native_pods_utils/script_phases.sh",
113
113
  "scripts/react_native_pods.rb",
114
114
  "scripts/react-native-xcode.sh",
115
+ "scripts/setup-apple-spm.js",
116
+ "scripts/spm",
115
117
  "scripts/xcode/ccache-clang.sh",
116
118
  "scripts/xcode/ccache-clang++.sh",
117
119
  "scripts/xcode/ccache.conf",
@@ -146,19 +148,19 @@
146
148
  }
147
149
  },
148
150
  "dependencies": {
149
- "@react-native/asset-utils": "0.87.0-rc.1",
150
- "@react-native/codegen": "0.87.0-rc.1",
151
- "@react-native/community-cli-plugin": "0.87.0-rc.1",
152
- "@react-native/gradle-plugin": "0.87.0-rc.1",
153
- "@react-native/normalize-colors": "0.87.0-rc.1",
154
- "@react-native/virtualized-lists": "0.87.0-rc.1",
151
+ "@react-native/asset-utils": "0.87.0-rc.2",
152
+ "@react-native/codegen": "0.87.0-rc.2",
153
+ "@react-native/community-cli-plugin": "0.87.0-rc.2",
154
+ "@react-native/gradle-plugin": "0.87.0-rc.2",
155
+ "@react-native/normalize-colors": "0.87.0-rc.2",
156
+ "@react-native/virtualized-lists": "0.87.0-rc.2",
155
157
  "anser": "^1.4.9",
156
158
  "ansi-regex": "^5.0.0",
157
159
  "babel-plugin-syntax-hermes-parser": "0.36.1",
158
160
  "base64-js": "^1.5.1",
159
161
  "commander": "^12.0.0",
160
162
  "flow-enums-runtime": "^0.0.6",
161
- "hermes-compiler": "250829098.0.15",
163
+ "hermes-compiler": "250829098.0.16",
162
164
  "invariant": "^2.2.4",
163
165
  "memoize-one": "^5.0.0",
164
166
  "metro-runtime": "^0.87.0",
@@ -112,6 +112,87 @@ const codegenCommand /*: Command */ = {
112
112
 
113
113
  commands.push(codegenCommand);
114
114
 
115
+ const spmCommand /*: Command */ = {
116
+ name: 'spm [action]',
117
+ description:
118
+ 'Set up or maintain Swift Package Manager support for the iOS/macOS app. ' +
119
+ 'Actions: add, update, deinit, scaffold. With no action: add (or update ' +
120
+ 'if SPM is already set up).',
121
+ options: [
122
+ {
123
+ name: '--version <string>',
124
+ description:
125
+ 'React Native version (e.g. 0.80.0). Defaults to the version in node_modules/react-native/package.json.',
126
+ },
127
+ {
128
+ name: '--yes',
129
+ description: 'Skip the dirty-pbxproj confirmation prompt.',
130
+ },
131
+ {
132
+ name: '--xcodeproj <path>',
133
+ description:
134
+ '[add] Path to the .xcodeproj to inject SPM packages into ' +
135
+ '(disambiguates when several exist).',
136
+ },
137
+ {
138
+ name: '--productName <string>',
139
+ description:
140
+ '[add] App target to inject into (disambiguates when several exist).',
141
+ },
142
+ {
143
+ name: '--deintegrate',
144
+ description:
145
+ '[add] Run `pod deintegrate` and strip React Native from the Podfile ' +
146
+ 'before injecting (CocoaPods → SwiftPM migration).',
147
+ },
148
+ {
149
+ name: '--artifacts <path>',
150
+ description:
151
+ '[advanced] Local artifact root containing complete debug/ and release/ slots.',
152
+ },
153
+ {
154
+ name: '--download <string>',
155
+ description:
156
+ '[advanced] Artifact download policy: auto (default), skip, or force.',
157
+ },
158
+ {
159
+ name: '--skipCodegen',
160
+ description: '[advanced] Skip the react-native codegen step.',
161
+ },
162
+ ],
163
+ func: async (argv, _config, args) => {
164
+ const passthrough /*: Array<string> */ = [];
165
+ if (argv[0] != null) {
166
+ passthrough.push(argv[0]);
167
+ }
168
+ const stringOpts /*: Array<[string, string]> */ = [
169
+ ['version', '--version'],
170
+ ['productName', '--product-name'],
171
+ ['xcodeproj', '--xcodeproj'],
172
+ ['artifacts', '--artifacts'],
173
+ ['download', '--download'],
174
+ ];
175
+ for (const [key, flag] of stringOpts) {
176
+ if (args[key] != null) {
177
+ passthrough.push(flag, String(args[key]));
178
+ }
179
+ }
180
+ const boolOpts /*: Array<[string, string]> */ = [
181
+ ['skipCodegen', '--skip-codegen'],
182
+ ['deintegrate', '--deintegrate'],
183
+ ['yes', '--yes'],
184
+ ];
185
+ for (const [key, flag] of boolOpts) {
186
+ if (args[key]) {
187
+ passthrough.push(flag);
188
+ }
189
+ }
190
+ await require('./scripts/setup-apple-spm').main(passthrough);
191
+ },
192
+ };
193
+
194
+ commands.push(spmCommand);
195
+
115
196
  const config = {
116
197
  commands,
117
198
  platforms: {} /*:: as {[string]: Readonly<{
@@ -11,7 +11,7 @@ def setup_fabric!(react_native_path: "../node_modules/react-native")
11
11
  pod 'React-Fabric', :path => "#{react_native_path}/ReactCommon"
12
12
  pod 'React-FabricComponents', :path => "#{react_native_path}/ReactCommon"
13
13
  pod 'React-graphics', :path => "#{react_native_path}/ReactCommon/react/renderer/graphics"
14
- pod 'React-RCTFabric', :path => "#{react_native_path}/React", :modular_headers => true
14
+ rncore_pod 'React-RCTFabric', :path => "#{react_native_path}/React", :modular_headers => true
15
15
  pod 'React-ImageManager', :path => "#{react_native_path}/ReactCommon/react/renderer/imagemanager/platform/ios"
16
16
  pod 'React-FabricImage', :path => "#{react_native_path}/ReactCommon"
17
17
  end