react-native 0.86.0-rc.0 → 0.86.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.
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
29
29
  static major: number = 0;
30
30
  static minor: number = 86;
31
31
  static patch: number = 0;
32
- static prerelease: string | null = 'rc.0';
32
+ static prerelease: string | null = 'rc.1';
33
33
 
34
34
  static getVersionString(): string {
35
35
  return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(86),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.1",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.86.0-rc.0
1
+ VERSION_NAME=0.86.0-rc.1
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
  react.internal.hermesPublishingGroup=com.facebook.hermes
4
4
 
@@ -7,17 +7,20 @@
7
7
 
8
8
  package com.facebook.react.modules.image
9
9
 
10
+ import android.media.ExifInterface
10
11
  import android.net.Uri
11
12
  import android.util.SparseArray
12
13
  import com.facebook.common.executors.CallerThreadExecutor
14
+ import com.facebook.common.memory.PooledByteBuffer
13
15
  import com.facebook.common.references.CloseableReference
14
16
  import com.facebook.datasource.BaseDataSubscriber
15
17
  import com.facebook.datasource.DataSource
16
18
  import com.facebook.datasource.DataSubscriber
17
19
  import com.facebook.drawee.backends.pipeline.Fresco
18
20
  import com.facebook.fbreact.specs.NativeImageLoaderAndroidSpec
21
+ import com.facebook.imagepipeline.common.RotationOptions
19
22
  import com.facebook.imagepipeline.core.ImagePipeline
20
- import com.facebook.imagepipeline.image.CloseableImage
23
+ import com.facebook.imagepipeline.image.EncodedImage
21
24
  import com.facebook.imagepipeline.request.ImageRequest
22
25
  import com.facebook.imagepipeline.request.ImageRequestBuilder
23
26
  import com.facebook.react.bridge.GuardedAsyncTask
@@ -82,39 +85,13 @@ internal class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventL
82
85
  return
83
86
  }
84
87
  val source = ImageSource(reactApplicationContext, uriString)
85
- val request: ImageRequest = ImageRequestBuilder.newBuilderWithSource(source.uri).build()
86
- val dataSource: DataSource<CloseableReference<CloseableImage>> =
87
- this.imagePipeline.fetchDecodedImage(request, this.callerContext)
88
- val dataSubscriber: DataSubscriber<CloseableReference<CloseableImage>> =
89
- object : BaseDataSubscriber<CloseableReference<CloseableImage>>() {
90
- override fun onNewResultImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
91
- if (!dataSource.isFinished) {
92
- return
93
- }
94
- val ref = dataSource.result
95
- if (ref != null) {
96
- try {
97
- val image: CloseableImage = ref.get()
98
- val sizes = buildReadableMap {
99
- put("width", image.width)
100
- put("height", image.height)
101
- }
102
- promise.resolve(sizes)
103
- } catch (e: Exception) {
104
- promise.reject(ERROR_GET_SIZE_FAILURE, e)
105
- } finally {
106
- CloseableReference.closeSafely(ref)
107
- }
108
- } else {
109
- promise.reject(ERROR_GET_SIZE_FAILURE, "Failed to get the size of the image")
110
- }
111
- }
112
-
113
- override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
114
- promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
115
- }
116
- }
117
- dataSource.subscribe(dataSubscriber, CallerThreadExecutor.getInstance())
88
+ val request: ImageRequest =
89
+ ImageRequestBuilder.newBuilderWithSource(source.uri)
90
+ .setRotationOptions(RotationOptions.disableRotation())
91
+ .build()
92
+ val dataSource: DataSource<CloseableReference<PooledByteBuffer>> =
93
+ this.imagePipeline.fetchEncodedImage(request, this.callerContext)
94
+ dataSource.subscribe(createSizeSubscriber(promise), CallerThreadExecutor.getInstance())
118
95
  }
119
96
 
