@office-iss/react-native-win32 0.0.0-canary.299 → 0.0.0-canary.300

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 (99) hide show
  1. package/.flowconfig +3 -6
  2. package/CHANGELOG.json +46 -1
  3. package/CHANGELOG.md +19 -6
  4. package/IntegrationTests/IntegrationTestsApp.js +1 -1
  5. package/Libraries/Alert/RCTAlertManager.android.js +2 -0
  6. package/Libraries/Animated/Animated.d.ts +2 -0
  7. package/Libraries/Animated/AnimatedImplementation.js +2 -0
  8. package/Libraries/Animated/Easing.js +2 -0
  9. package/Libraries/Animated/animations/Animation.js +14 -14
  10. package/Libraries/Animated/animations/TimingAnimation.js +2 -0
  11. package/Libraries/Animated/nodes/AnimatedNode.js +7 -7
  12. package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
  13. package/Libraries/Animated/nodes/AnimatedProps.js +30 -30
  14. package/Libraries/Animated/nodes/AnimatedStyle.js +17 -17
  15. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
  16. package/Libraries/Animated/nodes/AnimatedValue.js +18 -18
  17. package/Libraries/AppState/AppState.js +3 -3
  18. package/Libraries/BatchedBridge/MessageQueue.js +4 -0
  19. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
  20. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
  21. package/Libraries/Components/Pressable/Pressable.js +10 -1
  22. package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
  23. package/Libraries/Components/StatusBar/StatusBar.js +2 -2
  24. package/Libraries/Components/Switch/Switch.js +1 -1
  25. package/Libraries/Components/TextInput/TextInput.js +2 -2
  26. package/Libraries/Components/TextInput/TextInput.win32.js +2 -1
  27. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  28. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  29. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  30. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
  31. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
  32. package/Libraries/Components/View/View.js +86 -168
  33. package/Libraries/Core/ReactNativeVersion.js +37 -10
  34. package/Libraries/Core/Timers/queueMicrotask.js +1 -0
  35. package/Libraries/Core/setUpPerformance.js +2 -1
  36. package/Libraries/Interaction/InteractionManager.js +118 -171
  37. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
  38. package/Libraries/LogBox/Data/LogBoxData.js +4 -1
  39. package/Libraries/Modal/Modal.js +1 -1
  40. package/Libraries/NativeComponent/ViewConfig.js +1 -1
  41. package/Libraries/Network/XMLHttpRequest.js +18 -5
  42. package/Libraries/Pressability/Pressability.js +1 -1
  43. package/Libraries/Pressability/Pressability.win32.js +1 -1
  44. package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
  45. package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
  46. package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
  47. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
  48. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
  49. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
  50. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
  51. package/Libraries/Renderer/shims/ReactFabric.js +3 -1
  52. package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
  53. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  54. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  55. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
  56. package/Libraries/Utilities/useMergeRefs.js +1 -1
  57. package/Libraries/promiseRejectionTrackingOptions.js +17 -31
  58. package/flow/HermesInternalType.js +114 -0
  59. package/flow/Stringish.js +14 -0
  60. package/flow/bom.js.flow +554 -0
  61. package/flow/console.js +49 -0
  62. package/flow/cssom.js.flow +575 -0
  63. package/flow/dom.js.flow +6289 -0
  64. package/flow/global.js +88 -0
  65. package/flow/prettier.js.flow +14 -0
  66. package/flow/streams.js.flow +140 -0
  67. package/index.js +5 -2
  68. package/index.win32.js +6 -2
  69. package/jest/mockComponent.js +1 -1
  70. package/jest/setup.js +11 -0
  71. package/overrides.json +11 -11
  72. package/package.json +19 -19
  73. package/src/private/animated/NativeAnimatedHelper.js +8 -1
  74. package/src/private/animated/NativeAnimatedHelper.win32.js +8 -1
  75. package/src/private/animated/createAnimatedPropsHook.js +2 -49
  76. package/src/private/animated/createAnimatedPropsMemoHook.js +2 -48
  77. package/src/private/components/virtualview/VirtualView.js +22 -6
  78. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
  79. package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
  80. package/src/private/featureflags/ReactNativeFeatureFlags.js +71 -51
  81. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +19 -0
  82. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -5
  83. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
  84. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +2 -2
  85. package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
  86. package/src/private/webapis/geometry/DOMRectList.js +2 -2
  87. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
  88. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
  89. package/src/private/webapis/performance/EventTiming.js +5 -9
  90. package/src/private/webapis/performance/Performance.js +251 -191
  91. package/src/private/webapis/performance/PerformanceObserver.js +8 -29
  92. package/src/private/webapis/performance/UserTiming.js +24 -23
  93. package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
  94. package/src/private/webapis/performance/internals/Utilities.js +9 -0
  95. package/src/private/webapis/performance/specs/NativePerformance.js +19 -33
  96. package/src/private/webapis/structuredClone/structuredClone.js +1 -1
  97. package/Libraries/Interaction/InteractionManagerStub.js +0 -184
  98. package/Libraries/Interaction/TaskQueue.js +0 -197
  99. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<43be62d6fc9b622e265e2acb066ed13c>>
