@office-iss/react-native-win32 0.0.0-canary.271 → 0.0.0-canary.273

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 (77) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/Animated/AnimatedEvent.js +1 -1
  5. package/Libraries/Animated/animations/Animation.js +1 -1
  6. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  7. package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
  8. package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
  9. package/Libraries/Animated/nodes/AnimatedTransform.js +1 -1
  10. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  11. package/Libraries/Animated/useAnimatedProps.js +3 -3
  12. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
  13. package/Libraries/Components/Button.js +3 -0
  14. package/Libraries/Components/Button.win32.js +3 -0
  15. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +5 -0
  16. package/Libraries/Components/Pressable/Pressable.js +4 -4
  17. package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
  18. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +9 -6
  19. package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
  20. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
  21. package/Libraries/Components/ScrollView/ScrollView.js +5 -5
  22. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
  23. package/Libraries/Components/TextInput/TextInput.d.ts +4 -0
  24. package/Libraries/Components/TextInput/TextInput.flow.js +2 -0
  25. package/Libraries/Components/TextInput/TextInput.js +6 -4
  26. package/Libraries/Components/TextInput/TextInput.win32.js +6 -4
  27. package/Libraries/Components/Touchable/TouchableBounce.js +4 -1
  28. package/Libraries/Components/Touchable/TouchableHighlight.js +4 -4
  29. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -4
  30. package/Libraries/Components/View/View.js +4 -4
  31. package/Libraries/Components/View/View.win32.js +4 -4
  32. package/Libraries/Components/View/ViewNativeComponent.js +3 -88
  33. package/Libraries/Core/ExceptionsManager.js +3 -2
  34. package/Libraries/Core/ReactNativeVersion.js +1 -1
  35. package/Libraries/Core/setUpReactDevTools.js +74 -1
  36. package/Libraries/Core/setUpTimers.js +21 -10
  37. package/Libraries/Debugging/DebuggingOverlay.js +4 -5
  38. package/Libraries/Image/Image.android.js +1 -3
  39. package/Libraries/Image/Image.ios.js +0 -2
  40. package/Libraries/Image/Image.win32.js +0 -2
  41. package/Libraries/Image/ImageProps.js +4 -4
  42. package/Libraries/Image/ImageTypes.flow.js +11 -9
  43. package/Libraries/Inspector/Inspector.js +1 -0
  44. package/Libraries/Inspector/Inspector.win32.js +1 -0
  45. package/Libraries/LogBox/LogBox.js +18 -5
  46. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  47. package/Libraries/Modal/Modal.js +3 -0
  48. package/Libraries/NativeComponent/BaseViewConfig.android.js +65 -0
  49. package/Libraries/ReactNative/AppRegistry.js +1 -1
  50. package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -9
  51. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  52. package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
  53. package/Libraries/Text/Text.js +1 -4
  54. package/Libraries/Text/Text.win32.js +1 -4
  55. package/Libraries/Utilities/FocusManager.win32.js +1 -1
  56. package/Libraries/Utilities/Platform.flow.win32.js +1 -0
  57. package/Libraries/Utilities/useMergeRefs.js +26 -7
  58. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  59. package/index.js +1 -1
  60. package/index.win32.js +1 -1
  61. package/jest/setup.js +1 -0
  62. package/overrides.json +13 -14
  63. package/package.json +14 -14
  64. package/src/private/animated/NativeAnimatedHelper.js +4 -4
  65. package/src/private/animated/NativeAnimatedHelper.win32.js +4 -4
  66. package/src/private/animated/useAnimatedPropsMemo.js +0 -1
  67. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -1
  68. package/src/private/components/VScrollViewNativeComponents.js +4 -5
  69. package/src/private/featureflags/ReactNativeFeatureFlags.js +12 -12
  70. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -3
  71. package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
  72. package/src/private/specs/modules/NativeAppearance.js +4 -10
  73. package/src/private/webapis/performance/EventTiming.js +1 -1
  74. package/src/private/webapis/performance/Performance.js +36 -15
  75. package/src/private/webapis/performance/PerformanceObserver.js +2 -2
  76. package/src/private/webapis/performance/specs/NativePerformance.js +18 -2
  77. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +32 -12
