Skip to content

Commit

Permalink
feat: Move virtualized lists to @react-native/virtualized-lists (#35406)
Browse files Browse the repository at this point in the history
Summary:
This PR moves `VirtualizedList`, `VirtualizedSectionList`, and its files to a separate package called `react-native/virtualized-lists` located under `packages/virtualized-lists` as proposed on #35263

## Changelog

[General] [Changed] - Move virtualized lists to react-native/virtualized-lists package

Pull Request resolved: #35406

Test Plan:
1. Open the RNTester app and navigate to `FlatList` or `SectionList` page
2. Test virtualized lists through the many sections

https://user-images.githubusercontent.com/11707729/202878843-2b1322f5-cfee-484e-aaf3-d8d4dc0b96cc.mov

Reviewed By: cipolleschi

Differential Revision: D41745930

Pulled By: hoxyq

fbshipit-source-id: d3d33896801fd69448c6893b86fd5c2363144fd0
  • Loading branch information
gabrieldonadel authored and facebook-github-bot committed Feb 6, 2023
1 parent 62fa6d9 commit 2e3dbe9
Show file tree
Hide file tree
Showing 46 changed files with 3,100 additions and 2,927 deletions.
2 changes: 1 addition & 1 deletion Libraries/Inspector/NetworkOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import type {RenderItemProps} from '../Lists/VirtualizedList';
import type {RenderItemProps} from '@react-native/virtualized-lists';

const ScrollView = require('../Components/ScrollView/ScrollView');
const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Lists/FlatList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ListRenderItem,
ViewToken,
VirtualizedListProps,
} from './VirtualizedList';
} from '@react-native/virtualized-lists';
import type {ScrollViewComponent} from '../Components/ScrollView/ScrollView';
import {StyleProp} from '../StyleSheet/StyleSheet';
import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
Expand Down
11 changes: 7 additions & 4 deletions Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
import typeof ScrollViewNativeComponent from '../Components/ScrollView/ScrollViewNativeComponent';
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
import type {
RenderItemProps,
RenderItemType,
ViewabilityConfigCallbackPair,
ViewToken,
} from './ViewabilityHelper';
import type {RenderItemProps, RenderItemType} from './VirtualizedList';
} from '@react-native/virtualized-lists';

import {type ScrollResponderType} from '../Components/ScrollView/ScrollView';
import VirtualizedList from './VirtualizedList';
import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils';
import {
VirtualizedList,
keyExtractor as defaultKeyExtractor,
} from '@react-native/virtualized-lists';
import memoizeOne from 'memoize-one';

const View = require('../Components/View/View');
Expand Down
9 changes: 7 additions & 2 deletions Libraries/Lists/FlatList.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ const View = require('../Components/View/View');
import typeof ScrollViewNativeComponent from '../Components/ScrollView/ScrollViewNativeComponent';
import {type ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
import type {RenderItemType} from './VirtualizedList';
import typeof VirtualizedList from './VirtualizedList';
import type {
RenderItemType,
RenderItemProps,
ViewToken,
ViewabilityConfigCallbackPair,
} from '@react-native/virtualized-lists';
import {typeof VirtualizedList} from '@react-native/virtualized-lists';

type RequiredProps<ItemT> = {|
/**
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Lists/SectionList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type * as React from 'react';
import type {
ListRenderItemInfo,
VirtualizedListWithoutRenderItemProps,
} from './VirtualizedList';
} from '@react-native/virtualized-lists';
import type {
ScrollView,
ScrollViewProps,
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Lists/SectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {
Props as VirtualizedSectionListProps,
ScrollToLocationParamsType,
SectionBase as _SectionBase,
} from './VirtualizedSectionList';
VirtualizedSectionListProps,
} from '@react-native/virtualized-lists';

import Platform from '../Utilities/Platform';
import VirtualizedSectionList from './VirtualizedSectionList';
import {VirtualizedSectionList} from '@react-native/virtualized-lists';
import * as React from 'react';

type Item = any;
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Lists/SectionListModern.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {
Props as VirtualizedSectionListProps,
ScrollToLocationParamsType,
SectionBase as _SectionBase,
} from './VirtualizedSectionList';
VirtualizedSectionListProps,
} from '@react-native/virtualized-lists';
import type {AbstractComponent, Element, ElementRef} from 'react';

import Platform from '../Utilities/Platform';
import VirtualizedSectionList from './VirtualizedSectionList';
import {VirtualizedSectionList} from '@react-native/virtualized-lists';
import React, {forwardRef, useImperativeHandle, useRef} from 'react';

type Item = any;
Expand Down
Loading

0 comments on commit 2e3dbe9

Please sign in to comment.