react-native-macos/Libraries
Nick Gerleman 971599317b Ship VirtualizedList_EXPERIMENTAL
Summary:
`VirtualizedList_EXPERIMENTAL` is a fork of VirtualizedList. It was originally created for the purpose of keyboard/a11y fixes, which required the list to allow rendering discontiguous regions of cells. So, the large part of the refactor is in the data structure used to represent state (now a sparse bitmask), and building out the render function to operate off the bitmask.

This structure allows pre-rendering areas where we know focus must be able to be synchronously be moved to. This is exercised on platforms like Windows and macOS which fire view level focus events. The new implementation otherwise aims to preserve near-exact list behavior as previously.

Apart from the structure change, the refactor has made the code (subjectively) a lot easier to reason about, and there are now stronger internal invariants than before. The bitmask structure also enables new approaches for nested list stability, and implementing OffScreen.

**Why ship it now?**

Having two implementations has multiple times prevented other changes to VirtualizedList, so it is incurring a constant engineer cost.

At this point, we have a lot of reason to be confident in the maturity of the new list implementation (see the test plan below). So, reconciling the implementations not only unlocks the enhancements of the new list, but unblocks future changes to VirtualizedList.

## Test Plan

1. **Unit tests:** A few dozen unit tests were added to VirtualizedList, validating the regions it renders in response to injected input, across its API surface. Both VirtualizedList implementations must pass the same tests, around expected behavior.
2. **RNTester:** Scenarios in RNTester were manually validated, and all worked as before
3. **New invariants:** I added a lot of internal logic checks and bounds checks as invariant violations, to try to produce signal if any part of the refactor went unexpected in the wild.
4. **MSFT Rollout:** I rolled out the changes as a fork of VirtualizedList at MSFT to a couple of high-usage surfaces using Android, iOS, and Windows on Paper. Some invariant violations were surfaced and fixed, but telemetry showed solid system and scenario health with the change.
5. **Meta import:** Fixed all land-blocking test failures when using the new list. These were confined to updating snapshots, and adding additional checks for invalid input.
6. **Panel apps:** Manually validated top-level surfaces of panel apps in debug/release modes. Fixed a couple of invariant violations and novel usages. Profiled new JS structures against an expensive list with Hermes profiler.
7. **Facebook App Rollout:** After some manual validation of top-level surfaces, the change was rolled out to Facebook for Android and iOS as an experiment. New invariant violations were fixed, and the change has sat in production for several weeks at this point, while measuring impact to metrics like error rate, responsiveness, and impressions.

This is the first introduction to all of OSS, and some Meta internal apps. This means there may still be novel usages of VirtualizedList that were not picked up during testing, but I think there has been enough diligence to roll out what has been tested, and forward fix anything unexpected that might still come up.

Changelog:
[General][Changed] - Ship VirtualizedList_EXPERIMENTAL

Reviewed By: javache

Differential Revision: D40259791

fbshipit-source-id: 63eee9381d197a1e38ae663b2158436ff135c0e1
2022-10-13 05:04:40 -07:00
..
ActionSheetIOS RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Alert RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Animated Apply Animated initialProps handling to Fabric only (#34927) 2022-10-11 03:35:58 -07:00
AppDelegate Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
AppState RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
BatchedBridge Deploy 0.188.0 to xplat 2022-09-29 14:31:12 -07:00
Blob Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
BugReporting RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Components fix: Update incorrect `SwitchChangeEvent` type (#34931) 2022-10-12 13:05:35 -07:00
Core Remove unnecessary checks for profiling in dev mode 2022-10-05 15:17:53 -07:00
EventEmitter RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Events RN: Cleanup Existing ESLint Warnings 2022-08-12 17:16:40 -07:00
FBLazyVector Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
HeapCapture RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Image Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Inspector Annotate empty objects in xplat 2022-10-06 13:19:11 -07:00
Interaction RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
JSInspector RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
LayoutAnimation RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Linking RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
LinkingIOS Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Lists Ship VirtualizedList_EXPERIMENTAL 2022-10-13 05:04:40 -07:00
LogBox RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Modal RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
NativeAnimation Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
NativeComponent RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
NativeModules/specs RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Network Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
NewAppScreen RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Performance Remove import cycle from Systrace module 2022-10-07 07:18:42 -07:00
PermissionsAndroid RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Pressability RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
PushNotificationIOS Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
RCTRequired Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
ReactNative hook up offscreen api to runApplication 2022-10-07 18:13:04 -07:00
ReactPrivate RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Reliability Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
Renderer Place TypeScript Declarations Alongside Source Files 2022-09-26 12:09:45 -07:00
Settings Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Share RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Storage RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
StyleSheet feat: Add support for verticalAlign style (#34567) 2022-10-03 05:57:30 -07:00
SurfaceBackedComponent Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
SurfaceHostingComponent Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Text Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
TurboModule RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
TypeSafety Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Types RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
Utilities Ship VirtualizedList_EXPERIMENTAL 2022-10-13 05:04:40 -07:00
Vibration Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
WebSocket Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
Wrapper Remove clang-format opt-out for Libraries 2022-10-13 02:23:13 -07:00
YellowBox RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
__flowtests__ RN: Sort Imports via ESLint 2022-09-30 14:28:48 -07:00
vendor RN: Fix Copyright on `EventEmitter-test.js` 2022-09-30 01:15:29 -07:00
.npmignore npmignore: ignore tests and fixtures 2018-02-27 08:42:14 -08:00
Promise.js Remove nonstandard Promise.prototype.done implementation 2022-05-05 03:55:10 -07:00
UTFSequence.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
promiseRejectionTrackingOptions.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00