@office-iss/react-native-win32 0.0.0-canary.276 → 0.0.0-canary.277

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/.flowconfig CHANGED
@@ -107,6 +107,7 @@ flow/
107
107
 
108
108
  [options]
109
109
  enums=true
110
+ as_const=true
110
111
  casting_syntax=both
111
112
 
112
113
  emoji=true
@@ -164,4 +165,4 @@ untyped-import
164
165
  untyped-type-import
165
166
 
166
167
  [version]
167
- ^0.253.0
168
+ ^0.255.0
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 18 Dec 2024 06:21:37 GMT",
5
+ "date": "Fri, 20 Dec 2024 06:21:41 GMT",
6
+ "version": "0.0.0-canary.277",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.277",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "9372e929083b78c3d8c05ee713a57537f864cdd9",
14
+ "comment": "integrate 0.78.0-nightly-20241201-91e217ff5"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 18 Dec 2024 06:22:23 GMT",
6
21
  "version": "0.0.0-canary.276",
7
22
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.276",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,25 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- <!-- This log was last generated on Wed, 18 Dec 2024 06:21:37 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 20 Dec 2024 06:21:41 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.276
7
+ ## 0.0.0-canary.277
8
8
 
9
- Wed, 18 Dec 2024 06:21:37 GMT
9
+ Fri, 20 Dec 2024 06:21:41 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - integrate RN-Nightly 0.77.0-nightly-20241125-4cffff35e (email not defined)
13
+ - integrate 0.78.0-nightly-20241201-91e217ff5 (email not defined)
14
14
 
15
+ ## 0.0.0-canary.276
16
+
17
+ Wed, 18 Dec 2024 06:22:23 GMT
18
+
19
+ ### Changes
20
+
21
+ - integrate RN-Nightly 0.77.0-nightly-20241125-4cffff35e (email not defined)
22
+
15
23
  ## 0.0.0-canary.275
16
24
 
17
25
  Sat, 14 Dec 2024 06:29:12 GMT
@@ -15,9 +15,9 @@ const version: $ReadOnly<{
15
15
  prerelease: string | null,
16
16
  }> = {
17
17
  major: 0,
18
- minor: 77,
18
+ minor: 78,
19
19
  patch: 0,
20
- prerelease: 'nightly-20241125-4cffff35e',
20
+ prerelease: 'nightly-20241201-91e217ff5',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -121,7 +121,7 @@ const Presets = {
121
121
  'opacity',
122
122
  ): LayoutAnimationConfig),
123
123
  linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
124
- spring: {
124
+ spring: ({
125
125
  duration: 700,
126
126
  create: {
127
127
  type: 'linear',
@@ -135,7 +135,7 @@ const Presets = {
135
135
  type: 'linear',
136
136
  property: 'opacity',
137
137
  },
138
- },
138
+ }: LayoutAnimationConfig),
139
139
  };
140
140
 
141
141
  /**
package/overrides.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "**/__snapshots__/**",
8
8
  "src-win/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.77.0-nightly-20241125-4cffff35e",
10
+ "baseVersion": "0.78.0-nightly-20241201-91e217ff5",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
14
14
  "file": ".flowconfig",
15
15
  "baseFile": ".flowconfig",
16
- "baseHash": "168a2b4bcf33aba4727eb608902b17b4eb74c95d"
16
+ "baseHash": "38943f268bd48c91a2ace6ad2a9302a3bb346dbd"
17
17
  },
18
18
  {
19
19
  "type": "derived",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.0.0-canary.276",
3
+ "version": "0.0.0-canary.277",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  "@react-native-community/cli-platform-android": "15.0.0-alpha.2",
31
31
  "@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
32
32
  "@react-native/assets": "1.0.0",
33
- "@react-native/assets-registry": "0.77.0-nightly-20241125-4cffff35e",
34
- "@react-native/codegen": "0.77.0-nightly-20241125-4cffff35e",
35
- "@react-native/community-cli-plugin": "0.77.0-nightly-20241125-4cffff35e",
36
- "@react-native/gradle-plugin": "0.77.0-nightly-20241125-4cffff35e",
37
- "@react-native/js-polyfills": "0.77.0-nightly-20241125-4cffff35e",
38
- "@react-native/normalize-colors": "0.77.0-nightly-20241125-4cffff35e",
39
- "@react-native/virtualized-lists": "0.77.0-nightly-20241125-4cffff35e",
33
+ "@react-native/assets-registry": "0.78.0-nightly-20241201-91e217ff5",
34
+ "@react-native/codegen": "0.78.0-nightly-20241201-91e217ff5",
35
+ "@react-native/community-cli-plugin": "0.78.0-nightly-20241201-91e217ff5",
36
+ "@react-native/gradle-plugin": "0.78.0-nightly-20241201-91e217ff5",
37
+ "@react-native/js-polyfills": "0.78.0-nightly-20241201-91e217ff5",
38
+ "@react-native/normalize-colors": "0.78.0-nightly-20241201-91e217ff5",
39
+ "@react-native/virtualized-lists": "0.78.0-nightly-20241201-91e217ff5",
40
40
  "abort-controller": "^3.0.0",
41
41
  "anser": "^1.4.9",
42
42
  "ansi-regex": "^5.0.0",
@@ -90,14 +90,14 @@
90
90
  "just-scripts": "^1.3.3",
91
91
  "prettier": "2.8.8",
92
92
  "react": "18.3.1",
93
- "react-native": "0.77.0-nightly-20241125-4cffff35e",
93
+ "react-native": "0.78.0-nightly-20241201-91e217ff5",
94
94
  "react-native-platform-override": "^1.9.49",
95
95
  "typescript": "5.0.4"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@types/react": "^18.2.6",
99
99
  "react": "^18.2.0",
100
- "react-native": "0.77.0-nightly-20241125-4cffff35e"
100
+ "react-native": "0.78.0-nightly-20241201-91e217ff5"
101
101
  },
102
102
  "beachball": {
103
103
  "defaultNpmTag": "canary",
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<83b5798ee1c7a28fffbf110e19641d69>>
7
+ * @generated SignedSource<<38ad29621eeb29a9f82735dc187c13d4>>
8
8
  * @flow strict
9
9
  */