120
97
  /**
@@ -134,41 +111,61 @@ internal class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventL
134
111
  val source = ImageSource(reactApplicationContext, uriString)
135
112
  val imageRequestBuilder: ImageRequestBuilder =
136
113
  ImageRequestBuilder.newBuilderWithSource(source.uri)
114
+ .setRotationOptions(RotationOptions.disableRotation())
137
115
  val request: ImageRequest =
138
116
  ReactNetworkImageRequest.fromBuilderWithHeaders(imageRequestBuilder, headers)
139
- val dataSource: DataSource<CloseableReference<CloseableImage>> =
140
- this.imagePipeline.fetchDecodedImage(request, this.callerContext)
141
- val dataSubscriber: DataSubscriber<CloseableReference<CloseableImage>> =
142
- object : BaseDataSubscriber<CloseableReference<CloseableImage>>() {
143
- override fun onNewResultImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
144
- if (!dataSource.isFinished) {
145
- return
146
- }
147
- val ref = dataSource.result
148
- if (ref != null) {
149
- try {
150
- val image: CloseableImage = ref.get()
151
- val sizes = buildReadableMap {
152
- put("width", image.width)
153
- put("height", image.height)
154
- }
155
- promise.resolve(sizes)
156
- } catch (e: Exception) {
157
- promise.reject(ERROR_GET_SIZE_FAILURE, e)
158
- } finally {
159
- CloseableReference.closeSafely(ref)
117
+ val dataSource: DataSource<CloseableReference<PooledByteBuffer>> =
118
+ this.imagePipeline.fetchEncodedImage(request, this.callerContext)
119
+ dataSource.subscribe(createSizeSubscriber(promise), CallerThreadExecutor.getInstance())
120
+ }
121
+
122
+ private fun createSizeSubscriber(
123
+ promise: Promise
124
+ ): DataSubscriber<CloseableReference<PooledByteBuffer>> =
125
+ object : BaseDataSubscriber<CloseableReference<PooledByteBuffer>>() {
126
+ override fun onNewResultImpl(dataSource: DataSource<CloseableReference<PooledByteBuffer>>) {
127
+ if (!dataSource.isFinished) {
128
+ return
129
+ }
130
+ val ref = dataSource.result
131
+ if (ref != null) {
132
+ var encodedImage: EncodedImage? = null
133
+ try {
134
+ encodedImage = EncodedImage(ref)
135
+ // Swap width and height when the image's EXIF orientation swaps the X/Y axes
136
+ // (90°/270° rotations, or transpose/transverse), so the values reflect the
137
+ // visible dimensions, matching iOS behavior.
138
+ val rotated =
139
+ encodedImage.rotationAngle == 90 ||
140
+ encodedImage.rotationAngle == 270 ||
141
+ encodedImage.exifOrientation == ExifInterface.ORIENTATION_TRANSPOSE ||
142
+ encodedImage.exifOrientation == ExifInterface.ORIENTATION_TRANSVERSE
143
+ val width = if (rotated) encodedImage.height else encodedImage.width
144
+ val height = if (rotated) encodedImage.width else encodedImage.height
145
+ if (width < 0 || height < 0) {
146
+ promise.reject(ERROR_GET_SIZE_FAILURE, "Failed to get the size of the image")
147
+ return
148
+ }
149
+ val sizes = buildReadableMap {
150
+ put("width", width)
151
+ put("height", height)
160
152
  }
161
- } else {
162
- promise.reject(ERROR_GET_SIZE_FAILURE, "Failed to get the size of the image")
153
+ promise.resolve(sizes)
154
+ } catch (e: Exception) {
155
+ promise.reject(ERROR_GET_SIZE_FAILURE, e)
156
+ } finally {
157
+ encodedImage?.close()
158
+ CloseableReference.closeSafely(ref)
163
159
  }
160
+ } else {
161
+ promise.reject(ERROR_GET_SIZE_FAILURE, "Failed to get the size of the image")
164
162
  }
163
+ }
165
164
 
166
- override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
167
- promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
168
- }
165
+ override fun onFailureImpl(dataSource: DataSource<CloseableReference<PooledByteBuffer>>) {
166
+ promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
169
167
  }
170
- dataSource.subscribe(dataSubscriber, CallerThreadExecutor.getInstance())
171
- }
168
+ }
172
169
 
173
170
  /**
174
171
  * Prefetches the given image to the Fresco image disk cache.
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 86,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.0"
18
+ "prerelease" to "rc.1"
19
19
  )
20
20
  }
@@ -22,7 +22,7 @@ struct ReactNativeVersionType {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 86;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "rc.0";
25
+ std::string_view Prerelease = "rc.1";
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.86.0-rc.0",
3
+ "version": "0.86.0-rc.1",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -149,7 +149,7 @@
149
149
  "featureflags": "node ./scripts/featureflags/index.js"
150
150
  },
151
151
  "peerDependencies": {
152
- "@react-native/jest-preset": "0.86.0-rc.0",
152
+ "@react-native/jest-preset": "0.86.0-rc.1",
153
153
  "@types/react": "^19.1.1",
154
154
  "react": "^19.2.3"
155
155
  },
@@ -162,13 +162,13 @@
162
162
  }
163
163
  },
164
164
  "dependencies": {
165
- "@react-native/assets-registry": "0.86.0-rc.0",
166
- "@react-native/codegen": "0.86.0-rc.0",
167
- "@react-native/community-cli-plugin": "0.86.0-rc.0",
168
- "@react-native/gradle-plugin": "0.86.0-rc.0",
169
- "@react-native/js-polyfills": "0.86.0-rc.0",
170
- "@react-native/normalize-colors": "0.86.0-rc.0",
171
- "@react-native/virtualized-lists": "0.86.0-rc.0",
165
+ "@react-native/assets-registry": "0.86.0-rc.1",
166
+ "@react-native/codegen": "0.86.0-rc.1",
167
+ "@react-native/community-cli-plugin": "0.86.0-rc.1",
168
+ "@react-native/gradle-plugin": "0.86.0-rc.1",
169
+ "@react-native/js-polyfills": "0.86.0-rc.1",
170
+ "@react-native/normalize-colors": "0.86.0-rc.1",
171
+ "@react-native/virtualized-lists": "0.86.0-rc.1",
172
172
  "abort-controller": "^3.0.0",
173
173
  "anser": "^1.4.9",
174
174
  "ansi-regex": "^5.0.0",
@@ -49,8 +49,13 @@ function getInputFiles(appPath /*: string */, appPkgJson /*: $FlowFixMe */) {
49
49
  return '[]';
50
50
  }
