react-native 0.72.0-rc.2 → 0.72.0-rc.4
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/AppDelegate/RCTAppDelegate.h +5 -0
- package/Libraries/AppDelegate/RCTAppDelegate.mm +30 -9
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +8 -2
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +25 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +16 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +121 -86
- package/Libraries/Components/TextInput/TextInput.flow.js +121 -135
- package/Libraries/Components/TextInput/TextInput.js +121 -135
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +0 -2
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -13
- package/React/Base/RCTJavaScriptLoader.mm +11 -1
- package/React/Base/RCTRuntimeExecutorFromBridge.h +19 -0
- package/React/Base/RCTRuntimeExecutorFromBridge.mm +56 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/CxxBridge/RCTCxxBridge.mm +9 -4
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +12 -1
- package/React/Fabric/RCTSurfacePresenter.mm +4 -0
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +0 -3
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +1 -37
- package/React/React-RCTFabric.podspec +14 -1
- package/React-Core.podspec +6 -4
- package/ReactAndroid/build.gradle +4 -1
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +14 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +9 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +0 -1
- package/ReactCommon/React-Fabric.podspec +13 -23
- package/ReactCommon/ReactCommon.podspec +0 -4
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/debug/React-debug.podspec +36 -0
- package/ReactCommon/react/renderer/core/CoreFeatures.cpp +1 -0
- package/ReactCommon/react/renderer/core/CoreFeatures.h +4 -0
- package/ReactCommon/react/renderer/imagemanager/ImageRequest.h +7 -3
- package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp +0 -11
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +5 -0
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequest.cpp +4 -14
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +66 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +3 -15
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +57 -0
- package/package.json +10 -10
- package/scripts/cocoapods/__tests__/codegen_utils-test.rb +7 -2
- package/scripts/cocoapods/__tests__/flipper-test.rb +9 -1
- package/scripts/cocoapods/__tests__/new_architecture-test.rb +9 -3
- package/scripts/cocoapods/__tests__/utils-test.rb +0 -68
- package/scripts/cocoapods/codegen_utils.rb +6 -0
- package/scripts/cocoapods/flipper.rb +2 -2
- package/scripts/cocoapods/new_architecture.rb +13 -0
- package/scripts/cocoapods/utils.rb +0 -7
- package/scripts/react-native-xcode.sh +1 -1
- package/scripts/react_native_pods.rb +6 -6
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/android/app/build.gradle +0 -7
- package/template/ios/Podfile +1 -1
- package/template/package.json +6 -6
- package/types/experimental.d.ts +101 -0
|
@@ -234,36 +234,6 @@ export type enterKeyHintType =
|
|
|
234
234
|
type PasswordRules = string;
|
|
235
235
|
|
|
236
236
|
type IOSProps = $ReadOnly<{|
|
|
237
|
-
/**
|
|
238
|
-
* Give the keyboard and the system information about the
|
|
239
|
-
* expected semantic meaning for the content that users enter.
|
|
240
|
-
* @platform ios
|
|
241
|
-
*/
|
|
242
|
-
autoComplete?: ?(
|
|
243
|
-
| 'address-line1'
|
|
244
|
-
| 'address-line2'
|
|
245
|
-
| 'cc-number'
|
|
246
|
-
| 'current-password'
|
|
247
|
-
| 'country'
|
|
248
|
-
| 'email'
|
|
249
|
-
| 'name'
|
|
250
|
-
| 'additional-name'
|
|
251
|
-
| 'family-name'
|
|
252
|
-
| 'given-name'
|
|
253
|
-
| 'nickname'
|
|
254
|
-
| 'honorific-prefix'
|
|
255
|
-
| 'honorific-suffix'
|
|
256
|
-
| 'new-password'
|
|
257
|
-
| 'off'
|
|
258
|
-
| 'one-time-code'
|
|
259
|
-
| 'organization'
|
|
260
|
-
| 'organization-title'
|
|
261
|
-
| 'postal-code'
|
|
262
|
-
| 'street-address'
|
|
263
|
-
| 'tel'
|
|
264
|
-
| 'url'
|
|
265
|
-
| 'username'
|
|
266
|
-
),
|
|
267
237
|
/**
|
|
268
238
|
* When the clear button should appear on the right side of the text view.
|
|
269
239
|
* This property is supported only for single-line TextInput component.
|
|
@@ -369,111 +339,6 @@ type IOSProps = $ReadOnly<{|
|
|
|
369
339
|
|}>;
|
|
370
340
|
|
|
371
341
|
type AndroidProps = $ReadOnly<{|
|
|
372
|
-
/**
|
|
373
|
-
* Specifies autocomplete hints for the system, so it can provide autofill. On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content.
|
|
374
|
-
* To disable autocomplete, set `autoComplete` to `off`.
|
|
375
|
-
*
|
|
376
|
-
* *Android Only*
|
|
377
|
-
*
|
|
378
|
-
* Possible values for `autoComplete` are:
|
|
379
|
-
*
|
|
380
|
-
* - `birthdate-day`
|
|
381
|
-
* - `birthdate-full`
|
|
382
|
-
* - `birthdate-month`
|
|
383
|
-
* - `birthdate-year`
|
|
384
|
-
* - `cc-csc`
|
|
385
|
-
* - `cc-exp`
|
|
386
|
-
* - `cc-exp-day`
|
|
387
|
-
* - `cc-exp-month`
|
|
388
|
-
* - `cc-exp-year`
|
|
389
|
-
* - `cc-number`
|
|
390
|
-
* - `email`
|
|
391
|
-
* - `gender`
|
|
392
|
-
* - `name`
|
|
393
|
-
* - `name-family`
|
|
394
|
-
* - `name-given`
|
|
395
|
-
* - `name-middle`
|
|
396
|
-
* - `name-middle-initial`
|
|
397
|
-
* - `name-prefix`
|
|
398
|
-
* - `name-suffix`
|
|
399
|
-
* - `password`
|
|
400
|
-
* - `password-new`
|
|
401
|
-
* - `postal-address`
|
|
402
|
-
* - `postal-address-country`
|
|
403
|
-
* - `postal-address-extended`
|
|
404
|
-
* - `postal-address-extended-postal-code`
|
|
405
|
-
* - `postal-address-locality`
|
|
406
|
-
* - `postal-address-region`
|
|
407
|
-
* - `postal-code`
|
|
408
|
-
* - `street-address`
|
|
409
|
-
* - `sms-otp`
|
|
410
|
-
* - `tel`
|
|
411
|
-
* - `tel-country-code`
|
|
412
|
-
* - `tel-national`
|
|
413
|
-
* - `tel-device`
|
|
414
|
-
* - `username`
|
|
415
|
-
* - `username-new`
|
|
416
|
-
* - `off`
|
|
417
|
-
*
|
|
418
|
-
* @platform android
|
|
419
|
-
*/
|
|
420
|
-
autoComplete?: ?(
|
|
421
|
-
| 'birthdate-day'
|
|
422
|
-
| 'birthdate-full'
|
|
423
|
-
| 'birthdate-month'
|
|
424
|
-
| 'birthdate-year'
|
|
425
|
-
| 'cc-csc'
|
|
426
|
-
| 'cc-exp'
|
|
427
|
-
| 'cc-exp-day'
|
|
428
|
-
| 'cc-exp-month'
|
|
429
|
-
| 'cc-exp-year'
|
|
430
|
-
| 'cc-number'
|
|
431
|
-
| 'email'
|
|
432
|
-
| 'gender'
|
|
433
|
-
| 'name'
|
|
434
|
-
| 'name-family'
|
|
435
|
-
| 'name-given'
|
|
436
|
-
| 'name-middle'
|
|
437
|
-
| 'name-middle-initial'
|
|
438
|
-
| 'name-prefix'
|
|
439
|
-
| 'name-suffix'
|
|
440
|
-
| 'password'
|
|
441
|
-
| 'password-new'
|
|
442
|
-
| 'postal-address'
|
|
443
|
-
| 'postal-address-country'
|
|
444
|
-
| 'postal-address-extended'
|
|
445
|
-
| 'postal-address-extended-postal-code'
|
|
446
|
-
| 'postal-address-locality'
|
|
447
|
-
| 'postal-address-region'
|
|
448
|
-
| 'postal-code'
|
|
449
|
-
| 'street-address'
|
|
450
|
-
| 'sms-otp'
|
|
451
|
-
| 'tel'
|
|
452
|
-
| 'tel-country-code'
|
|
453
|
-
| 'tel-national'
|
|
454
|
-
| 'tel-device'
|
|
455
|
-
| 'username'
|
|
456
|
-
| 'username-new'
|
|
457
|
-
| 'off'
|
|
458
|
-
// additional HTML autocomplete values
|
|
459
|
-
| 'address-line1'
|
|
460
|
-
| 'address-line2'
|
|
461
|
-
| 'bday'
|
|
462
|
-
| 'bday-day'
|
|
463
|
-
| 'bday-month'
|
|
464
|
-
| 'bday-year'
|
|
465
|
-
| 'country'
|
|
466
|
-
| 'current-password'
|
|
467
|
-
| 'honorific-prefix'
|
|
468
|
-
| 'honorific-suffix'
|
|
469
|
-
| 'additional-name'
|
|
470
|
-
| 'family-name'
|
|
471
|
-
| 'given-name'
|
|
472
|
-
| 'new-password'
|
|
473
|
-
| 'one-time-code'
|
|
474
|
-
| 'sex'
|
|
475
|
-
),
|
|
476
|
-
|
|
477
342
|
/**
|
|
478
343
|
* When provided it will set the color of the cursor (or "caret") in the component.
|
|
479
344
|
* Unlike the behavior of `selectionColor` the cursor color will be set independently
|
|
@@ -574,6 +439,127 @@ export type Props = $ReadOnly<{|
|
|
|
574
439
|
*/
|
|
575
440
|
autoCapitalize?: ?AutoCapitalize,
|
|
576
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Specifies autocomplete hints for the system, so it can provide autofill.
|
|
444
|
+
* On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content.
|
|
445
|
+
* To disable autocomplete, set autoComplete to off.
|
|
446
|
+
*
|
|
447
|
+
* The following values work across platforms:
|
|
448
|
+
*
|
|
449
|
+
* - `additional-name`
|
|
450
|
+
* - `address-line1`
|
|
451
|
+
* - `address-line2`
|
|
452
|
+
* - `cc-number`
|
|
453
|
+
* - `country`
|
|
454
|
+
* - `current-password`
|
|
455
|
+
* - `email`
|
|
456
|
+
* - `family-name`
|
|
457
|
+
* - `given-name`
|
|
458
|
+
* - `honorific-prefix`
|
|
459
|
+
* - `honorific-suffix`
|
|
460
|
+
* - `name`
|
|
461
|
+
* - `new-password`
|
|
462
|
+
* - `off`
|
|
463
|
+
* - `one-time-code`
|
|
464
|
+
* - `postal-code`
|
|
465
|
+
* - `street-address`
|
|
466
|
+
* - `tel`
|
|
467
|
+
* - `username`
|
|
468
|
+
*
|
|
469
|
+
* The following values work on iOS only:
|
|
470
|
+
*
|
|
471
|
+
* - `nickname`
|
|
472
|
+
* - `organization`
|
|
473
|
+
* - `organization-title`
|
|
474
|
+
* - `url`
|
|
475
|
+
*
|
|
476
|
+
* The following values work on Android only:
|
|
477
|
+
*
|
|
478
|
+
* - `birthdate-day`
|
|
479
|
+
* - `birthdate-full`
|
|
480
|
+
* - `birthdate-month`
|
|
481
|
+
* - `birthdate-year`
|
|
482
|
+
* - `cc-csc`
|
|
483
|
+
* - `cc-exp`
|
|
484
|
+
* - `cc-exp-day`
|
|
485
|
+
* - `cc-exp-month`
|
|
486
|
+
* - `cc-exp-year`
|
|
487
|
+
* - `gender`
|
|
488
|
+
* - `name-family`
|
|
489
|
+
* - `name-given`
|
|
490
|
+
* - `name-middle`
|
|
491
|
+
* - `name-middle-initial`
|
|
492
|
+
* - `name-prefix`
|
|
493
|
+
* - `name-suffix`
|
|
494
|
+
* - `password`
|
|
495
|
+
* - `password-new`
|
|
496
|
+
* - `postal-address`
|
|
497
|
+
* - `postal-address-country`
|
|
498
|
+
* - `postal-address-extended`
|
|
499
|
+
* - `postal-address-extended-postal-code`
|
|
500
|
+
* - `postal-address-locality`
|
|
501
|
+
* - `postal-address-region`
|
|
502
|
+
* - `sms-otp`
|
|
503
|
+
* - `tel-country-code`
|
|
504
|
+
* - `tel-national`
|
|
505
|
+
* - `tel-device`
|
|
506
|
+
* - `username-new`
|
|
507
|
+
*/
|
|
508
|
+
autoComplete?: ?(
|
|
509
|
+
| 'additional-name'
|
|
510
|
+
| 'address-line1'
|
|
511
|
+
| 'address-line2'
|
|
512
|
+
| 'birthdate-day'
|
|
513
|
+
| 'birthdate-full'
|
|
514
|
+
| 'birthdate-month'
|
|
515
|
+
| 'birthdate-year'
|
|
516
|
+
| 'cc-csc'
|
|
517
|
+
| 'cc-exp'
|
|
518
|
+
| 'cc-exp-day'
|
|
519
|
+
| 'cc-exp-month'
|
|
520
|
+
| 'cc-exp-year'
|
|
521
|
+
| 'cc-number'
|
|
522
|
+
| 'country'
|
|
523
|
+
| 'current-password'
|
|
524
|
+
| 'email'
|
|
525
|
+
| 'family-name'
|
|
526
|
+
| 'gender'
|
|
527
|
+
| 'given-name'
|
|
528
|
+
| 'honorific-prefix'
|
|
529
|
+
| 'honorific-suffix'
|
|
530
|
+
| 'name'
|
|
531
|
+
| 'name-family'
|
|
532
|
+
| 'name-given'
|
|
533
|
+
| 'name-middle'
|
|
534
|
+
| 'name-middle-initial'
|
|
535
|
+
| 'name-prefix'
|
|
536
|
+
| 'name-suffix'
|
|
537
|
+
| 'new-password'
|
|
538
|
+
| 'nickname'
|
|
539
|
+
| 'one-time-code'
|
|
540
|
+
| 'organization'
|
|
541
|
+
| 'organization-title'
|
|
542
|
+
| 'password'
|
|
543
|
+
| 'password-new'
|
|
544
|
+
| 'postal-address'
|
|
545
|
+
| 'postal-address-country'
|
|
546
|
+
| 'postal-address-extended'
|
|
547
|
+
| 'postal-address-extended-postal-code'
|
|
548
|
+
| 'postal-address-locality'
|
|
549
|
+
| 'postal-address-region'
|
|
550
|
+
| 'postal-code'
|
|
551
|
+
| 'street-address'
|
|
552
|
+
| 'sms-otp'
|
|
553
|
+
| 'tel'
|
|
554
|
+
| 'tel-country-code'
|
|
555
|
+
| 'tel-national'
|
|
556
|
+
| 'tel-device'
|
|
557
|
+
| 'url'
|
|
558
|
+
| 'username'
|
|
559
|
+
| 'username-new'
|
|
560
|
+
| 'off'
|
|
561
|
+
),
|
|
562
|
+
|
|
577
563
|
/**
|
|
578
564
|
* If `false`, disables auto-correct. The default value is `true`.
|
|
579
565
|
*/
|
|
@@ -75,7 +75,6 @@ const PERMISSIONS = Object.freeze({
|
|
|
75
75
|
ANSWER_PHONE_CALLS: 'android.permission.ANSWER_PHONE_CALLS',
|
|
76
76
|
READ_PHONE_NUMBERS: 'android.permission.READ_PHONE_NUMBERS',
|
|
77
77
|
UWB_RANGING: 'android.permission.UWB_RANGING',
|
|
78
|
-
POST_NOTIFICATION: 'android.permission.POST_NOTIFICATIONS', // Remove in 0.72
|
|
79
78
|
POST_NOTIFICATIONS: 'android.permission.POST_NOTIFICATIONS',
|
|
80
79
|
NEARBY_WIFI_DEVICES: 'android.permission.NEARBY_WIFI_DEVICES',
|
|
81
80
|
});
|
|
@@ -107,7 +106,6 @@ class PermissionsAndroid {
|
|
|
107
106
|
CAMERA: string,
|
|
108
107
|
GET_ACCOUNTS: string,
|
|
109
108
|
NEARBY_WIFI_DEVICES: string,
|
|
110
|
-
POST_NOTIFICATION: string, // Remove in 0.72
|
|
111
109
|
POST_NOTIFICATIONS: string,
|
|
112
110
|
PROCESS_OUTGOING_CALLS: string,
|
|
113
111
|
READ_CALENDAR: string,
|
|
@@ -18,7 +18,7 @@ type FlexAlignType =
|
|
|
18
18
|
| 'stretch'
|
|
19
19
|
| 'baseline';
|
|
20
20
|
|
|
21
|
-
type DimensionValue =
|
|
21
|
+
export type DimensionValue =
|
|
22
22
|
| number
|
|
23
23
|
| 'auto'
|
|
24
24
|
| `${number}%`
|
|
@@ -79,15 +79,9 @@ export interface FlexStyle {
|
|
|
79
79
|
| undefined;
|
|
80
80
|
left?: DimensionValue | undefined;
|
|
81
81
|
margin?: DimensionValue | undefined;
|
|
82
|
-
marginBlock?: DimensionValue | undefined;
|
|
83
|
-
marginBlockEnd?: DimensionValue | undefined;
|
|
84
|
-
marginBlockStart?: DimensionValue | undefined;
|
|
85
82
|
marginBottom?: DimensionValue | undefined;
|
|
86
83
|
marginEnd?: DimensionValue | undefined;
|
|
87
84
|
marginHorizontal?: DimensionValue | undefined;
|
|
88
|
-
marginInline?: DimensionValue | undefined;
|
|
89
|
-
marginInlineEnd?: DimensionValue | undefined;
|
|
90
|
-
marginInlineStart?: DimensionValue | undefined;
|
|
91
85
|
marginLeft?: DimensionValue | undefined;
|
|
92
86
|
marginRight?: DimensionValue | undefined;
|
|
93
87
|
marginStart?: DimensionValue | undefined;
|
|
@@ -100,14 +94,8 @@ export interface FlexStyle {
|
|
|
100
94
|
overflow?: 'visible' | 'hidden' | 'scroll' | undefined;
|
|
101
95
|
padding?: DimensionValue | undefined;
|
|
102
96
|
paddingBottom?: DimensionValue | undefined;
|
|
103
|
-
paddingBlock?: DimensionValue | undefined;
|
|
104
|
-
paddingBlockEnd?: DimensionValue | undefined;
|
|
105
|
-
paddingBlockStart?: DimensionValue | undefined;
|
|
106
97
|
paddingEnd?: DimensionValue | undefined;
|
|
107
98
|
paddingHorizontal?: DimensionValue | undefined;
|
|
108
|
-
paddingInline?: DimensionValue | undefined;
|
|
109
|
-
paddingInlineEnd?: DimensionValue | undefined;
|
|
110
|
-
paddingInlineStart?: DimensionValue | undefined;
|
|
111
99
|
paddingLeft?: DimensionValue | undefined;
|
|
112
100
|
paddingRight?: DimensionValue | undefined;
|
|
113
101
|
paddingStart?: DimensionValue | undefined;
|
|
@@ -312,7 +312,17 @@ static void attemptAsynchronousLoadOfBundleAtURL(
|
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
|
|
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
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#ifdef __cplusplus
|
|
10
|
+
#import <ReactCommon/RuntimeExecutor.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@class RCTBridge;
|
|
15
|
+
|
|
16
|
+
facebook::react::RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge);
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
19
|
+
#endif
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTRuntimeExecutorFromBridge.h"
|
|
9
|
+
#import <React/RCTAssert.h>
|
|
10
|
+
#import <React/RCTBridge+Private.h>
|
|
11
|
+
#import <cxxreact/MessageQueueThread.h>
|
|
12
|
+
#import <react/utils/ManagedObjectWrapper.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
@interface RCTBridge ()
|
|
17
|
+
- (std::shared_ptr<MessageQueueThread>)jsMessageThread;
|
|
18
|
+
- (void)invokeAsync:(std::function<void()> &&)func;
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge)
|
|
22
|
+
{
|
|
23
|
+
RCTAssert(bridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil.");
|
|
24
|
+
|
|
25
|
+
auto bridgeWeakWrapper = wrapManagedObjectWeakly([bridge batchedBridge] ?: bridge);
|
|
26
|
+
|
|
27
|
+
RuntimeExecutor runtimeExecutor = [bridgeWeakWrapper](
|
|
28
|
+
std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
|
|
29
|
+
RCTBridge *bridge = unwrapManagedObjectWeakly(bridgeWeakWrapper);
|
|
30
|
+
|
|
31
|
+
RCTAssert(bridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil at the moment of scheduling a call.");
|
|
32
|
+
|
|
33
|
+
[bridge invokeAsync:[bridgeWeakWrapper, callback = std::move(callback)]() {
|
|
34
|
+
RCTCxxBridge *batchedBridge = (RCTCxxBridge *)unwrapManagedObjectWeakly(bridgeWeakWrapper);
|
|
35
|
+
|
|
36
|
+
RCTAssert(batchedBridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil at the moment of invocation.");
|
|
37
|
+
|
|
38
|
+
if (!batchedBridge) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
auto runtime = (facebook::jsi::Runtime *)(batchedBridge.runtime);
|
|
43
|
+
|
|
44
|
+
RCTAssert(
|
|
45
|
+
runtime, @"RCTRuntimeExecutorFromBridge: Bridge must have a valid jsi::Runtime at the moment of invocation.");
|
|
46
|
+
|
|
47
|
+
if (!runtime) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
callback(*runtime);
|
|
52
|
+
}];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return runtimeExecutor;
|
|
56
|
+
}
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -475,6 +475,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
475
475
|
// Load the source asynchronously, then store it for later execution.
|
|
476
476
|
dispatch_group_enter(prepareBridge);
|
|
477
477
|
__block NSData *sourceCode;
|
|
478
|
+
__block NSURL *sourceURL = self.bundleURL;
|
|
478
479
|
|
|
479
480
|
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
|
|
480
481
|
{
|
|
@@ -490,6 +491,9 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
490
491
|
}
|
|
491
492
|
|
|
492
493
|
sourceCode = source.data;
|
|
494
|
+
if (source.url) {
|
|
495
|
+
sourceURL = source.url;
|
|
496
|
+
}
|
|
493
497
|
dispatch_group_leave(prepareBridge);
|
|
494
498
|
}
|
|
495
499
|
onProgress:^(RCTLoadingProgress *progressData) {
|
|
@@ -504,7 +508,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
504
508
|
dispatch_group_notify(prepareBridge, dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
|
|
505
509
|
RCTCxxBridge *strongSelf = weakSelf;
|
|
506
510
|
if (sourceCode && strongSelf.loading) {
|
|
507
|
-
[strongSelf executeSourceCode:sourceCode sync:NO];
|
|
511
|
+
[strongSelf executeSourceCode:sourceCode withSourceURL:sourceURL sync:NO];
|
|
508
512
|
}
|
|
509
513
|
});
|
|
510
514
|
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
|
@@ -1050,7 +1054,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
1050
1054
|
[_displayLink registerModuleForFrameUpdates:module withModuleData:moduleData];
|
|
1051
1055
|
}
|
|
1052
1056
|
|
|
1053
|
-
- (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
|
|
1057
|
+
- (void)executeSourceCode:(NSData *)sourceCode withSourceURL:(NSURL *)url sync:(BOOL)sync
|
|
1054
1058
|
{
|
|
1055
1059
|
// This will get called from whatever thread was actually executing JS.
|
|
1056
1060
|
dispatch_block_t completion = ^{
|
|
@@ -1075,12 +1079,13 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
1075
1079
|
};
|
|
1076
1080
|
|
|
1077
1081
|
if (sync) {
|
|
1078
|
-
[self executeApplicationScriptSync:sourceCode url:
|
|
1082
|
+
[self executeApplicationScriptSync:sourceCode url:url];
|
|
1079
1083
|
completion();
|
|
1080
1084
|
} else {
|
|
1081
|
-
[self enqueueApplicationScript:sourceCode url:
|
|
1085
|
+
[self enqueueApplicationScript:sourceCode url:url onComplete:completion];
|
|
1082
1086
|
}
|
|
1083
1087
|
|
|
1088
|
+
// Use the original request URL here - HMRClient uses this to derive the /hot URL and entry point.
|
|
1084
1089
|
[self.devSettings setupHMRClientWithBundleURL:self.bundleURL];
|
|
1085
1090
|
}
|
|
1086
1091
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#import <react/renderer/components/image/ImageComponentDescriptor.h>
|
|
15
15
|
#import <react/renderer/components/image/ImageEventEmitter.h>
|
|
16
16
|
#import <react/renderer/components/image/ImageProps.h>
|
|
17
|
+
#import <react/renderer/core/CoreFeatures.h>
|
|
17
18
|
#import <react/renderer/imagemanager/ImageRequest.h>
|
|
18
19
|
#import <react/renderer/imagemanager/RCTImagePrimitivesConversions.h>
|
|
19
20
|
|
|
@@ -97,8 +98,18 @@ using namespace facebook::react;
|
|
|
97
98
|
- (void)_setStateAndResubscribeImageResponseObserver:(ImageShadowNode::ConcreteState::Shared const &)state
|
|
98
99
|
{
|
|
99
100
|
if (_state) {
|
|
100
|
-
auto &
|
|
101
|
+
auto const &imageRequest = _state->getData().getImageRequest();
|
|
102
|
+
auto &observerCoordinator = imageRequest.getObserverCoordinator();
|
|
101
103
|
observerCoordinator.removeObserver(_imageResponseObserverProxy);
|
|
104
|
+
if (CoreFeatures::cancelImageDownloadsOnRecycle) {
|
|
105
|
+
// Cancelling image request because we are no longer observing it.
|
|
106
|
+
// This is not 100% correct place to do this because we may want to
|
|
107
|
+
// re-create RCTImageComponentView with the same image and if it
|
|
108
|
+
// was cancelled before downloaded, download is not resumed.
|
|
109
|
+
// This will only become issue if we decouple life cycle of a
|
|
110
|
+
// ShadowNode from ComponentView, which is not something we do now.
|
|
111
|
+
imageRequest.cancel();
|
|
112
|
+
}
|
|
102
113
|
}
|
|
103
114
|
|
|
104
115
|
_state = state;
|
|
@@ -285,6 +285,10 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
|
|
|
285
285
|
CoreFeatures::cacheNSTextStorage = true;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:cancel_image_downloads_on_recycle")) {
|
|
289
|
+
CoreFeatures::cancelImageDownloadsOnRecycle = true;
|
|
290
|
+
}
|
|
291
|
+
|
|
288
292
|
auto componentRegistryFactory =
|
|
289
293
|
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
|
|
290
294
|
EventDispatcher::Weak const &eventDispatcher, ContextContainer::Shared const &contextContainer) {
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <ReactCommon/RuntimeExecutor.h>
|
|
10
9
|
#import <UIKit/UIKit.h>
|
|
11
10
|
#import <react/utils/ContextContainer.h>
|
|
12
11
|
|
|
@@ -15,8 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
15
14
|
@class RCTSurfacePresenter;
|
|
16
15
|
@class RCTBridge;
|
|
17
16
|
|
|
18
|
-
facebook::react::RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge);
|
|
19
|
-
|
|
20
17
|
/*
|
|
21
18
|
* Controls a life-cycle of a Surface Presenter based on Bridge's life-cycle.
|
|
22
19
|
* We are moving away from using Bridge.
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
#import <React/RCTConstants.h>
|
|
16
16
|
#import <React/RCTImageLoader.h>
|
|
17
17
|
#import <React/RCTImageLoaderWithAttributionProtocol.h>
|
|
18
|
+
#import <React/RCTRuntimeExecutorFromBridge.h>
|
|
18
19
|
#import <React/RCTSurfacePresenter.h>
|
|
19
20
|
#import <React/RCTSurfacePresenterStub.h>
|
|
20
21
|
|
|
@@ -42,43 +43,6 @@ static ContextContainer::Shared RCTContextContainerFromBridge(RCTBridge *bridge)
|
|
|
42
43
|
return contextContainer;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge)
|
|
46
|
-
{
|
|
47
|
-
RCTAssert(bridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil.");
|
|
48
|
-
|
|
49
|
-
auto bridgeWeakWrapper = wrapManagedObjectWeakly([bridge batchedBridge] ?: bridge);
|
|
50
|
-
|
|
51
|
-
RuntimeExecutor runtimeExecutor = [bridgeWeakWrapper](
|
|
52
|
-
std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
|
|
53
|
-
RCTBridge *bridge = unwrapManagedObjectWeakly(bridgeWeakWrapper);
|
|
54
|
-
|
|
55
|
-
RCTAssert(bridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil at the moment of scheduling a call.");
|
|
56
|
-
|
|
57
|
-
[bridge invokeAsync:[bridgeWeakWrapper, callback = std::move(callback)]() {
|
|
58
|
-
RCTCxxBridge *batchedBridge = (RCTCxxBridge *)unwrapManagedObjectWeakly(bridgeWeakWrapper);
|
|
59
|
-
|
|
60
|
-
RCTAssert(batchedBridge, @"RCTRuntimeExecutorFromBridge: Bridge must not be nil at the moment of invocation.");
|
|
61
|
-
|
|
62
|
-
if (!batchedBridge) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
auto runtime = (facebook::jsi::Runtime *)(batchedBridge.runtime);
|
|
67
|
-
|
|
68
|
-
RCTAssert(
|
|
69
|
-
runtime, @"RCTRuntimeExecutorFromBridge: Bridge must have a valid jsi::Runtime at the moment of invocation.");
|
|
70
|
-
|
|
71
|
-
if (!runtime) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
callback(*runtime);
|
|
76
|
-
}];
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return runtimeExecutor;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
46
|
@implementation RCTSurfacePresenterBridgeAdapter {
|
|
83
47
|
RCTSurfacePresenter *_Nullable _surfacePresenter;
|
|
84
48
|
__weak RCTBridge *_bridge;
|
|
@@ -29,7 +29,6 @@ header_search_paths = [
|
|
|
29
29
|
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
|
30
30
|
"\"$(PODS_ROOT)/Headers/Public/React-Codegen\"",
|
|
31
31
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
|
|
32
|
-
|
|
33
32
|
]
|
|
34
33
|
|
|
35
34
|
if ENV['USE_FRAMEWORKS']
|
|
@@ -41,6 +40,9 @@ if ENV['USE_FRAMEWORKS']
|
|
|
41
40
|
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\""
|
|
42
41
|
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\""
|
|
43
42
|
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\""
|
|
43
|
+
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
|
|
44
|
+
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\""
|
|
45
|
+
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers\""
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
Pod::Spec.new do |s|
|
|
@@ -72,6 +74,17 @@ Pod::Spec.new do |s|
|
|
|
72
74
|
s.dependency "React-RCTImage", version
|
|
73
75
|
s.dependency "React-ImageManager"
|
|
74
76
|
s.dependency "RCT-Folly/Fabric", folly_version
|
|
77
|
+
s.dependency "glog"
|
|
78
|
+
s.dependency "Yoga"
|
|
79
|
+
s.dependency "React-RCTText"
|
|
80
|
+
s.dependency "React-utils"
|
|
81
|
+
s.dependency "React-runtimescheduler"
|
|
82
|
+
|
|
83
|
+
if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
|
|
84
|
+
s.dependency "hermes-engine"
|
|
85
|
+
else
|
|
86
|
+
s.dependency "React-jsi"
|
|
87
|
+
end
|
|
75
88
|
|
|
76
89
|
s.test_spec 'Tests' do |test_spec|
|
|
77
90
|
test_spec.source_files = "Tests/**/*.{mm}"
|
package/React-Core.podspec
CHANGED
|
@@ -126,11 +126,13 @@ Pod::Spec.new do |s|
|
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
s.dependency "RCT-Folly", folly_version
|
|
129
|
-
s.dependency "React-cxxreact"
|
|
130
|
-
s.dependency "React-perflogger"
|
|
131
|
-
s.dependency "React-jsi"
|
|
132
|
-
s.dependency "React-jsiexecutor"
|
|
129
|
+
s.dependency "React-cxxreact"
|
|
130
|
+
s.dependency "React-perflogger"
|
|
131
|
+
s.dependency "React-jsi"
|
|
132
|
+
s.dependency "React-jsiexecutor"
|
|
133
|
+
s.dependency "React-utils"
|
|
133
134
|
s.dependency "SocketRocket", socket_rocket_version
|
|
135
|
+
s.dependency "React-runtimeexecutor"
|
|
134
136
|
s.dependency "Yoga"
|
|
135
137
|
s.dependency "glog"
|
|
136
138
|
|
|
@@ -469,7 +469,10 @@ android {
|
|
|
469
469
|
"-DREACT_BUILD_DIR=$buildDir",
|
|
470
470
|
"-DANDROID_STL=c++_shared",
|
|
471
471
|
"-DANDROID_TOOLCHAIN=clang",
|
|
472
|
-
"-DANDROID_PLATFORM=android-21"
|
|
472
|
+
"-DANDROID_PLATFORM=android-21",
|
|
473
|
+
// Due to https://github.com/android/ndk/issues/1693 we're losing Android
|
|
474
|
+
// specific compilation flags. This can be removed once we moved to NDK 25/26
|
|
475
|
+
"-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON"
|
|
473
476
|
|
|
474
477
|
targets "jsijniprofiler",
|
|
475
478
|
"reactnativeblob",
|