10
+ * @generated SignedSource<<5ea611585e32bbcbcdc91868aa8ed875>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -10603,11 +10603,11 @@ function updateContainer(element, container, parentComponent, callback) {
10603
10603
  return lane;
10604
10604
  }
10605
10605
  var isomorphicReactPackageVersion = React.version;
10606
- if ("19.1.0" !== isomorphicReactPackageVersion)
10606
+ if ("19.1.1" !== isomorphicReactPackageVersion)
10607
10607
  throw Error(
10608
10608
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
10609
10609
  (isomorphicReactPackageVersion +
10610
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
10610
+ "\n - react-native-renderer: 19.1.1\nLearn more: https://react.dev/warnings/version-mismatch")
10611
10611
  );
10612
10612
  if (
10613
10613
  "function" !==
@@ -10656,10 +10656,10 @@ batchedUpdatesImpl = function (fn, a) {
10656
10656
  var roots = new Map(),
10657
10657
  internals$jscomp$inline_1269 = {
10658
10658
  bundleType: 0,
10659
- version: "19.1.0",
10659
+ version: "19.1.1",
10660
10660
  rendererPackageName: "react-native-renderer",
10661
10661
  currentDispatcherRef: ReactSharedInternals,
10662
- reconcilerVersion: "19.1.0"
10662
+ reconcilerVersion: "19.1.1"
10663
10663
  };
10664
10664
  null !== extraDevToolsConfig &&
10665
10665
  (internals$jscomp$inline_1269.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<d0e536371839f0311bec769f15162a4b>>
10
+ * @generated SignedSource<<68ab59ddfed0642b58d7b4db6803da29>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -11245,11 +11245,11 @@ function updateContainer(element, container, parentComponent, callback) {
11245
11245
  return lane;
11246
11246
  }
11247
11247
  var isomorphicReactPackageVersion = React.version;
11248
- if ("19.1.0" !== isomorphicReactPackageVersion)
11248
+ if ("19.1.1" !== isomorphicReactPackageVersion)
11249
11249
  throw Error(
11250
11250
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
11251
11251
  (isomorphicReactPackageVersion +
11252
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
11252
+ "\n - react-native-renderer: 19.1.1\nLearn more: https://react.dev/warnings/version-mismatch")
11253
11253
  );
11254
11254
  if (
11255
11255
  "function" !==
@@ -11298,10 +11298,10 @@ batchedUpdatesImpl = function (fn, a) {
11298
11298
  var roots = new Map(),
11299
11299
  internals$jscomp$inline_1362 = {
11300
11300
  bundleType: 0,
11301
- version: "19.1.0",
11301
+ version: "19.1.1",
11302
11302
  rendererPackageName: "react-native-renderer",
11303
11303
  currentDispatcherRef: ReactSharedInternals,
11304
- reconcilerVersion: "19.1.0"
11304
+ reconcilerVersion: "19.1.1"
11305
11305
  };
11306
11306
  null !== extraDevToolsConfig &&
11307
11307
  (internals$jscomp$inline_1362.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,9 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow
10
- * @generated SignedSource<<cf323fc5ca893bab5669c7d321660412>>
10
+ * @generated SignedSource<<16b364e89f43b8a47832b0dfb98af11e>>
11
+ *
12
+ * This file was sync'd from the facebook/react repository.
11
13
  */
12
14
 
13
15
  'use strict';
@@ -7,7 +7,9 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict-local
10
- * @generated SignedSource<<908f5fb85384725318e261f40e49d9a6>>
10
+ * @generated SignedSource<<1dd9e9c3f20e37ae14e485fc6ee3d9e9>>
11
+ *
12
+ * This file was sync'd from the facebook/react repository.
11
13
  */
12
14
 
13
15
  'use strict';
@@ -7,7 +7,9 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow
10
- * @generated SignedSource<<8f46fdc9267fcc4fdc9e76842fe24066>>
10
+ * @generated SignedSource<<e2c46705ed927302dbe9332dafba459d>>
11
+ *
12
+ * This file was sync'd from the facebook/react repository.
11
13
  */
12
14
  'use strict';
13
15
 
@@ -7,7 +7,9 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict-local
10
- * @generated SignedSource<<83073425aa3f71ced2c8c51f25a25938>>
10
+ * @generated SignedSource<<e8dce0e82b831c91465d04b49fb48ab2>>
11
+ *
12
+ * This file was sync'd from the facebook/react repository.
11
13
  */
12
14
 
13
15
  'use strict';
@@ -7,7 +7,9 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict-local
10
- * @generated SignedSource<<52163887de05f1cff05388145cf85b3b>>
10
+ * @generated SignedSource<<556d1487de0b9e4a09cbc67dd130a884>>
11
+ *
12
+ * This file was sync'd from the facebook/react repository.
11
13
  */
12
14
 
13
15
  'use strict';
@@ -31,7 +31,7 @@ export default function useMergeRefs<Instance>(
31
31
  return undefined;
32
32
  } else {
33
33
  if (typeof ref === 'function') {
34
- // $FlowIssue[incompatible-type] - Flow does not understand ref cleanup.
34
+ // $FlowFixMe[incompatible-type] - Flow does not understand ref cleanup.
35
35
  const cleanup: void | (() => void) = ref(current);
36
36
  return typeof cleanup === 'function'
37
37
  ? cleanup
@@ -10,21 +10,21 @@
10
10
 
11
11
  import typeof {enable} from 'promise/setimmediate/rejection-tracking';
12
12
 
13
- import LogBox from './LogBox/LogBox';
13
+ import ExceptionsManager from './Core/ExceptionsManager';
14
14
 
15
15
  let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
16
16
  allRejections: true,
17
- onUnhandled: (id, rejection = {}) => {
17
+ onUnhandled: (id, rejection) => {
18
18
  let message: string;
19
- let stack: ?string;
20
19
 
21
- // $FlowFixMe[method-unbinding] added when improving typing for this parameters
22
- const stringValue = Object.prototype.toString.call(rejection);
23
- if (stringValue === '[object Error]') {
20
+ if (rejection === undefined) {
21
+ message = '';
22
+ } else if (
23
+ // $FlowFixMe[method-unbinding] added when improving typing for this parameters
24
+ Object.prototype.toString.call(rejection) === '[object Error]'
25
+ ) {
24
26
  // $FlowFixMe[method-unbinding] added when improving typing for this parameters
25
27
  message = Error.prototype.toString.call(rejection);
26
- const error: Error = (rejection: $FlowFixMe);
27
- stack = error.stack;
28
28
  } else {
29
29
  try {
30
30
  message = require('pretty-format').format(rejection);
@@ -34,37 +34,23 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
34
34
  ? rejection
35
35
  : JSON.stringify((rejection: $FlowFixMe));
36
36
  }
37
- // It could although this object is not a standard error, it still has stack information to unwind
38
- // $FlowFixMe ignore types just check if stack is there
39
- if (rejection?.stack && typeof rejection.stack === 'string') {
40
- stack = rejection.stack;
41
- }
42
37
  }
43
38
 
44
- const warning = `Possible unhandled promise rejection (id: ${id}):\n${
45
- message ?? ''
46
- }`;
47
- if (__DEV__) {
48
- LogBox.addLog({
49
- level: 'warn',
50
- message: {
51
- content: warning,
52
- substitutions: [],
39
+ ExceptionsManager.handleException(
40
+ new Error(
41
+ `Uncaught (in promise, id: ${id})${message ? `: "${message}"` : ''}`,
42
+ {
43
+ cause: rejection,
53
44
  },
54
- componentStack: [],
55
- componentStackType: null,
56
- stack,
57
- category: 'possible_unhandled_promise_rejection',
58
- });
59
- } else {
60
- console.warn(warning);
61
- }
45
+ ),
46
+ false /* isFatal */,
47
+ );
62
48
  },
63
49
  onHandled: id => {
64
50
  const warning =
65
51
  `Promise rejection handled (id: ${id})\n` +
66
52
  'This means you can ignore any previous messages of the form ' +
67
- `"Possible unhandled promise rejection (id: ${id}):"`;
53
+ `"Uncaught (in promise, id: ${id})"`;
68
54
  console.warn(warning);
69
55
  },
70
56
  };
@@ -0,0 +1,114 @@
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
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ // Declarations for functionality exposed by the Hermes VM.
12
+ //
13
+ // For backwards-compatibility, code that uses such functionality must also
14
+ // check explicitly at run-time whether the object(s) and method(s) exist, and
15
+ // fail safely if not.
16
+
17
+ /**
18
+ * HermesInternalType is an object containing functions used to interact with
19
+ * the VM in a way that is not standardized by the JS spec.
20
+ * There are limited guarantees about these functions, and they should not be
21
+ * widely used. Consult with the Hermes team before using any of these.
22
+ * There may be other visible properties on this object; however, those are
23
+ * only exposed for testing purposes: do not use them.
24
+ */
25
+ declare type $HermesInternalType = {
26
+ // All members are optional because they may not exist when OTA'd to older
27
+ // VMs.
28
+
29
+ +getNumGCs?: () => number,
30
+ +getGCTime?: () => number,
31
+ +getNativeCallTime?: () => number,
32
+ +getNativeCallCount?: () => number,
33
+ +getGCCPUTime?: () => number,
34
+
35
+ /**
36
+ * Hermes can embed an "epilogue" to the bytecode file with arbitrary bytes.
37
+ * At most one epilogue will exist per bytecode module (which can be
38
+ * different than a JS module).
39
+ * Calling this function will return all such epilogues and convert the
40
+ * bytes to numbers in the range of 0-255.
41
+ */
42
+ +getEpilogues?: () => Array<Array<number>>,
43
+
44
+ /**
45
+ * Query the VM for various statistics about performance.
46
+ * There are no guarantees about what keys exist in it, but they can be
47
+ * printed for informational purposes.
48
+ * @return An object that maps strings to various types of performance
49
+ * statistics.
50
+ */
51
+ +getInstrumentedStats?: () => {[string]: number | string, ...},
52
+
53
+ /**
54
+ * Query the VM for any sort of runtime properties that it wants to report.
55
+ * There are no guarantees about what keys exist in it, but they can be
56
+ * printed for informational purposes.
57
+ * @return An object that maps strings to various types of runtime properties.
58
+ */
59
+ +getRuntimeProperties?: () => {
60
+ 'OSS Release Version': string,
61
+ Build: string,
62
+ [string]: mixed,
63
+ },
64
+
65
+ /**
66
+ * Tell Hermes that at this point the surface has transitioned from TTI to
67
+ * post-TTI. The VM can change some of its internal behavior to optimize for
68
+ * post-TTI scenarios.
69
+ * This can be called several times but will have no effect after the first
70
+ * call.
71
+ */
72
+ +ttiReached?: () => void,
73
+
74
+ /**
75
+ * Tell Hermes that at this point the surface has transitioned from TTRC to
76
+ * post-TTRC. The VM can change some of its internal behavior to optimize for
77
+ * post-TTRC scenarios.
78
+ * This can be called several times but will have no effect after the first
79
+ * call.
80
+ */
81
+ +ttrcReached?: () => void,
82
+
83
+ /**
84
+ * Query the VM to see whether or not it enabled Promise.
85
+ */
86
+ +hasPromise?: () => boolean,
87
+
88
+ /**
89
+ * Enable promise rejection tracking with the given options.
90
+ * The API mirrored the `promise` npm package, therefore it's typed same as
91
+ * the `enable` function of module `promise/setimmediate/rejection-tracking`
92
+ * declared in ./flow-typed/npm/promise_v8.x.x.js.
93
+ */
94
+ +enablePromiseRejectionTracker?: (
95
+ options: ?{
96
+ whitelist?: ?Array<mixed>,
97
+ allRejections?: ?boolean,
98
+ onUnhandled?: ?(number, mixed) => void,
99
+ onHandled?: ?(number, mixed) => void,
100
+ },
101
+ ) => void,
102
+
103
+ /**
104
+ * Query the VM to see whether or not it use the engine Job queue.
105
+ */
106
+ +useEngineQueue?: () => boolean,
107
+
108
+ /**
109
+ * Enqueue a JavaScript callback function as a Job into the engine Job queue.
110
+ */
111
+ +enqueueJob?: <TArguments: Array<mixed>>(
112
+ jobCallback: (...args: TArguments) => mixed,
113
+ ) => void,
114
+ };
@@ -0,0 +1,14 @@
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
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ // This type allows Facebook to internally Override
12
+ // this type to allow our internationalization type which
13
+ // is a string at runtime but Flow doesn't know that.
14
+ declare type Stringish = string;