-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Move FlatList
s to @react-native/flat-lists
package
#35423
Feat: Move FlatList
s to @react-native/flat-lists
package
#35423
Conversation
Base commit: 928f4fb |
Base commit: d9ade19 |
PR build artifact for 083b044 is ready. |
PR build artifact for 083b044 is ready. |
083b044
to
de2c5be
Compare
This comment was marked as resolved.
This comment was marked as resolved.
PR build artifact for de2c5be is ready. |
PR build artifact for de2c5be is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at the feedback on the VirtualizedList PR. Specifically:
- We should not be reaching inside any packages. Instead
@react-native/flat-lists
should export everything that can be imported, and it should import fromreact-native
and not internal paths. - This package should have the virtualized-lists package as a dependency, rather than creating circular dependencies.
17ce59e
to
c3302ac
Compare
PR build artifact for 17ce59e is ready. |
PR build artifact for 17ce59e is ready. |
PR build artifact for c3302ac is ready. |
PR build artifact for c3302ac is ready. |
c3302ac
to
0074ab5
Compare
PR build artifact for 0074ab5 is ready. |
PR build artifact for 0074ab5 is ready. |
This comment was marked as resolved.
This comment was marked as resolved.
0074ab5
to
6103302
Compare
PR build artifact for 6103302 is ready. |
PR build artifact for 6103302 is ready. |
6103302
to
dcb0a87
Compare
PR build artifact for dcb0a87 is ready. |
PR build artifact for dcb0a87 is ready. |
2429a77
to
d67acb3
Compare
a6ce399
to
9e18d0a
Compare
@NickGerleman / @hoxyq I have rebased this PR on main as the Update:
cc: @necolas |
@necolas re-pinging, in case you missed.. 🙂 Edit: cc @cortinico |
@NickGerleman please let me know if should rebase again so that you can review it afterwards. I know this might not be prioritized but, I don't have any idea about it as well; (no one is replying), hence pinging again. |
9e18d0a
to
eb493e8
Compare
b4fc24f
to
0b9a654
Compare
0b9a654
to
94c33d8
Compare
Sorry I haven't been able to take a close look at this (though it seems like you found some help on the Discord). Though as a general bit of feedback, I'm not sure it makes sense to add a new plural |
They both also have the section list variant |
No worries :)
I did consider that at the start only but, it's not a
variants as well.. as Nicolas said.
Yeah. |
6b4891a
to
600c5af
Compare
Summary: This diff moves `FlatList` and `SectionList` to a new package `@react-native/flat-lists`. This is a first step towards moving all the `FlatList`-related code to a separate package. This will allow us to make changes to the `FlatList` implementation without affecting the rest of the React Native codebase. Changelog: [General] [Changed] - Move `FlatList`s to `@react-native/flat-lists` package. `FlatList` and `SectionList` are now available in `@react-native/flat-lists` package. **Warning**: This though this is NOT a breaking change, and you will NOT need to update your imports to use the new package. But, moving forward it will be better to install `@react-native/flat-list` if you want to import explicitly.
600c5af
to
7184780
Compare
🎉 All Green !!Will anyone import this? |
*/ | ||
|
||
import typeof ScrollViewNativeComponent from 'react-native'; | ||
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can we avoid having any imports from RN internals in this package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I forgot that; this way it may not work in external projects.
Right now I'm in college, will try to change it once I reach home.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I'm busy with assignment tests at college, will try to look at this; tomorrow eod..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we avoid having any imports from RN internals in this package
@necolas in order to avoid all of them, we'll need to export some other modules from react-native
such as,
deepDiffer
@NickGerleman Are there any issues against that? If no issues, then should I open separate PR(s) for those changes or it is fine to do it in this PR only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies if this has been discussed already, but might it be simpler to just include these files in the @react-native/virtualized-lists package? Is there any advantage to keeping them separate? Edit: Oh, this is the same feedback @NickGerleman had above: #35423 (comment) |
Theoretically "Yes". But, both lists were implemented and exist for a special (different) purpose, keeping them separate would support the initial cause of "separation of concerns". If we combine them into a "single" package:
WDYT? P.S.: Personally, I would've loved to have them in a single package named |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Summary
This PR moves
FlatList
,SectionList
and related files (tests, etc.) to a new package@react-native/flat-lists
located underpackages/flat-lists
as proposed in #35263This is a first step towards moving all the
FlatList
-related code to a separate package.This will allow us to make changes to the
FlatList
implementation without affecting the rest of the React Native codebase.Changelog
[General] [Changed] - Move
FlatList
s to@react-native/flat-lists
package.FlatList
andSectionList
are now available in@react-native/flat-lists
package.Warning: This is a breaking(?) change, and you may need to update your imports to use the new package.
Test Plan
yarn lint && yarn flow && yarn test
is#00ff00