Skip to content

Support react-native 0.80 #3530

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

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Support react-native 0.80 #3530

wants to merge 28 commits into from

Conversation

m-bert
Copy link
Contributor

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

Description

This PR adds support for react-native 0.80

Test plan

Tested that basic-example builds and works correctly

m-bert and others added 28 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant