Skip to content
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

☂️ npm packages for react-native-web #35263

Open
4 of 13 tasks
necolas opened this issue Nov 8, 2022 · 21 comments
Open
4 of 13 tasks

☂️ npm packages for react-native-web #35263

necolas opened this issue Nov 8, 2022 · 21 comments
Labels
API: Animated Component: FlatList Component: SectionList Component: VirtualizedList Help Wanted :octocat: Issues ideal for external contributors. JavaScript ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo

Comments

@necolas
Copy link
Contributor

necolas commented Nov 8, 2022

Description

These are spillover tasks from the W3C props & styles projects. The aim is to move user-space modules into their own packages within the monorepo. React Native for Web must currently copy-paste-edit these modules. Publishing these modules as npm packages will allow React Native and React Native for Web to depend on the same implementations, providing users of cross-platform React with a more reliable foundation (and making it easier for RNWeb to be maintained.)

Once again we're looking for the community's help! If you're interested in helping to reorganize the RN monorepo, you could contribute by helping to move these modules into packages with @cortinico's oversight. If you're interested in improving consistency between RN and RNWeb, you could contribute by helping to prepare those new packages for npm publication and consumption by RNWeb. We're also open to suggestions and feedback on how to proceed.

Animated

VirtualizedList

FlatList

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Nov 8, 2022
@necolas necolas added JavaScript Help Wanted :octocat: Issues ideal for external contributors. API: Animated Component: SectionList Component: VirtualizedList Component: FlatList and removed Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. labels Nov 8, 2022
@facebook facebook deleted a comment from github-actions bot Nov 8, 2022
@gabrieldonadel
Copy link
Collaborator

  • Move FlatList and SectionList to a separate package called @react-native/flat-lists (name tbd?) within packages/flat-lists.

@necolas let me just double-check this for clarity, if I understand this correctly @react-native/flat-lists would have @react-native/virtualized-lists as a dependency, right?

Do we have plans on how to handle local changes in order to test these? AFAIK metro does not support symlinks

@necolas
Copy link
Contributor Author

necolas commented Nov 8, 2022

If I understand this correctly @react-native/flat-lists would have @react-native/virtualized-lists as a dependency, right?

yeah I think so

AFAIK metro does not support symlinks

does it not support Node.js resolution? we already have other packages broken out

@kelset
Copy link
Contributor

kelset commented Nov 18, 2022

@necolas you can read more about the symlink stuff here: #34692 (comment) (once we figure it out for that effort, the learning will be useful here too)

@gabrieldonadel
Copy link
Collaborator

  • Move VirtualizedList and VirtualizedSectionList to a separate package called @react-native/virtualized-lists within packages/virtualized-lists.

@necolas should we also include the RefreshControl component in this package as it's used by VirtualizedList?

@Pranav-yadav
Copy link
Contributor

Pranav-yadav commented Nov 21, 2022

Move FlatList and SectionList to a separate package called @react-native/flat-lists (name tbd?) within packages/flat-lists.

@necolas / @kelset I've tried to move the FlatLists to @react-native/flat-lists package; here [DRAFT] #35423
If any concerns1; do let me know under the PR

Edit: Also lmk 👇

(name tbd?)

PS: I'm following things discussed here as well as @gabrieldonadel 's PR :)

Footnotes

  1. I will wait for @react-native/virtualized-lists to merge and update the same in PR. Till then y'all can give feedback :)

@lunaleaps
Copy link
Contributor

If any packages land before 0.72 is cut then we might need to create separate DT types for each separated package (only to be deprecated for 0.73)

@cortinico
Copy link
Contributor

Once again we're looking for the community's help! If you're interested in helping to reorganize the RN monorepo, you could contribute by helping to move these modules into packages with @cortinico's oversight

Thanks for the ping @necolas
Sharing it here but I've been flagging it on a couple of PRs:
all the newly created packages should be scoped under @react-native and versioned as 0.72.0.

Additionally, you might face failures on CircleCI for template tests till those packages are published to NPM. We're looking into either using Verdaccio or other solutions to overcome those limitations (cc @hoxyq)

hoxyq added a commit to hoxyq/react-native that referenced this issue Nov 23, 2022
…before testing template app

Summary:
Changelog:
[Internal][Changed] - now using Verdaccio to publish necessary packages for template app

