mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Limit @react-native/virtualized-lists subpath imports (#50392)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50392 ## This diff Defines an exports field for the "react-native/virtualized-lists" package. Limits internal use of subpath imports to virtualized-lists package, and exports all currently used APIs one the root level. Changelog: [General][Breaking] - Subpath imports to the internal react-native/virtualized-lists package are not allowed. Reviewed By: huntie Differential Revision: D72162344 fbshipit-source-id: 828dab8e569f019fc48084af475e152b898f5bb5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9a87bb2223
commit
be8393c41b
@@ -8,7 +8,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {ListRenderItemInfo} from '../../../../virtualized-lists/Lists/VirtualizedListProps';
|
||||
import type {ListRenderItemInfo} from '../../../../virtualized-lists';
|
||||
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
@@ -10,12 +10,18 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import typeof ChildListCollection from './Lists/ChildListCollection';
|
||||
import typeof FillRateHelper from './Lists/FillRateHelper';
|
||||
import typeof ViewabilityHelper from './Lists/ViewabilityHelper';
|
||||
import typeof VirtualizedList from './Lists/VirtualizedList';
|
||||
import typeof VirtualizedSectionList from './Lists/VirtualizedSectionList';
|
||||
|
||||
import {typeof VirtualizedListContextResetter} from './Lists/VirtualizedListContext';
|
||||
import {
|
||||
typeof VirtualizedListCellContextProvider,
|
||||
typeof VirtualizedListContext,
|
||||
typeof VirtualizedListContextProvider,
|
||||
typeof VirtualizedListContextResetter,
|
||||
} from './Lists/VirtualizedListContext';
|
||||
import {keyExtractor} from './Lists/VirtualizeUtils';
|
||||
|
||||
export type {
|
||||
@@ -49,8 +55,19 @@ export default {
|
||||
return require('./Lists/VirtualizedSectionList').default;
|
||||
},
|
||||
get VirtualizedListContextResetter(): VirtualizedListContextResetter {
|
||||
const VirtualizedListContext = require('./Lists/VirtualizedListContext');
|
||||
return VirtualizedListContext.VirtualizedListContextResetter;
|
||||
return require('./Lists/VirtualizedListContext')
|
||||
.VirtualizedListContextResetter;
|
||||
},
|
||||
get VirtualizedListContext(): VirtualizedListContext {
|
||||
return require('./Lists/VirtualizedListContext').VirtualizedListContext;
|
||||
},
|
||||
get VirtualizedListContextProvider(): VirtualizedListContextProvider {
|
||||
return require('./Lists/VirtualizedListContext')
|
||||
.VirtualizedListContextProvider;
|
||||
},
|
||||
get VirtualizedListCellContextProvider(): VirtualizedListCellContextProvider {
|
||||
return require('./Lists/VirtualizedListContext')
|
||||
.VirtualizedListCellContextProvider;
|
||||
},
|
||||
get ViewabilityHelper(): ViewabilityHelper {
|
||||
return require('./Lists/ViewabilityHelper').default;
|
||||
@@ -58,4 +75,7 @@ export default {
|
||||
get FillRateHelper(): FillRateHelper {
|
||||
return require('./Lists/FillRateHelper').default;
|
||||
},
|
||||
get ChildListCollection(): ChildListCollection {
|
||||
return require('./Lists/ChildListCollection').default;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
"version": "0.80.0-main",
|
||||
"description": "Virtualized lists for React Native.",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/react-native.git",
|
||||
|
||||
Reference in New Issue
Block a user