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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +59 -62
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +9 -9
- package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +8 -3
- package/scripts/react_native_pods.rb +15 -2
|
@@ -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.
|
|
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}` : ''}`;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -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.
|
|
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 =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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<
|
|
140
|
-
this.imagePipeline.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
162
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
165
|
+
override fun onFailureImpl(dataSource: DataSource<CloseableReference<PooledByteBuffer>>) {
|
|
166
|
+
promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
|
|
169
167
|
}
|
|
170
|
-
|
|
171
|
-
}
|
|
168
|
+
}
|
|
172
169
|
|
|
173
170
|
/**
|
|
174
171
|
* Prefetches the given image to the Fresco image disk cache.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.86.0-rc.
|
|
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.
|
|
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.
|
|
166
|
-
"@react-native/codegen": "0.86.0-rc.
|
|
167
|
-
"@react-native/community-cli-plugin": "0.86.0-rc.
|
|
168
|
-
"@react-native/gradle-plugin": "0.86.0-rc.
|
|
169
|
-
"@react-native/js-polyfills": "0.86.0-rc.
|
|
170
|
-
"@react-native/normalize-colors": "0.86.0-rc.
|
|
171
|
-
"@react-native/virtualized-lists": "0.86.0-rc.
|
|
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 ${
|
|
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 ${
|
|
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(
|
|
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
|
|
543
|
-
|
|
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')
|