react-native 0.71.10 → 0.71.12

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.
@@ -1061,6 +1061,18 @@ const emptyFunctionThatReturnsTrue = () => true;
1061
1061
  *
1062
1062
  */
1063
1063
  function InternalTextInput(props: Props): React.Node {
1064
+ const {
1065
+ 'aria-busy': ariaBusy,
1066
+ 'aria-checked': ariaChecked,
1067
+ 'aria-disabled': ariaDisabled,
1068
+ 'aria-expanded': ariaExpanded,
1069
+ 'aria-selected': ariaSelected,
1070
+ accessibilityState,
1071
+ id,
1072
+ tabIndex,
1073
+ ...otherProps
1074
+ } = props;
1075
+
1064
1076
  const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
1065
1077
 
1066
1078
  // Android sends a "onTextChanged" event followed by a "onSelectionChanged" event, for
@@ -1381,13 +1393,25 @@ function InternalTextInput(props: Props): React.Node {
1381
1393
  // so omitting onBlur and onFocus pressability handlers here.
1382
1394
  const {onBlur, onFocus, ...eventHandlers} = usePressability(config) || {};
1383
1395
 
1384
- const _accessibilityState = {
1385
- busy: props['aria-busy'] ?? props.accessibilityState?.busy,
1386
- checked: props['aria-checked'] ?? props.accessibilityState?.checked,
1387
- disabled: props['aria-disabled'] ?? props.accessibilityState?.disabled,
1388
- expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
1389
- selected: props['aria-selected'] ?? props.accessibilityState?.selected,
1390
- };
1396
+ let _accessibilityState;
1397
+ if (
1398
+ accessibilityState != null ||
1399
+ ariaBusy != null ||
1400
+ ariaChecked != null ||
1401
+ ariaDisabled != null ||
1402
+ ariaExpanded != null ||
1403
+ ariaSelected != null
1404
+ ) {
1405
+ _accessibilityState = {
1406
+ busy: ariaBusy ?? accessibilityState?.busy,
1407
+ checked: ariaChecked ?? accessibilityState?.checked,
1408
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
1409
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
1410
+ selected: ariaSelected ?? accessibilityState?.selected,
1411
+ };
1412
+ }
1413
+
1414
+ let style = flattenStyle(props.style);
1391
1415
 
1392
1416
  if (Platform.OS === 'ios') {
1393
1417
  const RCTTextInputView =
@@ -1395,10 +1419,7 @@ function InternalTextInput(props: Props): React.Node {
1395
1419
  ? RCTMultilineTextInputView
1396
1420
  : RCTSinglelineTextInputView;
1397
1421
 
1398
- const style =
1399
- props.multiline === true
1400
- ? StyleSheet.flatten([styles.multilineInput, props.style])
1401
- : props.style;
1422
+ style = props.multiline === true ? [styles.multilineInput, style] : style;
1402
1423
 
1403
1424
  const useOnChangeSync =
1404
1425
  (props.unstable_onChangeSync || props.unstable_onChangeTextSync) &&
@@ -1407,15 +1428,16 @@ function InternalTextInput(props: Props): React.Node {
1407
1428
  textInput = (
1408
1429
  <RCTTextInputView
1409
1430
  ref={_setNativeRef}
1410
- {...props}
1431
+ {...otherProps}
1411
1432
  {...eventHandlers}
1412
- accessible={accessible}
1413
1433
  accessibilityState={_accessibilityState}
1434
+ accessible={accessible}
1414
1435
  submitBehavior={submitBehavior}
1415
1436
  caretHidden={caretHidden}
1416
1437
  dataDetectorTypes={props.dataDetectorTypes}
1417
- focusable={focusable}
1438
+ focusable={tabIndex !== undefined ? !tabIndex : focusable}
1418
1439
  mostRecentEventCount={mostRecentEventCount}
1440
+ nativeID={id ?? props.nativeID}
1419
1441
  onBlur={_onBlur}
1420
1442
  onKeyPressSync={props.unstable_onKeyPressSync}
1421
1443
  onChange={_onChange}
@@ -1431,7 +1453,6 @@ function InternalTextInput(props: Props): React.Node {
1431
1453
  />
1432
1454
  );
1433
1455
  } else if (Platform.OS === 'android') {
1434
- const style = [props.style];
1435
1456
  const autoCapitalize = props.autoCapitalize || 'sentences';
1436
1457
  const _accessibilityLabelledBy =
1437
1458
  props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy;
@@ -1457,18 +1478,19 @@ function InternalTextInput(props: Props): React.Node {
1457
1478
  * fixed */
1458
1479
  <AndroidTextInput
1459
1480
  ref={_setNativeRef}
1460
- {...props}
1481
+ {...otherProps}
1461
1482
  {...eventHandlers}
1462
- accessible={accessible}
1463
1483
  accessibilityState={_accessibilityState}
1464
1484
  accessibilityLabelledBy={_accessibilityLabelledBy}
1485
+ accessible={accessible}
1465
1486
  autoCapitalize={autoCapitalize}
1466
1487
  submitBehavior={submitBehavior}
1467
1488
  caretHidden={caretHidden}
1468
1489
  children={children}
1469
1490
  disableFullscreenUI={props.disableFullscreenUI}
1470
- focusable={focusable}
1491
+ focusable={tabIndex !== undefined ? !tabIndex : focusable}
1471
1492
  mostRecentEventCount={mostRecentEventCount}
1493
+ nativeID={id ?? props.nativeID}
1472
1494
  numberOfLines={props.rows ?? props.numberOfLines}
1473
1495
  onBlur={_onBlur}
1474
1496
  onChange={_onChange}
@@ -1598,11 +1620,12 @@ const ExportedForwardRef: React.AbstractComponent<
1598
1620
  React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
1599
1621
  >,
1600
1622
  ) {
1601
- const style = flattenStyle(restProps.style);
1623
+ let style = flattenStyle(restProps.style);
1602
1624
 
1603
1625
  if (style?.verticalAlign != null) {
1604
1626
  style.textAlignVertical =
1605
1627
  verticalAlignToTextAlignVerticalMap[style.verticalAlign];
1628
+ delete style.verticalAlign;
1606
1629
  }
1607
1630
 
1608
1631
  return (
@@ -1643,6 +1666,8 @@ const ExportedForwardRef: React.AbstractComponent<
1643
1666
  );
1644
1667
  });
1645
1668
 
1669
+ ExportedForwardRef.displayName = 'TextInput';
1670
+
1646
1671
  /**
1647
1672
  * Switch to `deprecated-react-native-prop-types` for compatibility with future
1648
1673
  * releases. This is deprecated and will be removed in the future.
@@ -57,7 +57,6 @@ const View: React.AbstractComponent<
57
57
  nativeID,
58
58
  pointerEvents,
59
59
  role,
60
- style,
61
60
  tabIndex,
62
61
  ...otherProps
63
62
  }: ViewProps,
@@ -66,23 +65,42 @@ const View: React.AbstractComponent<
66
65
  const _accessibilityLabelledBy =
67
66
  ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
68
67
 
69
- const _accessibilityState = {
70
- busy: ariaBusy ?? accessibilityState?.busy,
71
- checked: ariaChecked ?? accessibilityState?.checked,
72
- disabled: ariaDisabled ?? accessibilityState?.disabled,
73
- expanded: ariaExpanded ?? accessibilityState?.expanded,
74
- selected: ariaSelected ?? accessibilityState?.selected,
75
- };
68
+ let _accessibilityState;
69
+ if (
70
+ accessibilityState != null ||
71
+ ariaBusy != null ||
72
+ ariaChecked != null ||
73
+ ariaDisabled != null ||
74
+ ariaExpanded != null ||
75
+ ariaSelected != null
76
+ ) {
77
+ _accessibilityState = {
78
+ busy: ariaBusy ?? accessibilityState?.busy,
79
+ checked: ariaChecked ?? accessibilityState?.checked,
80
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
81
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
82
+ selected: ariaSelected ?? accessibilityState?.selected,
83
+ };
84
+ }
85
+ let _accessibilityValue;
86
+ if (
87
+ accessibilityValue != null ||
88
+ ariaValueMax != null ||
89
+ ariaValueMin != null ||
90
+ ariaValueNow != null ||
91
+ ariaValueText != null
92
+ ) {
93
+ _accessibilityValue = {
94
+ max: ariaValueMax ?? accessibilityValue?.max,
95
+ min: ariaValueMin ?? accessibilityValue?.min,
96
+ now: ariaValueNow ?? accessibilityValue?.now,
97
+ text: ariaValueText ?? accessibilityValue?.text,
98
+ };
99
+ }
76
100
 
77
- const _accessibilityValue = {
78
- max: ariaValueMax ?? accessibilityValue?.max,
79
- min: ariaValueMin ?? accessibilityValue?.min,
80
- now: ariaValueNow ?? accessibilityValue?.now,
81
- text: ariaValueText ?? accessibilityValue?.text,
82
- };
101
+ let style = flattenStyle(otherProps.style);
83
102
 
84
- const flattenedStyle = flattenStyle(style);
85
- const newPointerEvents = flattenedStyle?.pointerEvents || pointerEvents;
103
+ const newPointerEvents = style?.pointerEvents || pointerEvents;
86
104
 
87
105
  return (
88
106
  <TextAncestor.Provider value={false}>
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 10,
15
+ patch: 12,
16
16
  prerelease: null,
17
17
  };
@@ -158,13 +158,13 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
158
158
  const {width = props.width, height = props.height, uri} = source;
159
159
  style = flattenStyle([{width, height}, styles.base, props.style]);
160
160
  sources = [source];
161
-
162
161
  if (uri === '') {
163
162
  console.warn('source.uri should not be an empty string');
164
163
  }
165
164
  }
166
165
 
167
166
  const {height, width, ...restProps} = props;
167
+
168
168
  const {onLoadStart, onLoad, onLoadEnd, onError} = props;
169
169
  const nativeProps = {
170
170
  ...restProps,
@@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog';
14
14
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
15
15
  import UTFSequence from '../../UTFSequence';
16
16
  import stringifySafe from '../../Utilities/stringifySafe';
17
+ import ansiRegex from 'ansi-regex';
18
+
19
+ const ANSI_REGEX = ansiRegex().source;
17
20
 
18
21
  const BABEL_TRANSFORM_ERROR_FORMAT =
19
22
  /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/;
23
+
24
+ // https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184
25
+ const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp(
26
+ [
27
+ // Beginning of a line (per 'm' flag)
28
+ '^',
29
+ // Optional ANSI escapes for colors
30
+ `(?:${ANSI_REGEX})*`,
31
+ // Marker
32
+ '>',
33
+ // Optional ANSI escapes for colors
34
+ `(?:${ANSI_REGEX})*`,
35
+ // Left padding for line number
36
+ ' +',
37
+ // Line number
38
+ '[0-9]+',
39
+ // Gutter
40
+ ' \\|',
41
+ ].join(''),
42
+ 'm',
43
+ );
44
+
20
45
  const BABEL_CODE_FRAME_ERROR_FORMAT =
21
46
  // eslint-disable-next-line no-control-regex
22
47
  /^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u;
48
+
23
49
  const METRO_ERROR_FORMAT =
24
50
  /^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u;
25
51
 
@@ -241,27 +267,31 @@ export function parseLogBoxException(
241
267
  };
242
268
  }
243
269
 
244
- const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
270
+ // Perform a cheap match first before trying to parse the full message, which
271
+ // can get expensive for arbitrary input.
272
+ if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) {
273
+ const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
245
274
 
246
- if (babelCodeFrameError) {
247
- // Codeframe errors are thrown from any use of buildCodeFrameError.
248
- const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
249
- return {
250
- level: 'syntax',
251
- stack: [],
252
- isComponentError: false,
253
- componentStack: [],
254
- codeFrame: {
255
- fileName,
256
- location: null, // We are not given the location.
257
- content: codeFrame,
258
- },
259
- message: {
260
- content,
261
- substitutions: [],
262
- },
263
- category: `${fileName}-${1}-${1}`,
264
- };
275
+ if (babelCodeFrameError) {
276
+ // Codeframe errors are thrown from any use of buildCodeFrameError.
277
+ const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
278
+ return {
279
+ level: 'syntax',
280
+ stack: [],
281
+ isComponentError: false,
282
+ componentStack: [],
283
+ codeFrame: {
284
+ fileName,
285
+ location: null, // We are not given the location.
286
+ content: codeFrame,
287
+ },
288
+ message: {
289
+ content,
290
+ substitutions: [],
291
+ },
292
+ category: `${fileName}-${1}-${1}`,
293
+ };
294
+ }
265
295
  }
266
296
 
267
297
  if (message.match(/^TransformError /)) {
@@ -9,17 +9,16 @@
9
9
  */
10
10
 
11
11
  import type {PressEvent} from '../Types/CoreEventTypes';
12
+ import type {TextProps} from './TextProps';
12
13
 
13
14
  import * as PressabilityDebug from '../Pressability/PressabilityDebug';
14
15
  import usePressability from '../Pressability/usePressability';
15
16
  import flattenStyle from '../StyleSheet/flattenStyle';
16
17
  import processColor from '../StyleSheet/processColor';
17
- import StyleSheet from '../StyleSheet/StyleSheet';
18
18
  import {getAccessibilityRoleFromRole} from '../Utilities/AcessibilityMapping';
19
19
  import Platform from '../Utilities/Platform';
20
20
  import TextAncestor from './TextAncestor';
21
21
  import {NativeText, NativeVirtualText} from './TextNativeComponent';
22
- import {type TextProps} from './TextProps';
23
22
  import * as React from 'react';
24
23
  import {useContext, useMemo, useState} from 'react';
25
24
 
@@ -36,6 +35,7 @@ const Text: React.AbstractComponent<
36
35
  accessible,
37
36
  accessibilityLabel,
38
37
  accessibilityRole,
38
+ accessibilityState,
39
39
  allowFontScaling,
40
40
  'aria-busy': ariaBusy,
41
41
  'aria-checked': ariaChecked,
@@ -64,13 +64,23 @@ const Text: React.AbstractComponent<
64
64
 
65
65
  const [isHighlighted, setHighlighted] = useState(false);
66
66
 
67
- const _accessibilityState = {
68
- busy: ariaBusy ?? props.accessibilityState?.busy,
69
- checked: ariaChecked ?? props.accessibilityState?.checked,
70
- disabled: ariaDisabled ?? props.accessibilityState?.disabled,
71
- expanded: ariaExpanded ?? props.accessibilityState?.expanded,
72
- selected: ariaSelected ?? props.accessibilityState?.selected,
73
- };
67
+ let _accessibilityState;
68
+ if (
69
+ accessibilityState != null ||
70
+ ariaBusy != null ||
71
+ ariaChecked != null ||
72
+ ariaDisabled != null ||
73
+ ariaExpanded != null ||
74
+ ariaSelected != null
75
+ ) {
76
+ _accessibilityState = {
77
+ busy: ariaBusy ?? accessibilityState?.busy,
78
+ checked: ariaChecked ?? accessibilityState?.checked,
79
+ disabled: ariaDisabled ?? accessibilityState?.disabled,
80
+ expanded: ariaExpanded ?? accessibilityState?.expanded,
81
+ selected: ariaSelected ?? accessibilityState?.selected,
82
+ };
83
+ }
74
84
 
75
85
  const _disabled =
76
86
  restProps.disabled != null
@@ -174,25 +184,11 @@ const Text: React.AbstractComponent<
174
184
  ? null
175
185
  : processColor(restProps.selectionColor);
176
186
 
177
- let style = flattenStyle(restProps.style);
178
-
179
- let _selectable = restProps.selectable;
180
- if (style?.userSelect != null) {
181
- _selectable = userSelectToSelectableMap[style.userSelect];
182
- }
183
-
184
- if (style?.verticalAlign != null) {
185
- style = StyleSheet.compose(style, {
186
- textAlignVertical:
187
- verticalAlignToTextAlignVerticalMap[style.verticalAlign],
188
- });
189
- }
187
+ let style = restProps.style;
190
188
 
191
189
  if (__DEV__) {
192
190
  if (PressabilityDebug.isEnabled() && onPress != null) {
193
- style = StyleSheet.compose(restProps.style, {
194
- color: 'magenta',
195
- });
191
+ style = [restProps.style, {color: 'magenta'}];
196
192
  }
197
193
  }
198
194
 
@@ -211,10 +207,22 @@ const Text: React.AbstractComponent<
211
207
  default: accessible,
212
208
  });
213
209
 
214
- let flattenedStyle = flattenStyle(style);
210
+ style = flattenStyle(style);
211
+
212
+ if (typeof style?.fontWeight === 'number') {
213
+ style.fontWeight = style?.fontWeight.toString();
214
+ }
215
+
216
+ let _selectable = restProps.selectable;
217
+ if (style?.userSelect != null) {
218
+ _selectable = userSelectToSelectableMap[style.userSelect];
219
+ delete style.userSelect;
220
+ }
215
221
 
216
- if (typeof flattenedStyle?.fontWeight === 'number') {
217
- flattenedStyle.fontWeight = flattenedStyle?.fontWeight.toString();
222
+ if (style?.verticalAlign != null) {
223
+ style.textAlignVertical =
224
+ verticalAlignToTextAlignVerticalMap[style.verticalAlign];
225
+ delete style.verticalAlign;
218
226
  }
219
227
 
220
228
  const _hasOnPressOrOnLongPress =
@@ -223,46 +231,46 @@ const Text: React.AbstractComponent<
223
231
  return hasTextAncestor ? (
224
232
  <NativeVirtualText
225
233
  {...restProps}
226
- accessibilityState={_accessibilityState}
227
234
  {...eventHandlersForText}
228
235
  accessibilityLabel={ariaLabel ?? accessibilityLabel}
229
236
  accessibilityRole={
230
237
  role ? getAccessibilityRoleFromRole(role) : accessibilityRole
231
238
  }
239
+ accessibilityState={_accessibilityState}
232
240
  isHighlighted={isHighlighted}
233
241
  isPressable={isPressable}
234
- selectable={_selectable}
235
242
  nativeID={id ?? nativeID}
236
243
  numberOfLines={numberOfLines}
237
- selectionColor={selectionColor}
238
- style={flattenedStyle}
239
244
  ref={forwardedRef}
245
+ selectable={_selectable}
246
+ selectionColor={selectionColor}
247
+ style={style}
240
248
  />
241
249
  ) : (
242
250
  <TextAncestor.Provider value={true}>
243
251
  <NativeText
244
252
  {...restProps}
245
253
  {...eventHandlersForText}
246
- disabled={_disabled}
247
- selectable={_selectable}
254
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
255
+ accessibilityRole={
256
+ role ? getAccessibilityRoleFromRole(role) : accessibilityRole
257
+ }
258
+ accessibilityState={nativeTextAccessibilityState}
248
259
  accessible={
249
260
  accessible == null && Platform.OS === 'android'
250
261
  ? _hasOnPressOrOnLongPress
251
262
  : _accessible
252
263
  }
253
- accessibilityLabel={ariaLabel ?? accessibilityLabel}
254
- accessibilityState={nativeTextAccessibilityState}
255
- accessibilityRole={
256
- role ? getAccessibilityRoleFromRole(role) : accessibilityRole
257
- }
258
264
  allowFontScaling={allowFontScaling !== false}
265
+ disabled={_disabled}
259
266
  ellipsizeMode={ellipsizeMode ?? 'tail'}
260
267
  isHighlighted={isHighlighted}
261
268
  nativeID={id ?? nativeID}
262
269
  numberOfLines={numberOfLines}
263
- selectionColor={selectionColor}
264
- style={flattenedStyle}
265
270
  ref={forwardedRef}
271
+ selectable={_selectable}
272
+ selectionColor={selectionColor}
273
+ style={style}
266
274
  />
267
275
  </TextAncestor.Provider>
268
276
  );
@@ -312,7 +312,17 @@ static void attemptAsynchronousLoadOfBundleAtURL(
312
312
  return;
313
313
  }
314
314
 
315
- RCTSource *source = RCTSourceCreate(scriptURL, data, data.length);
315
+ // Prefer `Content-Location` as the canonical source URL, if given, or fall back to scriptURL.
316
+ NSURL *sourceURL = scriptURL;
317
+ NSString *contentLocationHeader = headers[@"Content-Location"];
318
+ if (contentLocationHeader) {
319
+ NSURL *contentLocationURL = [NSURL URLWithString:contentLocationHeader relativeToURL:scriptURL];
320
+ if (contentLocationURL) {
321
+ sourceURL = contentLocationURL;
322
+ }
323
+ }
324
+
325
+ RCTSource *source = RCTSourceCreate(sourceURL, data, data.length);
316
326
  parseHeaders(headers, source);
317
327
  onComplete(nil, source);
318
328
  }
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(10),
26
+ RCTVersionPatch: @(12),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -474,6 +474,7 @@ struct RCTInstanceCallback : public InstanceCallback {
474
474
  // Load the source asynchronously, then store it for later execution.
475
475
  dispatch_group_enter(prepareBridge);
476
476
  __block NSData *sourceCode;
477
+ __block NSURL *sourceURL = self.bundleURL;
477
478
 
478
479
  #if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
479
480
  {
@@ -489,6 +490,9 @@ struct RCTInstanceCallback : public InstanceCallback {
489
490
  }
490
491
 
491
492
  sourceCode = source.data;
493
+ if (source.url) {
494
+ sourceURL = source.url;
495
+ }
492
496
  dispatch_group_leave(prepareBridge);
493
497
  }
494
498
  onProgress:^(RCTLoadingProgress *progressData) {
@@ -503,7 +507,7 @@ struct RCTInstanceCallback : public InstanceCallback {
503
507
  dispatch_group_notify(prepareBridge, dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
504
508
  RCTCxxBridge *strongSelf = weakSelf;
505
509
  if (sourceCode && strongSelf.loading) {
506
- [strongSelf executeSourceCode:sourceCode sync:NO];
510
+ [strongSelf executeSourceCode:sourceCode withSourceURL:sourceURL sync:NO];
507
511
  }
508
512
  });
509
513
  RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
@@ -1049,7 +1053,7 @@ struct RCTInstanceCallback : public InstanceCallback {
1049
1053
  [_displayLink registerModuleForFrameUpdates:module withModuleData:moduleData];
1050
1054
  }
1051
1055
 
1052
- - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
1056
+ - (void)executeSourceCode:(NSData *)sourceCode withSourceURL:(NSURL *)url sync:(BOOL)sync
1053
1057
  {
1054
1058
  // This will get called from whatever thread was actually executing JS.
1055
1059
  dispatch_block_t completion = ^{
@@ -1074,12 +1078,13 @@ struct RCTInstanceCallback : public InstanceCallback {
1074
1078
  };
1075
1079
 
1076
1080
  if (sync) {
1077
- [self executeApplicationScriptSync:sourceCode url:self.bundleURL];
1081
+ [self executeApplicationScriptSync:sourceCode url:url];
1078
1082
  completion();
1079
1083
  } else {
1080
- [self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:completion];
1084
+ [self enqueueApplicationScript:sourceCode url:url onComplete:completion];
1081
1085
  }
1082
1086
 
1087
+ // Use the original request URL here - HMRClient uses this to derive the /hot URL and entry point.
1083
1088
  [self.devSettings setupHMRClientWithBundleURL:self.bundleURL];
1084
1089
  }
1085
1090
 
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.10
1
+ VERSION_NAME=0.71.12
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -14,6 +14,7 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
14
14
 
15
15
  import android.app.Activity;
16
16
  import android.content.Context;
17
+ import android.content.ContextWrapper;
17
18
  import android.graphics.Canvas;
18
19
  import android.graphics.Insets;
19
20
  import android.graphics.Point;
@@ -916,6 +917,14 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
916
917
  checkForDeviceDimensionsChanges();
917
918
  }
918
919
 
920
+ private Activity getActivity() {
921
+ Context context = getContext();
922
+ while (!(context instanceof Activity) && context instanceof ContextWrapper) {
923
+ context = ((ContextWrapper) context).getBaseContext();
924
+ }
925
+ return (Activity) context;
926
+ }
927
+
919
928
  @RequiresApi(api = Build.VERSION_CODES.R)
920
929
  private void checkForKeyboardEvents() {
921
930
  getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea);
@@ -933,7 +942,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
933
942
  Insets barInsets = rootInsets.getInsets(WindowInsets.Type.systemBars());
934
943
  int height = imeInsets.bottom - barInsets.bottom;
935
944
 
936
- int softInputMode = ((Activity) getContext()).getWindow().getAttributes().softInputMode;
945
+ int softInputMode = getActivity().getWindow().getAttributes().softInputMode;
937
946
  int screenY =
938
947
  softInputMode == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING
939
948
  ? mVisibleViewArea.bottom - height
@@ -7,9 +7,12 @@
7
7
 
8
8
  package com.facebook.react.animated;
9
9
 
10
+ import com.facebook.common.logging.FLog;
10
11
  import com.facebook.react.bridge.ReadableArray;
11
12
  import com.facebook.react.bridge.ReadableMap;
12
13
  import com.facebook.react.bridge.ReadableType;
14
+ import com.facebook.react.common.ReactConstants;
15
+ import com.facebook.react.common.build.ReactBuildConfig;
13
16
 
14
17
  /**
15
18
  * Implementation of {@link AnimationDriver} which provides a support for simple time-based
@@ -70,7 +73,17 @@ class FrameBasedAnimationDriver extends AnimationDriver {
70
73
  long timeFromStartMillis = (frameTimeNanos - mStartFrameTimeNanos) / 1000000;
71
74
  int frameIndex = (int) Math.round(timeFromStartMillis / FRAME_TIME_MILLIS);
72
75
  if (frameIndex < 0) {
73
- throw new IllegalStateException("Calculated frame index should never be lower than 0");
76
+ String message =
77
+ "Calculated frame index should never be lower than 0. Called with frameTimeNanos "
78
+ + frameTimeNanos
79
+ + " and mStartFrameTimeNanos "
80
+ + mStartFrameTimeNanos;
81
+ if (ReactBuildConfig.DEBUG) {
82
+ throw new IllegalStateException(message);
83
+ } else {
84
+ FLog.w(ReactConstants.TAG, message);
85
+ return;
86
+ }
74
87
  } else if (mHasFinished) {
75
88
  // nothing to do here
76
89
  return;
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 71,
20
- "patch", 10,
20
+ "patch", 12,
21
21
  "prerelease", null);
22
22
  }
@@ -791,7 +791,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
791
791
 
792
792
  /** Compute mInnerTopLeftCorner */
793
793
  mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
794
- mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2;
794
+ mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top;
795
795
 
796
796
  getEllipseIntersectionWithLine(
797
797
  // Ellipse Bounds
@@ -817,7 +817,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
817
817
  }
818
818
 
819
819
  mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
820
- mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
820
+ mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom;
821
821
 
822
822
  getEllipseIntersectionWithLine(
823
823
  // Ellipse Bounds
@@ -843,7 +843,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
843
843
  }
844
844
 
845
845
  mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right;
846
- mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2;
846
+ mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top;
847
847
 
848
848
  getEllipseIntersectionWithLine(
849
849
  // Ellipse Bounds
@@ -869,7 +869,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
869
869
  }
870
870
 
871
871
  mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right;
872
- mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
872
+ mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom;
873
873
 
874
874
  getEllipseIntersectionWithLine(
875
875
  // Ellipse Bounds
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 10;
20
+ int32_t Patch = 12;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @flow strict
3
+ * @format
4
+ */
5
+
6
+ declare module 'ansi-regex' {
7
+ declare export type Options = {
8
+ /**
9
+ * Match only the first ANSI escape.
10
+ */
11
+ +onlyFirst?: boolean,
12
+ };
13
+ declare export default function ansiRegex(options?: Options): RegExp;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.71.10",
3
+ "version": "0.71.12",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -110,14 +110,15 @@
110
110
  },
111
111
  "dependencies": {
112
112
  "@jest/create-cache-key-function": "^29.2.1",
113
- "@react-native-community/cli": "10.2.2",
113
+ "@react-native-community/cli": "10.2.4",
114
114
  "@react-native-community/cli-platform-android": "10.2.0",
115
- "@react-native-community/cli-platform-ios": "10.2.1",
115
+ "@react-native-community/cli-platform-ios": "10.2.4",
116
116
  "@react-native/assets": "1.0.0",
117
117
  "@react-native/normalize-color": "2.1.0",
118
118
  "@react-native/polyfills": "2.0.0",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
+ "ansi-regex": "^5.0.0",
121
122
  "base64-js": "^1.1.2",
122
123
  "deprecated-react-native-prop-types": "^3.0.1",
123
124
  "event-target-shim": "^5.0.1",
@@ -125,9 +126,9 @@
125
126
  "jest-environment-node": "^29.2.1",
126
127
  "jsc-android": "^250231.0.0",
127
128
  "memoize-one": "^5.0.0",
128
- "metro-react-native-babel-transformer": "0.73.9",
129
- "metro-runtime": "0.73.9",
130
- "metro-source-map": "0.73.9",
129
+ "metro-react-native-babel-transformer": "0.73.10",
130
+ "metro-runtime": "0.73.10",
131
+ "metro-source-map": "0.73.10",
131
132
  "mkdirp": "^0.5.1",
132
133
  "nullthrows": "^1.1.1",
133
134
  "pretty-format": "^26.5.2",
@@ -182,8 +183,8 @@
182
183
  "jest": "^29.2.1",
183
184
  "jest-junit": "^10.0.0",
184
185
  "jscodeshift": "^0.13.1",
185
- "metro-babel-register": "0.73.9",
186
- "metro-memory-fs": "0.73.9",
186
+ "metro-babel-register": "0.73.10",
187
+ "metro-memory-fs": "0.73.10",
187
188
  "mkdirp": "^0.5.1",
188
189
  "mock-fs": "^5.1.4",
189
190
  "prettier": "^2.4.1",
@@ -274,7 +274,7 @@ class CodegenUtils
274
274
  :config_key => config_key
275
275
  )
276
276
  react_codegen_spec = codegen_utils.get_react_codegen_spec(
277
- File.join(react_native_path, "package.json"),
277
+ File.join(relative_installation_root, react_native_path, "package.json"),
278
278
  :folly_version => folly_version,
279
279
  :fabric_enabled => fabric_enabled,
280
280
  :hermes_enabled => hermes_enabled,
@@ -131,6 +131,18 @@ class ReactNativePodsUtils
131
131
  end
132
132
  end
133
133
 
134
+ def self.apply_xcode_15_patch(installer)
135
+ installer.target_installation_results.pod_target_installation_results
136
+ .each do |pod_name, target_installation_result|
137
+ target_installation_result.native_target.build_configurations.each do |config|
138
+ # unary_function and binary_function are no longer provided in C++17 and newer standard modes as part of Xcode 15. They can be re-enabled with setting _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
139
+ # Ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Deprecations
140
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= '$(inherited) '
141
+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << '"_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION" '
142
+ end
143
+ end
144
+ end
145
+
134
146
  private
135
147
 
136
148
  def self.fix_library_search_path(config)
@@ -223,6 +223,7 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
223
223
  ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
224
224
  ReactNativePodsUtils.fix_library_search_paths(installer)
225
225
  ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
226
+ ReactNativePodsUtils.apply_xcode_15_patch(installer)
226
227
 
227
228
  NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
228
229
  is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
Binary file
Binary file
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.71.10"
14
+ "react-native": "0.71.12"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
@@ -25,7 +25,7 @@
25
25
  "babel-jest": "^29.2.1",
26
26
  "eslint": "^8.19.0",
27
27
  "jest": "^29.2.1",
28
- "metro-react-native-babel-preset": "0.73.9",
28
+ "metro-react-native-babel-preset": "0.73.10",
29
29
  "prettier": "^2.4.1",
30
30
  "react-test-renderer": "18.2.0",
31
31
  "typescript": "4.8.4"