10
10
 
@@ -36,6 +36,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
36
36
  enableAnimatedAllowlist: Getter<boolean>,
37
37
  enableAnimatedClearImmediateFix: Getter<boolean>,
38
38
  enableAnimatedPropsMemo: Getter<boolean>,
39
+ fixVirtualizeListCollapseWindowSize: Getter<boolean>,
39
40
  isLayoutAnimationEnabled: Getter<boolean>,
40
41
  shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean>,
41
42
  shouldUseAnimatedObjectForTransform: Getter<boolean>,
@@ -67,6 +68,7 @@ export type ReactNativeFeatureFlags = {
67
68
  enableFixForViewCommandRace: Getter<boolean>,
68
69
  enableGranularShadowTreeStateReconciliation: Getter<boolean>,
69
70
  enableIOSViewClipToPaddingBox: Getter<boolean>,
71
+ enableImagePrefetchingAndroid: Getter<boolean>,
70
72
  enableLayoutAnimationsOnAndroid: Getter<boolean>,
71
73
  enableLayoutAnimationsOnIOS: Getter<boolean>,
72
74
  enableLongTaskAPI: Getter<boolean>,
@@ -142,6 +144,11 @@ export const enableAnimatedClearImmediateFix: Getter<boolean> = createJavaScript
142
144
  */
143
145
  export const enableAnimatedPropsMemo: Getter<boolean> = createJavaScriptFlagGetter('enableAnimatedPropsMemo', true);
144
146
 
147
+ /**
148
+ * Fixing an edge case where the current window size is not properly calculated with fast scrolling. Window size collapsed to 1 element even if windowSize more than the current amount of elements
149
+ */
150
+ export const fixVirtualizeListCollapseWindowSize: Getter<boolean> = createJavaScriptFlagGetter('fixVirtualizeListCollapseWindowSize', false);
151
+
145
152
  /**
146
153
  * Function used to enable / disabled Layout Animations in React Native.
147
154
  */
@@ -249,6 +256,10 @@ export const enableGranularShadowTreeStateReconciliation: Getter<boolean> = crea
249
256
  * iOS Views will clip to their padding box vs border box
250
257
  */
251
258
  export const enableIOSViewClipToPaddingBox: Getter<boolean> = createNativeFlagGetter('enableIOSViewClipToPaddingBox', false);
259
+ /**
260
+ * When enabled, Andoid will build and initiate image prefetch requests on ImageShadowNode::layout
261
+ */
262
+ export const enableImagePrefetchingAndroid: Getter<boolean> = createNativeFlagGetter('enableImagePrefetchingAndroid', false);
252
263
  /**
253
264
  * When enabled, LayoutAnimations API will animate state changes on Android.
254
265
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<4caaf5dbaa68614ce53c8aecbd512df8>>
7
+ * @generated SignedSource<<17c0e677f7b308795e836c558b15d1d1>>
8
8
  * @flow strict
9
9
  */
10
10
 
@@ -41,6 +41,7 @@ export interface Spec extends TurboModule {
41
41
  +enableFixForViewCommandRace?: () => boolean;
42
42
  +enableGranularShadowTreeStateReconciliation?: () => boolean;
43
43
  +enableIOSViewClipToPaddingBox?: () => boolean;
44
+ +enableImagePrefetchingAndroid?: () => boolean;
44
45
  +enableLayoutAnimationsOnAndroid?: () => boolean;
45
46
  +enableLayoutAnimationsOnIOS?: () => boolean;
46
47
  +enableLongTaskAPI?: () => boolean;
@@ -25,7 +25,7 @@ import {getFabricUIManager} from '../../../../../Libraries/ReactNative/FabricUIM
25
25
  import {create as createAttributePayload} from '../../../../../Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload';
26
26
  import warnForStyleProps from '../../../../../Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps';
27
27
  import ReadOnlyElement, {getBoundingClientRect} from './ReadOnlyElement';
28
- import ReadOnlyNode from './ReadOnlyNode';
28
+ import ReadOnlyNode, {setInstanceHandle} from './ReadOnlyNode';
29
29
  import {
30
30
  getPublicInstanceFromInternalInstanceHandle,
31
31
  getShadowNode,
@@ -35,7 +35,26 @@ import nullthrows from 'nullthrows';
35
35
 
36
36
  const noop = () => {};
37
37
 
38
- export default class ReactNativeElement
38
+ // Ideally, this class would be exported as-is, but this implementation is
39
+ // significantly slower than the existing `ReactFabricHostComponent`.
40
+ // This is a very hot code path (this class is instantiated once per rendered
41
+ // host component in the tree) and we can't regress performance here.
42
+ //
43
+ // This implementation is slower because this is a subclass and we have to call
44
+ // super(), which is a very slow operation the way that Babel transforms it at
45
+ // the moment.
46
+ //
47
+ // The optimization we're doing is using an old-style function constructor,
48
+ // where we're not required to use `super()`, and we make that constructor
49
+ // extend this class so it inherits all the methods and it sets the class
50
+ // hierarchy correctly.
51
+ //
52
+ // An alternative implementation was to implement the constructor as a function
53
+ // returning a manually constructed instance using `Object.create()` but that
54
+ // was slower than this method because the engine has to create an object than
55
+ // we then discard to create a new one.
56
+
57
+ class ReactNativeElementMethods
39
58
  extends ReadOnlyElement
40
59
  implements INativeMethods
41
60
  {
@@ -43,8 +62,10 @@ export default class ReactNativeElement
43
62
  __nativeTag: number;
44
63
  __internalInstanceHandle: InternalInstanceHandle;
45
64
 
46
- #viewConfig: ViewConfig;
65
+ __viewConfig: ViewConfig;
47
66
 
67
+ // This constructor isn't really used. See the `ReactNativeElement` function
68
+ // below.
48
69
  constructor(
49
70
  tag: number,
50
71
  viewConfig: ViewConfig,
@@ -54,7 +75,7 @@ export default class ReactNativeElement
54
75
 
55
76
  this.__nativeTag = tag;
56
77
  this.__internalInstanceHandle = internalInstanceHandle;
57
- this.#viewConfig = viewConfig;
78
+ this.__viewConfig = viewConfig;
58
79
  }
59
80
 
60
81
  get offsetHeight(): number {
@@ -171,12 +192,12 @@ export default class ReactNativeElement
171
192
 
172
193
  setNativeProps(nativeProps: {...}): void {
173
194
  if (__DEV__) {
174
- warnForStyleProps(nativeProps, this.#viewConfig.validAttributes);
195
+ warnForStyleProps(nativeProps, this.__viewConfig.validAttributes);
175
196
  }
176
197
 
177
198
  const updatePayload = createAttributePayload(
178
199
  nativeProps,
179
- this.#viewConfig.validAttributes,
200
+ this.__viewConfig.validAttributes,
180
201
  );
181
202
 
182
203
  const node = getShadowNode(this);
@@ -186,3 +207,24 @@ export default class ReactNativeElement
186
207
  }
187
208
  }
188
209
  }
210
+
211
+ // Alternative constructor just implemented to provide a better performance than
212
+ // calling super() in the original class.
213
+ function ReactNativeElement(
214
+ this: ReactNativeElementMethods,
215
+ tag: number,
216
+ viewConfig: ViewConfig,
217
+ internalInstanceHandle: InternalInstanceHandle,
218
+ ) {
219
+ this.__nativeTag = tag;
220
+ this.__internalInstanceHandle = internalInstanceHandle;
221
+ this.__viewConfig = viewConfig;
222
+ setInstanceHandle(this, internalInstanceHandle);
223
+ }
224
+
225
+ ReactNativeElement.prototype = Object.create(
226
+ ReactNativeElementMethods.prototype,
227
+ );
228
+
229
+ // $FlowExpectedError[prop-missing]
230
+ export default ReactNativeElement as typeof ReactNativeElementMethods;
@@ -26,6 +26,8 @@ let ReadOnlyElementClass: Class<ReadOnlyElement>;
26
26
 
27
27
  export default class ReadOnlyNode {
28
28
  constructor(internalInstanceHandle: InternalInstanceHandle) {
29
+ // This constructor is inlined in `ReactNativeElement` so if you modify
30
+ // this make sure that their implementation stays in sync.
29
31
  setInstanceHandle(this, internalInstanceHandle);
30
32
  }
31
33
 
@@ -293,7 +295,7 @@ export function getInstanceHandle(node: ReadOnlyNode): InternalInstanceHandle {
293
295
  return node[INSTANCE_HANDLE_KEY];
294
296
  }
295
297
 
296
- function setInstanceHandle(
298
+ export function setInstanceHandle(
297
299
  node: ReadOnlyNode,
298
300
  instanceHandle: InternalInstanceHandle,
299
301
  ): void {