Skip to content

Support react-native 0.80#3530

Merged
m-bert merged 38 commits intomainfrom
@mbert/monorepo-80rc2
Jun 13, 2025
Merged

Support react-native 0.80#3530
m-bert merged 38 commits intomainfrom
@mbert/monorepo-80rc2

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented May 23, 2025

Description

This PR adds support for react-native 0.80

  • 0.80.0 ✅

  • 0.80.0-rc.5 ✅
  • 0.80.0-rc.4 ✅
  • 0.80.0-rc.3 ✅
  • 0.80.0-rc.2 ✅
  • 0.80.0-rc.1 ✅
  • 0.80.0-rc.0 ✅

Test plan

Tested that basic-example builds and works correctly

m-bert and others added 29 commits April 11, 2025 14:48
## Description

This PR moves config files to root level in monorepo.

> [!NOTE]
> `prepare` was changed to `postinstall`, however this change is already on `main` so it shouldn't be critical.

## Test plan

- [x] Perform test commit to check if commit hooks work
- [x] Build package and install it on external app
## Description

This PR removes currently existing example apps and adds `BasicExample` app - previously `FabricExample`

## Test plan

Build and run `BasicExample` on android and ios
## Description

This PR adds `ExpoExample` app into our repository. This will replace old `example`.

## Test plan

Test `ExpoExample` on `iOS`, `android` and `web`
## Description

This PR adds MacOSExample app to monorepo.

>[!NOTE]
>This app contains only basic examples. It will be merged with `ExpoExample` in upcoming PR

>[!WARNING]
>This PR lacks support for `clangd` introduced in #3069. I'd like to add it right away, but I'm not yet sure where to put required scripts

## Test plan

Build & run MacOSExample
## Description

This PR adds `CommonApp` that holds shared source code for our examples.

## Test plan

Run `ExpoExample` and `MacOSExample`
## Description

This PR updates paths used in github actions. Here we should focus on paths that are responsible for building example apps, linter will be fixed in upcoming PRs

## Test plan

Check CIs
## Description

This PR sets up `eslint`, `prettier` and `tsc` so that we can finally run lint checks in monorepo.

Each workspace has `ts-check` and `lint-js` scripts which run in given workspace. Running those scripts in `root` results in running them in each workspace. 

> [!NOTE]
> Running those scripts from `root` does not trigger any checks in `ExpoExample` and `MacOSExample`, as they only export app from `CommonApp`

## Test plan

Run `yarn ts-check` and `yarn lint-js` from `root`.
## Description

This PR moves `scripts` directory to root of the monorepo. It also

