@office-iss/react-native-win32 0.0.0-canary.280 → 0.0.0-canary.282

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 (41) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +24 -8
  4. package/Libraries/Animated/nodes/AnimatedAddition.js +1 -0
  5. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -0
  6. package/Libraries/Animated/nodes/AnimatedDivision.js +1 -0
  7. package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -0
  8. package/Libraries/Animated/nodes/AnimatedModulo.js +1 -0
  9. package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -0
  10. package/Libraries/Animated/nodes/AnimatedNode.js +0 -46
  11. package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
  12. package/Libraries/Animated/nodes/AnimatedProps.js +1 -0
  13. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -0
  14. package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -0
  15. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -0
  16. package/Libraries/Animated/nodes/AnimatedTransform.js +1 -0
  17. package/Libraries/Animated/nodes/AnimatedValue.js +45 -3
  18. package/Libraries/Animated/useAnimatedProps.js +0 -43
  19. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +4 -1
  20. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  21. package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
  22. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.win32.js +6 -0
  25. package/Libraries/Core/ReactNativeVersion.js +1 -1
  26. package/Libraries/Image/AssetSourceResolver.js +11 -0
  27. package/Libraries/Inspector/BorderBox.js +26 -14
  28. package/Libraries/Inspector/BoxInspector.js +60 -42
  29. package/Libraries/Inspector/ElementBox.js +55 -48
  30. package/Libraries/Inspector/StyleInspector.js +36 -30
  31. package/Libraries/ReactNative/UIManagerProperties.js +3 -1
  32. package/overrides.json +6 -6
  33. package/package.json +11 -11
  34. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -16
  35. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -4
  36. package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
  37. package/src/private/specs/modules/NativeCPUTime.js +24 -0
  38. package/src/private/specs/modules/NativeFantom.js +37 -0
  39. package/src/private/utilities/ensureInstance.js +21 -0
  40. package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -0
  41. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +14 -8
package/.flowconfig CHANGED
@@ -164,4 +164,4 @@ untyped-import
164
164
  untyped-type-import
165
165
 
166
166
  [version]