@@ -33,6 +33,8 @@ export type RawPerformanceEntry = {
33
33
  export type OpaqueNativeObserverHandle = mixed;
34
34
 
35
35
  export type NativeBatchedObserverCallback = () => void;
36
+ export type NativePerformanceMarkResult = number;
37
+ export type NativePerformanceMeasureResult = $ReadOnlyArray<number>; // [startTime, duration]
36
38
 
37
39
  export type PerformanceObserverInit = {
38
40
  entryTypes?: $ReadOnlyArray<number>,
@@ -43,8 +45,10 @@ export type PerformanceObserverInit = {
43
45
 
44
46
  export interface Spec extends TurboModule {
45
47
  +now?: () => number;
46
- +mark: (name: string, startTime: number) => void;
47
- +measure: (
48
+ // TODO: remove when `markWithResult` is fully rolled out.
49
+ +mark?: (name: string, startTime: number) => void;
50
+ // TODO: remove when `measureWithResult` is fully rolled out.
51
+ +measure?: (
48
52
  name: string,
49
53
  startTime: number,
50
54
  endTime: number,
@@ -52,6 +56,18 @@ export interface Spec extends TurboModule {
52
56
  startMark?: string,
53
57
  endMark?: string,
54
58
  ) => void;
59
+ +markWithResult?: (
60
+ name: string,
61
+ startTime?: number,
62
+ ) => NativePerformanceMarkResult;
63
+ +measureWithResult?: (
64
+ name: string,
65
+ startTime: number,
66
+ endTime: number,
67
+ duration?: number,
68
+ startMark?: string,
69
+ endMark?: string,
70
+ ) => NativePerformanceMeasureResult;
55
71
  +clearMarks?: (entryName?: string) => void;
56
72
  +clearMeasures?: (entryName?: string) => void;
57
73
  +getEntries?: () => $ReadOnlyArray<RawPerformanceEntry>;
@@ -11,13 +11,14 @@
11
11
  import type {
12
12
  NativeBatchedObserverCallback,
13
13
  NativeMemoryInfo,
14
- RawPerformanceEntry,
15
- ReactNativeStartupTiming,
16
- PerformanceObserverInit,
14
+ NativePerformanceMarkResult,
15
+ NativePerformanceMeasureResult,
17
16
  OpaqueNativeObserverHandle,
17
+ PerformanceObserverInit,
18
+ RawPerformanceEntry,
18
19
  RawPerformanceEntryType,
20
+ ReactNativeStartupTiming,
19
21
  } from '../NativePerformance';
20
-
21
22
  import typeof NativePerformance from '../NativePerformance';
22
23
 
23
24
  import {RawPerformanceEntryTypeValues} from '../../RawPerformanceEntry';
@@ -109,32 +110,51 @@ const NativePerformanceMock = {
109
110
 
110
111
  now: (): number => currentTime,
111
112
 
112
- mark: (name: string, startTime: number): void => {
113
- marks.set(name, startTime);
113
+ markWithResult: (
114
+ name: string,
115
+ startTime?: number,
116
+ ): NativePerformanceMarkResult => {
117
+ const computedStartTime = startTime ?? performance.now();
118
+
119
+ marks.set(name, computedStartTime);
114
120
  reportEntry({
115
121
  entryType: RawPerformanceEntryTypeValues.MARK,
116
122
  name,
117
- startTime,
123
+ startTime: computedStartTime,
118
124
  duration: 0,
119
125
  });
126
+
127
+ return computedStartTime;
120
128
  },
121
129
 
122
- measure: (
130
+ measureWithResult: (
123
131
  name: string,
124
132
  startTime: number,
125
133
  endTime: number,
126
134
  duration?: number,
127
135
  startMark?: string,
128
136
  endMark?: string,
129
- ): void => {
130
- const start = startMark != null ? marks.get(startMark) ?? 0 : startTime;
131
- const end = endMark != null ? marks.get(endMark) ?? 0 : endTime;
137
+ ): NativePerformanceMeasureResult => {
138
+ const start = startMark != null ? marks.get(startMark) : startTime;
139
+ const end = endMark != null ? marks.get(endMark) : endTime;
140
+
141
+ if (start === undefined) {
142
+ throw new Error('startMark does not exist');
143
+ }
144
+
145
+ if (end === undefined) {
146
+ throw new Error('endMark does not exist');
147
+ }
148
+
149
+ const computedDuration = duration ?? end - start;
132
150
  reportEntry({
133
151
  entryType: RawPerformanceEntryTypeValues.MEASURE,
134
152
  name,
135
153
  startTime: start,
136
- duration: duration ?? end - start,
154
+ duration: computedDuration,
137
155
  });
156
+
157
+ return [start, computedDuration];
138
158
  },
139
159
 
140
160
  getSimpleMemoryInfo: (): NativeMemoryInfo => {