question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

☂️ React Native Monorepo

See original GitHub issue

Hey all, I’m opening this task to keep track of the effort to implement the React Native Monorepo RFC:

In this first phase of the work, we’re looking into only:

  • Renaming the packages under packages/ (i.e. updating the name field) to follow the naming convention suggested in the RFC (@react-native/...)
  • Updating the version to be 0.71.0 And the necessary related infra.

At this stage we’re not looking into renaming the folders of such packages.

Here the list of tasks that needs to be handled:

All the related PRs/Issues for this effort are labelled as Tech: Monorepo.

When doing one of those tasks, first let’s make sure the CI is green first (specifically the test_js task). Once your PR is green, we’re going to import it internally, and expect some turnaround time as those changes are going to require internal changes on our end as well.

Please comment below if you’re willing to take the stance on any of those task and wait for a confirmation before start working on it.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
hoxyqcommented, Nov 17, 2022

A quick update on this task so far, since I’ve flooded it with the references from my PRs.

Seems like all internal problems (from Meta internal code) are resolved, right now I am working on resolving some problems with CircleCI. I will provide more context and details when I will able fully validate the solution.

The main problem is that Yarn workspaces produce packages as a symlinks inside node_modules, which might not work as expected in some build scripts. This is also relevant for Metro, that’s why I’ve changed absolute paths to relevant in some files. As suggested by @cortinico, I am also using Verdaccio for template app tests on CircleCI, since it depends on eslint-config and codegen packages

4reactions
hoxyqcommented, Dec 6, 2022

Hey, all changes are finally merged 🎉

How it works now

We are using Verdaccio as a local npm registry in three different places in our CI:

  1. Running e2e tests
  2. Building react-native package
  3. Building template package

Each package, which is not marked as private, is being published to Verdaccio. This helps us to resolve the issue that all renamed packages are not yet present in npm registry. This approach should also help in release cycle when we will finally migrate to a proper monorepo structure: we might bump versions of some packages (without publishing them to npm), but they should be always available via Verdaccio.

Known problems

We use command yarn --json workspaces info to get a list of all packages that we publish, but at some point in release CI we remove workspaces from react-native’s package.json, so using yarn --json workspaces info results in an error. This was shared by @cipolleschi while working on 0.71.0 release, maybe @kelset can share some details about it.

Next steps

As shared in original proposal, we will be working on setting up CI to automate versions bumping and packages publishing. We have also started a discussions around what to migrate to a separate package and how to make it happen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up React Native Monorepo with Yarn Workspaces
A monorepo is a single repository that holds a multitude of projects with all their code and assets. While the projects can be...
Read more >
React Native Core Contributor Summit 2022
After years of pandemic and online-only events, we really felt it was time to bring the Core Contributors of React Native together!
Read more >
Getting Started - monorepo guide
After installing React, within the packages/button directory, create a directory called src . Within the src directory, create an index.js file which will ......
Read more >
Behind the Scenes: Improving the Repository Infrastructure
Ever since React was split into packages, it has been a monorepo: a set of packages under the umbrella of a single repository....
Read more >
Monorepos in RN | React Native London | February 2022
Callum Hemsley: Running React Everywhere: Monorepos in RNPopularised by tech giants like Google, monorepos have become increasingly popular ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found