- Brings back `clangd` support,
- Renames some of scripts to be [global](https://yarnpkg.com/features/workspaces#global-scripts)

## Test plan

Check that CI passes and that building iOS app generates `compile_commands.json` file.
## Description

This PR bumps `spotless` (android formatter) to version 7.0.3.

## Test plan

Run `yarn lint:android`
## Description

This PR adds `PAPER_ENABLED` environmental variable in order to easily switch to old architecture in `ExpoExample`. It also adds CIs that test paper build on both platforms. 

## Test plan

Verified in `App.tsx` with the following snippet:

```jsx
const uiManager = global?.nativeFabricUIManager ? 'Fabric' : 'Paper';
console.log(`Using ${uiManager}`);
```

Check that CIs pass.
## Description

This PR consists of changes that aim to clean repository after moving into monorepo, namely:

- Unify quotations in github workflows
- Remove unnecessary config files
- Remove unnecessary dependencies
- Changes scripts:
  - Android format script now drops argument instead of only working at one file. I wanted to make it work only on staged files, however it takes a lot of time since `gradle` has to start over and over. Unfortunately, multiple files for `spotlessIdeHook` [are not in the roadmap](diffplug/spotless#791 (comment)).
  - Added apple format script which formats only staged files (or whole apple codebase if run without argument)
  - Added script for checking whether staged android files are included in `package.json` 😅 
- Make sure that `lint-staged` operates only on staged files (if possible)
- Remove `e2e` app
- Add `yarn clean` script

## Test plan

Check that CIs pass and example apps work as expected
## Description

When tried to update `react-native` to `0.80.0-rc.1` I've noticed that hoisting doesn't work as it should - `BasicExample` had version `0.80.0-rc.1` in its `node_modules`, but the version hoisted to root was `0.79.0`.  This resulted in errors during `pods` installation. To get rid of this problem we need to do 2 thing:

1. Change `react-native` to `peerDependency` in `CommonApp`,
2. Update both, `BasicExample` and `react-native-gesture-handler` `package.json` files at the same time. This ensures that version hoisted to root will be the same. 

Other apps should not be affected since they have `hoistingLimits: "workspaces"`.

This PR also adds `selfReferences: false` - with this change, apps won't be referenced in root `node_modules`

## Test plan

Checked how hoisting behaves with different react-native versions across monorepo.
## Description

This PR renames example apps an the ones generated by CLI are not valid (namely `name` field in `package.json` cannot be uppercased).

It also:

- Adds `yarn paper` script into `expo-example` app
- Adds `yarn macos` into `macos-example` app
- Removes `selfReferences` from `common-app` as without it `macos-example` doesn't start (expo seems to handle it better)

## Test plan

Checked that example apps work
## Description

`yarn validation` CI performs `yarn install` in all changed directories that contain `package.json`. However, we have some directories which should not undergo this procedure:

- DrawerLayout
- ReanimatedDrawerLayout
- Swipeable
- ReanimatedSwipeable
- jest-utils

## Test plan

Hopefully CI on main monorepo PR passes
## Description

When I tried to install _**GestureHandler**_ from newly created package, it fails with message:

```
command not found: bob
```

This PR moves `bob build` into `build` script (as it is already done in [Reanimated](https://github.com/software-mansion/react-native-reanimated/blob/30f397ff4851029ee10c39283b2893fb231af63e/packages/react-native-reanimated/package.json#L33)), so that `postinstall` no longer fails.
 
## Test plan

Generate new package and add it to newly created app.
## Description

Seems that I forgot to include `react-native-screens` during transition to monorepo. This resulted in strange bug - you could click buttons and navigate to another example, while being in an example.

## Test plan

Check that `expo-example` works on both platforms and architectures.
## Description

`yarn build` was missing `install` command when running `husky`. This resulted in `_` directory not being generated.

## Test plan

Checked that after `yarn build` `_` is present.
@gabrieldonadel
Copy link
Copy Markdown

React native 0.80 is getting out today, can we merge and publish this? Maybe as canary?

@m-bert m-bert marked this pull request as ready for review June 12, 2025 11:29
@m-bert m-bert requested a review from j-piasecki June 12, 2025 11:29
Comment thread apps/basic-example/package.json Outdated
Comment on lines 28 to 30
"@react-native-community/cli": "18.0.0",
"@react-native-community/cli-platform-android": "18.0.0",
"@react-native-community/cli-platform-ios": "18.0.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to update the cli to 19?

@j-piasecki
Copy link
Copy Markdown
Member

@gabrieldonadel Do you happen to know why today? I'd expect it to be on Monday.

@gabrieldonadel
Copy link
Copy Markdown

@gabrieldonadel Do you happen to know why today? I'd expect it to be on Monday.

It was originally scheduled for this Monday but we had to do a rc 5, so the 0.80 release was postponed for today in a couple hours

@m-bert
Copy link
Copy Markdown
Collaborator Author

m-bert commented Jun 12, 2025

Don't we need to update the cli to 19?

Seems to work without it, but I'll check whether it will work or not and maybe add it in the next commit.

It was originally scheduled for this Monday but we had to do a rc 5, so the 0.80 release was postponed for today in a couple hours

Oh okay, I thought it will be released this monday, but rc 5 made me think about next week. Do you know if there will be any breaking change between those, or this PR will be sufficient?

@m-bert m-bert requested a review from j-piasecki June 12, 2025 14:21
@gabrieldonadel
Copy link
Copy Markdown

Oh okay, I thought it will be released this monday, but rc 5 made me think about next week. Do you know if there will be any breaking change between those, or this PR will be sufficient?

This PR is sufficient, there will be not additional commits on top of RC5

@m-bert
Copy link
Copy Markdown
Collaborator Author

m-bert commented Jun 12, 2025

Great! I don't have much time now but I'll do my best to release it tomorrow morning 😅

@m-bert m-bert merged commit 6edd01a into main Jun 13, 2025
10 checks passed
@m-bert m-bert deleted the @mbert/monorepo-80rc2 branch June 13, 2025 07:53
@m-bert m-bert self-assigned this Jul 10, 2025
@m-bert m-bert added the New React Native version support This pull request aims to bring support for new React Native version label Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New React Native version support This pull request aims to bring support for new React Native version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants