Skip to content

☂️ Lean Core #23313

Closed
Closed
@cpojer

Description

@cpojer

For the past several months we have been discussing and making progress on a project called “Lean Core”. Please read our motivation for this project. Over the years React Native has accumulated a lot of parts that are now outdated, unused or otherwise legacy. It's time to clean everything up and put the repository into a much more manageable state going forward.

This is an umbrella task intended to track all the work necessary to reach the goal of a leaner core, including work around repository reorganization. This issue is being kept up to date so new items will be added and completed ones will be (re)moved. Some of the items will spawn separate issues to track work. If you don't see a name assigned to any of the below items and you would like to help out, please volunteer in the comments and reach out to me to get started!

Components & Runtime

React Native currently comes with a large number of components, many of which are deprecated or outdated but they still part of the repository and increase the size of applications. For items in this section we are either looking to completely remove things if they are unused, or we'd like to move them either to community managed repositories or otherwise to facebookarchive. The list here is partially based on an awesome investigation by @axe-fb. The migration can be done roughly by following @matt-oakes's guide from further below: #23313 (comment)

Third-Party Dependencies

Over the years we have amassed a large amount of dependencies, especially JavaScript. We have also moved things out of React Native, like Metro and the react-native-cli. This means we left a large amount of tooling dependencies in our package.json, many of which will are unused by RN itself and won't be updated to the latest versions, causing the full install of React Native to be bloated. It would also be great to do an audit of all the dependencies that are used and identify which ones could be removed.

  • JavaScript Dependencies
    • Check which dependencies are large and whether they can be made smaller
    • Figure out which dependencies can be upgraded to their latest versions for security fixes
    • Figure out which dependencies can be deduplicated (= reduce version mismatches) for smaller install size
  • Move React Native code to external dependencies
    • Identify which JavaScript code could be better served by a third-party package instead of maintaining a copy or our own implementation

Repository Structure

Right now the React Native repository is a large repository with little organization that promotes separation of concerns. It is our goal as part of this effort to also move things into a more manageable structure. As part of this, we'd like to follow a monorepo model that consists of multiple smaller packages. This will be a gradual migration and we will only be tracking the initial work to get this off the ground.

  • Provide an initial setup that works with the existing repository, with multiple packages and also plays nicely with Facebook's internal setup (@cpojer)
  • TODO: Identify more work necessary in this area

Completed work

Click to see prior work before this issue was created

Metadata

Metadata

Assignees

Labels

☂️ UmbrellaTo label issues that serve as coordination point and drivers for tasks in the react-native repoGood first issueInterested in collaborating? Take a stab at fixing one of these issues.Help Wanted :octocat:Issues ideal for external contributors.Ran CommandsOne of our bots successfully processed a command.Type: DiscussionLong running discussion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions