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

chore: mention linking react and react-dom locally #40514

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 15 additions & 11 deletions contributing.md
Expand Up @@ -136,18 +136,32 @@ EXAMPLE=./test/integration/basic

There are two options to develop with your local version of the codebase:

### Develop inside the monorepo
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this gives a better DX, I suggest we switch the order here.


1. Move your app inside of the Next.js monorepo.

2. Run with `pnpm next-with-deps ./app-path-in-monorepo`

This will use the version of `next` built inside of the Next.js monorepo and the
main `pnpm dev` monorepo command can be running to make changes to the local
Next.js version at the same time (some changes might require re-running `pnpm next-with-deps` to take effect).

### Set as a local dependency in package.json

1. In your app's `package.json`, replace:

```json
"next": "<next-version>",
"next": "<version>",
"react": "<version>",
"react-dom": "<version>",
```

with:

```json
"next": "link:/path/to/next.js/packages/next",
"react": "link:/path/to/next.js/node_modules/react",
"react-dom": "link:/path/to/next.js/node_modules/react-dom"
```

2. In your app's root directory, make sure to remove `next` from `node_modules` with:
Expand Down Expand Up @@ -193,16 +207,6 @@ Try to add the below section to your `package.json`, then run again
},
```

### Develop inside the monorepo

1. Move your app inside of the Next.js monorepo.

2. Run with `pnpm next-with-deps ./app-path-in-monorepo`

This will use the version of `next` built inside of the Next.js monorepo and the
main `pnpm dev` monorepo command can be running to make changes to the local
Next.js version at the same time (some changes might require re-running `pnpm next-with-deps` to take effect).

## Updating documentation paths

Our documentation currently leverages a [manifest file](/docs/manifest.json) which is how documentation entries are checked.
Expand Down