167
- ^0.257.1
167
+ ^0.258.1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Sat, 11 Jan 2025 06:28:50 GMT",
5
+ "date": "Fri, 07 Mar 2025 06:25:58 GMT",
6
+ "version": "0.0.0-canary.282",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.282",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "julio.rocha@microsoft.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "ca717fc9756cae188bfb5b8c637c0b7874edb8f3",
14
+ "comment": "Refactor WebSocket resource class"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 23 Jan 2025 06:24:57 GMT",
21
+ "version": "0.0.0-canary.281",
22
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.281",
23
+ "comments": {
24
+ "prerelease": [
25
+ {
26
+ "author": "yajurgrover24@gmail.com",
27
+ "package": "@office-iss/react-native-win32",
28
+ "commit": "89cd613955a195a4aa0b1851306ef4e715d609f7",
29
+ "comment": "Initial integrate"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Sat, 11 Jan 2025 06:30:39 GMT",
6
36
  "version": "0.0.0-canary.280",
7
37
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.280",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,21 +1,37 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- <!-- This log was last generated on Sat, 11 Jan 2025 06:28:50 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 07 Mar 2025 06:25:58 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.280
7
+ ## 0.0.0-canary.282
8
8
 
9
- Sat, 11 Jan 2025 06:28:50 GMT
9
+ Fri, 07 Mar 2025 06:25:58 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Integrate 12/31 (34109996+chiaramooney@users.noreply.github.com)
14
- - Bump @rnw-scripts/eslint-config to v1.2.32
15
- - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.36
16
- - Bump @rnw-scripts/just-task to v2.3.49
17
- - Bump react-native-platform-override to v1.9.51
13
+ - Refactor WebSocket resource class (julio.rocha@microsoft.com)
18
14
 
15
+ ## 0.0.0-canary.281
16
+
17
+ Thu, 23 Jan 2025 06:24:57 GMT
18
+
19
+ ### Changes
20
+
21
+ - Initial integrate (yajurgrover24@gmail.com)
22
+
23
+ ## 0.0.0-canary.280
24
+
25
+ Sat, 11 Jan 2025 06:30:39 GMT
26
+
27
+ ### Changes
28
+
29
+ - Integrate 12/31 (34109996+chiaramooney@users.noreply.github.com)
30
+ - Bump @rnw-scripts/eslint-config to v1.2.32
31
+ - Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.36
32
+ - Bump @rnw-scripts/just-task to v2.3.49
33
+ - Bump react-native-platform-override to v1.9.51
34
+
19
35
  ## 0.0.0-canary.279
20
36
 
21
37
  Fri, 10 Jan 2025 06:23:18 GMT
@@ -52,6 +52,7 @@ export default class AnimatedAddition extends AnimatedWithChildren {
52
52
  __attach(): void {
53
53
  this._a.__addChild(this);
54
54
  this._b.__addChild(this);
55
+ super.__attach();
55
56
  }
56
57
 
57
58
  __detach(): void {
@@ -60,6 +60,7 @@ export default class AnimatedDiffClamp extends AnimatedWithChildren {
60
60
 
61
61
  __attach(): void {
62
62
  this._a.__addChild(this);
63
+ super.__attach();
63
64
  }
64
65
 
65
66
  __detach(): void {
@@ -68,6 +68,7 @@ export default class AnimatedDivision extends AnimatedWithChildren {
68
68
  __attach(): void {
69
69
  this._a.__addChild(this);
70
70
  this._b.__addChild(this);
71
+ super.__attach();
71
72
  }
72
73
 
73
74
  __detach(): void {
@@ -376,6 +376,7 @@ export default class AnimatedInterpolation<
376
376
 
377
377
  __attach(): void {
378
378
  this._parent.__addChild(this);
379
+ super.__attach();
379
380
  }
380
381
 
381
382
  __detach(): void {
@@ -47,6 +47,7 @@ export default class AnimatedModulo extends AnimatedWithChildren {
47
47
 
48
48
  __attach(): void {
49
49
  this._a.__addChild(this);
50
+ super.__attach();
50
51
  }
51
52
 
52
53
  __detach(): void {
@@ -51,6 +51,7 @@ export default class AnimatedMultiplication extends AnimatedWithChildren {
51
51
  __attach(): void {
52
52
  this._a.__addChild(this);
53
53
  this._b.__addChild(this);
54
+ super.__attach();
54
55
  }
55
56
 
56
57
  __detach(): void {
@@ -8,15 +8,11 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
12
11
  import type {PlatformConfig} from '../AnimatedPlatformConfig';
13
12
 
14
13
  import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
15
14
  import invariant from 'invariant';
16
15
 
17
- const {startListeningToAnimatedNodeValue, stopListeningToAnimatedNodeValue} =
18
- NativeAnimatedHelper.API;
19
-
20
16
  type ValueListenerCallback = (state: {value: number, ...}) => mixed;
21
17
 
22
18
  export type AnimatedNodeConfig = $ReadOnly<{
@@ -33,7 +29,6 @@ let _assertNativeAnimatedModule: ?() => void = () => {
33
29
 
34
30
  export default class AnimatedNode {
35
31
  #listeners: Map<string, ValueListenerCallback> = new Map();
36
- #updateSubscription: ?EventSubscription = null;
37
32
 
38
33
  _platformConfig: ?PlatformConfig = undefined;
39
34
 
@@ -78,9 +73,6 @@ export default class AnimatedNode {
78
73
  );
79
74
 
80
75
  this._platformConfig = platformConfig;
81
- if (this.#listeners.size > 0) {
82
- this.#ensureUpdateSubscriptionExists();
83
- }
84
76
  }
85
77
 
86
78
  /**
@@ -93,9 +85,6 @@ export default class AnimatedNode {
93
85
  addListener(callback: (value: any) => mixed): string {
94
86
  const id = String(_uniqueId++);
95
87
  this.#listeners.set(id, callback);
96
- if (this.__isNative) {
97
- this.#ensureUpdateSubscriptionExists();
98
- }
99
88
  return id;
100
89
  }
101
90
 
@@ -107,9 +96,6 @@ export default class AnimatedNode {
107
96
  */
108
97
  removeListener(id: string): void {
109
98
  this.#listeners.delete(id);
110
- if (this.__isNative && this.#listeners.size === 0) {
111
- this.#updateSubscription?.remove();
112
- }
113
99
  }
114
100
 
115
101
  /**
@@ -119,44 +105,12 @@ export default class AnimatedNode {
119
105
  */
120
106
  removeAllListeners(): void {
121
107
  this.#listeners.clear();
122
- if (this.__isNative) {
123
- this.#updateSubscription?.remove();
124
- }
125
108
  }
126
109
 
127
110
  hasListeners(): boolean {
128
111
  return this.#listeners.size > 0;
129
112
  }
130
113
 
131
- #ensureUpdateSubscriptionExists(): void {
132
- if (this.#updateSubscription != null) {
133
- return;
134
- }
135
- const nativeTag = this.__getNativeTag();
136
- startListeningToAnimatedNodeValue(nativeTag);
137
- const subscription: EventSubscription =
138
- NativeAnimatedHelper.nativeEventEmitter.addListener(
139
- 'onAnimatedValueUpdate',
140
- data => {
141
- if (data.tag === nativeTag) {
142
- this.__onAnimatedValueUpdateReceived(data.value);
143
- }
144
- },
145
- );
146
-
147
- this.#updateSubscription = {
148
- remove: () => {
149
- // Only this function assigns to `this.#updateSubscription`.
150
- if (this.#updateSubscription == null) {
151
- return;
152
- }
153
- this.#updateSubscription = null;
154
- subscription.remove();
155
- stopListeningToAnimatedNodeValue(nativeTag);
156
- },
157
- };
158
- }
159
-
160
114
  __onAnimatedValueUpdateReceived(value: number): void {
161
115
  this.__callListeners(value);
162
116
  }
@@ -136,6 +136,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
136
136
  const node = nodes[ii];
137
137
  node.__addChild(this);
138
138
  }
139
+ super.__attach();
139
140
  }
140
141
 
141
142
  __detach(): void {
@@ -160,6 +160,7 @@ export default class AnimatedProps extends AnimatedNode {
160
160
  const node = nodes[ii];
161
161
  node.__addChild(this);
162
162
  }
163
+ super.__attach();
163
164
  }
164
165
 
165
166
  __detach(): void {
@@ -201,6 +201,7 @@ export default class AnimatedStyle extends AnimatedWithChildren {
201
201
  const node = nodes[ii];
202
202
  node.__addChild(this);
203
203
  }
204
+ super.__attach();
204
205
  }
205
206
 
206
207
  __detach(): void {
@@ -52,6 +52,7 @@ export default class AnimatedSubtraction extends AnimatedWithChildren {
52
52
  __attach(): void {
53
53
  this._a.__addChild(this);
54
54
  this._b.__addChild(this);
55
+ super.__attach();
55
56
  }
56
57
 
57
58
  __detach(): void {
@@ -67,6 +67,7 @@ export default class AnimatedTracking extends AnimatedNode {
67
67
  let {platformConfig} = this._animationConfig;
68
68
  this.__makeNative(platformConfig);
69
69
  }
70
+ super.__attach();
70
71
  }
71
72
 
72
73
  __detach(): void {
@@ -117,6 +117,7 @@ export default class AnimatedTransform extends AnimatedWithChildren {
117
117
  const node = nodes[ii];
118
118
  node.__addChild(this);
119
119
  }
120
+ super.__attach();
120
121
  }
121
122
 
122
123
  __detach(): void {
@@ -8,8 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- 'use strict';
12
-
11
+ import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
13
12
  import type Animation, {EndCallback} from '../animations/Animation';
14
13
  import type {InterpolationConfigType} from './AnimatedInterpolation';
15
14
  import type AnimatedNode from './AnimatedNode';
@@ -85,6 +84,8 @@ function _executeAsAnimatedBatch(id: string, operation: () => void) {
85
84
  * See https://reactnative.dev/docs/animatedvalue
86
85
  */
87
86
  export default class AnimatedValue extends AnimatedWithChildren {
87
+ #updateSubscription: ?EventSubscription = null;
88
+
88
89
  _value: number;
89
90
  _startingValue: number;
90
91
  _offset: number;
@@ -104,8 +105,20 @@ export default class AnimatedValue extends AnimatedWithChildren {
104
105
  }
105
106
  }
106
107
 
107
- __detach() {
108
+ __attach(): void {
108
109
  if (this.__isNative) {
110
+ // NOTE: In theory, we should only need to call this when any listeners
111
+ // are added. However, there is a global `onUserDrivenAnimationEnded`
112
+ // listener that relies on `onAnimatedValueUpdate` having fired to update
113
+ // the values in JavaScript. If that listener is removed, this could be
114
+ // re-optimized.
115
+ this.#ensureUpdateSubscriptionExists();
116
+ }
117
+ }
118
+
119
+ __detach(): void {
120
+ if (this.__isNative) {
121
+ this.#updateSubscription?.remove();
109
122
  NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {
110
123
  this._value = value - this._offset;
111
124
  });
@@ -118,6 +131,35 @@ export default class AnimatedValue extends AnimatedWithChildren {
118
131
  return this._value + this._offset;
119
132
  }
120
133
 
134
+ #ensureUpdateSubscriptionExists(): void {
135
+ if (this.#updateSubscription != null) {
136
+ return;
137
+ }
138
+ const nativeTag = this.__getNativeTag();
139
+ NativeAnimatedAPI.startListeningToAnimatedNodeValue(nativeTag);
140
+ const subscription: EventSubscription =
141
+ NativeAnimatedHelper.nativeEventEmitter.addListener(
142
+ 'onAnimatedValueUpdate',
143
+ data => {
144
+ if (data.tag === nativeTag) {
145
+ this.__onAnimatedValueUpdateReceived(data.value);
146
+ }
147
+ },
148
+ );
149
+
150
+ this.#updateSubscription = {
151
+ remove: () => {
152
+ // Only this function assigns to `this.#updateSubscription`.
153
+ if (this.#updateSubscription == null) {
154
+ return;
155
+ }
156
+ this.#updateSubscription = null;
157
+ subscription.remove();
158
+ NativeAnimatedAPI.stopListeningToAnimatedNodeValue(nativeTag);
159
+ },
160
+ };
161
+ }
162
+
121
163
  /**
122
164
  * Directly set the value. This will stop any animations running on the value
123
165
  * and update all the bound properties.
@@ -17,9 +17,7 @@ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNa
17
17
  import {isPublicInstance as isFabricPublicInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils';
18
18
  import useRefEffect from '../Utilities/useRefEffect';
19
19
  import {AnimatedEvent} from './AnimatedEvent';
20
- import AnimatedNode from './nodes/AnimatedNode';
21
20
  import AnimatedProps from './nodes/AnimatedProps';
22
- import AnimatedValue from './nodes/AnimatedValue';
23
21
  import {
24
22
  useCallback,
25
23
  useEffect,
@@ -39,11 +37,6 @@ type CallbackRef<T> = T => mixed;
39
37
 
40
38
  type UpdateCallback = () => void;
41
39
 
42
- type AnimatedValueListeners = Array<{
43
- propValue: AnimatedValue,
44
- listenerId: string,
45
- }>;
46
-
47
40
  const useMemoOrAnimatedPropsMemo =
48
41
  ReactNativeFeatureFlags.enableAnimatedPropsMemo()
49
42
  ? useAnimatedPropsMemo
@@ -169,7 +162,6 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
169
162
 
170
163
  const target = getEventTarget(instance);
171
164
  const events = [];
172
- const animatedValueListeners: AnimatedValueListeners = [];
173
165
 
174
166
  for (const propName in props) {
175
167
  // $FlowFixMe[invalid-computed-prop]
@@ -177,8 +169,6 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
177
169
  if (propValue instanceof AnimatedEvent && propValue.__isNative) {
178
170
  propValue.__attach(target, propName);
179
171
  events.push([propName, propValue]);
180
- // $FlowFixMe[incompatible-call] - the `addListenersToPropsValue` drills down the propValue.
181
- addListenersToPropsValue(propValue, animatedValueListeners);
182
172
  }
183
173
  }
184
174
 
@@ -188,10 +178,6 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
188
178
  for (const [propName, propValue] of events) {
189
179
  propValue.__detach(target, propName);
190
180
  }
191
-
192
- for (const {propValue, listenerId} of animatedValueListeners) {
193
- propValue.removeListener(listenerId);
194
- }
195
181
  };
196
182
  },
197
183
  [node, useNativePropsInFabric, props],
@@ -215,35 +201,6 @@ function reduceAnimatedProps<TProps>(
215
201
  };
216
202
  }
217
203
 
218
- function addListenersToPropsValue(
219
- propValue: AnimatedValue,
220
- accumulator: AnimatedValueListeners,
221
- ) {
222
- // propValue can be a scalar value, an array or an object.
223
- if (propValue instanceof AnimatedValue) {
224
- const listenerId = propValue.addListener(() => {});
225
- accumulator.push({propValue, listenerId});
226
- } else if (Array.isArray(propValue)) {
227
- // An array can be an array of scalar values, arrays of arrays, or arrays of objects
228
- for (const prop of propValue) {
229
- addListenersToPropsValue(prop, accumulator);
230
- }
231
- } else if (propValue instanceof Object) {
232
- addAnimatedValuesListenersToProps(propValue, accumulator);
233
- }
234
- }
235
-
236
- function addAnimatedValuesListenersToProps(
237
- props: AnimatedNode,
238
- accumulator: AnimatedValueListeners,
239
- ) {
240
- for (const propName in props) {
241
- // $FlowFixMe[prop-missing] - This is an object contained in a prop, but we don't know the exact type.
242
- const propValue = props[propName];
243
- addListenersToPropsValue(propValue, accumulator);
244
- }
245
- }
246
-
247
204
  /**
248
205
  * Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`
249
206
  * and `__detach`. However, this is more complicated because `AnimatedProps`
@@ -10,5 +10,8 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ // $FlowFixMe[cannot-resolve-module]
14
+ import typeof DrawerLayoutAndroid from './DrawerLayoutAndroid.android';
15
+
13
16
  module.exports =
14
- require('../UnimplementedViews/UnimplementedView') as $FlowFixMe;
17
+ require('../UnimplementedViews/UnimplementedView') as $FlowFixMe as DrawerLayoutAndroid;
@@ -162,6 +162,7 @@ const RCTTextInputViewConfig = {
162
162
  onChangeSync: true,
163
163
  onKeyPressSync: true,
164
164
  }),
165
+ disableKeyboardShortcuts: true,
165
166
  },
166
167
  };
167
168
 
@@ -136,6 +136,11 @@ export interface DocumentSelectionState extends EventEmitter {
136
136
  * @see https://reactnative.dev/docs/textinput#props
137
137
  */
138
138
  export interface TextInputIOSProps {
139
+ /**
140
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
141
+ */
142
+ disableKeyboardShortcuts?: boolean | undefined;
143
+
139
144
  /**
140
145
  * enum('never', 'while-editing', 'unless-editing', 'always')
141
146
  * When the clear button should appear on the right side of the text view
@@ -216,6 +216,12 @@ export type enterKeyHintType =
216
216
  type PasswordRules = string;
217
217
 
218
218
  type IOSProps = $ReadOnly<{|
219
+ /**
220
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
221
+ * @platform ios
222
+ */
223
+ disableKeyboardShortcuts?: ?boolean,
224
+
219
225
  /**
220
226
  * When the clear button should appear on the right side of the text view.
221
227
  * This property is supported only for single-line TextInput component.
@@ -260,6 +260,12 @@ export type enterKeyHintType =
260
260
  type PasswordRules = string;
261
261
 
262
262
  type IOSProps = $ReadOnly<{|
263
+ /**
264
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
265
+ * @platform ios
266
+ */
267
+ disableKeyboardShortcuts?: ?boolean,
268
+
263
269
  /**
264
270
  * When the clear button should appear on the right side of the text view.
265
271
  * This property is supported only for single-line TextInput component.
@@ -271,6 +271,12 @@ export type enterKeyHintType =
271
271
  type PasswordRules = string;
272
272
 
273
273
  type IOSProps = $ReadOnly<{|
274
+ /**
275
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
276
+ * @platform ios
277
+ */
278
+ disableKeyboardShortcuts?: ?boolean,
279
+
274
280
  /**
275
281
  * When the clear button should appear on the right side of the text view.
276
282
  * This property is supported only for single-line TextInput component.
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 78,
19
19
  patch: 0,
20
- prerelease: 'nightly-20241231-a3c8e2137',
20
+ prerelease: 'nightly-20250113-d4407d6f7',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -55,6 +55,17 @@ function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
55
55
 
56
56
  /**
57
57
  * Returns true if the asset can be loaded over the network.
58
+ *
59
+ * This prevents an issue loading XML assets on Android. XML asset types like
60
+ * vector drawables can only be loaded from precompiled source. Android does
61
+ * not support loading these over the network, and AAPT precompiles data by
62
+ * breaking path data and resource information apart into multiple files,
63
+ * stuffing it all into the resource table. As a result, we should only attempt
64
+ * to load resources as we would in release builds: by the resource name.
65
+ *
66
+ * For more information, see:
67
+ * https://issuetracker.google.com/issues/62435069
68
+ * https://issuetracker.google.com/issues/68293189
58
69
  */
59
70
  function assetSupportsNetworkLoads(asset: PackagerAsset): boolean {
60
71
  return !(asset.type === 'xml' && Platform.OS === 'android');
@@ -10,23 +10,35 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+
15
+ import React from 'react';
16
+
13
17
  const View = require('../Components/View/View');
14
- const React = require('react');
15
18
 
16
- class BorderBox extends React.Component<$FlowFixMeProps> {
17
- render(): $FlowFixMe | React.Node {
18
- const box = this.props.box;
19
- if (!box) {
20
- return this.props.children;
21
- }
22
- const style = {
23
- borderTopWidth: box.top,
24
- borderBottomWidth: box.bottom,
25
- borderLeftWidth: box.left,
26
- borderRightWidth: box.right,
27
- };
28
- return <View style={[style, this.props.style]}>{this.props.children}</View>;
19
+ type Props = $ReadOnly<{
20
+ children: React.Node,
21
+ box?: ?$ReadOnly<{
22
+ top: number,
23
+ right: number,
24
+ bottom: number,
25
+ left: number,
26
+ ...
27
+ }>,
28
+ style?: ViewStyleProp,
29
+ }>;
30
+
31
+ function BorderBox({children, box, style}: Props): React.Node {
32
+ if (!box) {
33
+ return children;
29
34
  }
35
+ const borderStyle = {
36
+ borderTopWidth: box.top,
37
+ borderBottomWidth: box.bottom,
38
+ borderLeftWidth: box.left,
39
+ borderRightWidth: box.right,
40
+ };
41
+ return <View style={[borderStyle, style]}>{children}</View>;
30
42
  }
31
43
 
32
44
  module.exports = BorderBox;