- Adds script `/scripts/template/install-dependencies.js`, which incapsulates the logic of installing dependencies of template app
- The idea of the script is to run verdaccio and publish all necessary packages to node_modules, since these packages might not yet be present on npm
- This should also potentially resolve some template app test failures on CircleCI related to [package-ifying Animated, VirtualizedList, FlatList modules](facebook#35263)

Differential Revision: D41498086

fbshipit-source-id: 1b185857c21f4cf4996fb1fa4faca5f9e77f534f
hoxyq added a commit to hoxyq/react-native that referenced this issue Nov 23, 2022
…before testing template app (facebook#35444)

Summary:
Pull Request resolved: facebook#35444

Changelog:
[Internal][Changed] - now using Verdaccio to publish necessary packages for template app

- Adds script `/scripts/template/install-dependencies.js`, which incapsulates the logic of installing dependencies of template app
- The idea of the script is to run verdaccio and publish all necessary packages to node_modules, since these packages might not yet be present on npm
- This should also potentially resolve some template app test failures on CircleCI related to [package-ifying Animated, VirtualizedList, FlatList modules](facebook#35263)

Differential Revision: D41498086

fbshipit-source-id: adf19f547e552ff2f438a645f03f225921514d5e
hoxyq pushed a commit to hoxyq/react-native that referenced this issue Feb 1, 2023
…book#35406)

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 facebook#35263

## Changelog

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

Pull Request resolved: facebook#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

Differential Revision: D41745930

Pulled By: hoxyq

fbshipit-source-id: 67a971a3f06895bce360a7463c66a6b1f334f46b
facebook-github-bot pushed a commit that referenced this issue Feb 6, 2023
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
@jacobp100
Copy link
Contributor

Is there a goal here too to not have these packages's JS bundled in an RN app that's not using them? So if I'm not using FlatList, I won't have the JS bundled in my app?

@necolas
Copy link
Contributor Author

necolas commented Feb 15, 2023

Do we have an idea of when we will start publishing packages to npm with Flow types compiled out / to comments? It's currently not feasible for React Native for Web to depend on @react-native/virtualized-lists while the code on npm is invalid JS - https://www.npmjs.com/package/@react-native/virtualized-lists

@necolas
Copy link
Contributor Author

necolas commented Feb 21, 2023

I am still repeatedly answering issues from people who wonder why RN npm packages crash in web bundlers necolas/react-native-web#2490

@hoxyq
Copy link
Contributor

hoxyq commented Feb 22, 2023

Do we have an idea of when we will start publishing packages to npm with Flow types compiled out / to comments? It's currently not feasible for React Native for Web to depend on @react-native/virtualized-lists while the code on npm is invalid JS - https://www.npmjs.com/package/@react-native/virtualized-lists

I feel like this could be in scope of this project, maybe a separate task to support this across packages. Because this is not the part of monorepo project so far, and looks like virtualized-lists and flat-lists both should have it to be supported by react-native-web

@necolas
Copy link
Contributor Author

necolas commented Mar 21, 2023

There are a number of significant stakeholders, like Expensify, who depend on RN for their cross-platform product. And it seems to be an ongoing source of issues for them that these major modules are not kept in sync across native and web. I think we really need to get these modules into installable packages and published as compiled JS ASAP.

@AndrewGable
Copy link
Contributor

@necolas - Agreed, we do depend on React Native for our cross-platform product (react-native-web included). Please let us know if/how we (Expensify) can help move this project along. If there is anything we can do from implementation, design, or sponsor work; we are happy to help.

@necolas
Copy link
Contributor Author

necolas commented Mar 28, 2023

Thanks. Any of the incomplete tasks above are in need of attention. We still need to compile to JS before publishing too. I don't think there's a mechanism for automatic publishing yet, but manually publishing the packages once they've been created would be good enough for RNW to start the transition.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this issue May 22, 2023
…book#35406)

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 facebook#35263

## Changelog

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

Pull Request resolved: facebook#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
@Maxime-p
Copy link

Maxime-p commented Jun 6, 2023

Hi,
Small question.
Why this issue isn't tag with a label "☂️ Umbrella"?
I am looking for a good first issue to contribute and I searched with the label and not all Umbrella issues appeared cause they are not tagged.
Sorry if I'm irrelevant.

@cortinico cortinico added the ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo label Jun 6, 2023
@cortinico
Copy link
Contributor

Why this issue isn't tag with a label "☂️ Umbrella"?

That was an oversight on our end, we added it now

@MCanhisares
Copy link
Contributor

@necolas @cortinico do you guys still need help? I'm more than happy to take a look at some of these;
Move Animated to a separate package called @react-native/animated within packages/animated. sounds fun

@DylanTet
Copy link

Started working on Move Animated to a separate package called @react-native/animated within packages/animated. @necolas @cortinico . Just trying to figure out which files need to be moved to the new folder.

@gabrieldonadel
Copy link
Collaborator

Started working on Move Animated to a separate package called @react-native/animated within packages/animated. @necolas @cortinico . Just trying to figure out which files need to be moved to the new folder.

@DylanTet I don't have the bandwidth to work on this right now but you can use my PR as a base for what needs to be changed #35467

@DylanTet
Copy link

@gabrieldonadel thanks man! Looking at it now, if you dont mind me asking, what exactly did you guys mean by having issues with the new monorepo structure?

@fnwk
Copy link

fnwk commented Jan 26, 2024

@necolas Hey, if no one is working on it, i can take care of "Move Animated to a separate package called @react-native/animated within packages/animated."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Animated Component: FlatList Component: SectionList Component: VirtualizedList Help Wanted :octocat: Issues ideal for external contributors. JavaScript ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo
Projects
None yet
Development

No branches or pull requests