51
51
 
52
+ // Normalize appPath so any "Pods/.." segment is collapsed before find runs.
53
+ // Otherwise every find result inherits the search-root prefix containing
54
+ // "/Pods/" and gets dropped by the exclusion filter below.
55
+ const resolvedAppPath = path.resolve(appPath);
56
+
52
57
  const xcodeproj = String(
53
- execSync(`find ${appPath} -type d -name "*.xcodeproj"`),
58
+ execSync(`find ${resolvedAppPath} -type d -name "*.xcodeproj"`),
54
59
  )
55
60
  .trim()
56
61
  .split('\n')
@@ -61,12 +66,12 @@ function getInputFiles(appPath /*: string */, appPkgJson /*: $FlowFixMe */) {
61
66
  )[0];
62
67
  if (!xcodeproj) {
63
68
  throw new Error(
64
- `Cannot find .xcodeproj file inside ${appPath}. This is required to determine codegen spec paths relative to native project.`,
69
+ `Cannot find .xcodeproj file inside ${resolvedAppPath}. This is required to determine codegen spec paths relative to native project.`,
65
70
  );
66
71
  }
67
72
  const jsFiles = '-name "Native*.js" -or -name "*NativeComponent.js"';
68
73
  const tsFiles = '-name "Native*.ts" -or -name "*NativeComponent.ts"';
69
- const findCommand = `find ${path.join(appPath, jsSrcsDir)} -type f -not -path "*/__mocks__/*" -and \\( ${jsFiles} -or ${tsFiles} \\)`;
74
+ const findCommand = `find ${path.join(resolvedAppPath, jsSrcsDir)} -type f -not -path "*/__mocks__/*" -and \\( ${jsFiles} -or ${tsFiles} \\)`;
70
75
  const list = String(execSync(findCommand))
71
76
  .trim()
72
77
  .split('\n')
@@ -539,8 +539,21 @@ def react_native_post_install(
539
539
  rn_relative_to_pods = rn_real.relative_path_from(pods_dir_real)
540
540
  ReactNativePodsUtils.set_build_setting(installer, build_setting: "REACT_NATIVE_PATH", value: File.join("${PODS_ROOT}", rn_relative_to_pods.to_s))
541
541
  # Store the Podfile directory as a build setting so that shell scripts can
542
- # locate it without relying on PODS_ROOT/.. (breaks when Pods/ is a symlink).
543
- ReactNativePodsUtils.set_build_setting(installer, build_setting: "PODFILE_DIR", value: Pod::Config.instance.installation_root.to_s)
542
+ # locate it without hardcoding an absolute path. Use Xcode variable
543
+ # substitution per-project so the value persisted in project.pbxproj is
544
+ # portable across machines: $(SRCROOT) is the Podfile dir for user projects
545
+ # (also avoids the PODS_ROOT/.. traversal that breaks when Pods/ is a
546
+ # symlink), and $(SRCROOT)/.. for the Pods project.
547
+ installer.aggregate_targets.map(&:user_project).uniq(&:path).each do |user_project|
548
+ user_project.build_configurations.each do |config|
549
+ config.build_settings['PODFILE_DIR'] = '$(SRCROOT)'
550
+ end
551
+ user_project.save
552
+ end
553
+ installer.pods_project.build_configurations.each do |config|
554
+ config.build_settings['PODFILE_DIR'] = '$(SRCROOT)/..'
555
+ end
556
+ installer.pods_project.save
544
557
  ReactNativePodsUtils.set_build_setting(installer, build_setting: "SWIFT_ACTIVE_COMPILATION_CONDITIONS", value: ['$(inherited)', 'DEBUG'], config_name: "Debug")
545
558
 
546
559
  if (ENV['RCT_REMOVE_LEGACY_ARCH'] == '1')