You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# [reactnative.dev](https://reactnative.dev/)·[](LICENSE-docs)[](CONTRIBUTING.md) <ahref="https://twitter.com/intent/follow?screen_name=reactnative"><imgsrc="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative"alt="Follow @reactnative" /></a>
1
+
# [reactnative.dev](https://reactnative.dev/)·[](LICENSE-docs)[](CONTRIBUTING.md) <ahref="https://twitter.com/intent/follow?screen_name=reactnative"><imgsrc="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative"alt="Follow @reactnative on X" /></a> <ahref="https://bsky.app/profile/reactnative.dev"><imgsrc="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff"alt="Follow @reactnative.dev on Bluesky" /></a>
2
2
3
3
This repo contains the website configuration and documentation powering the [React Native website](https://reactnative.dev/).
4
4
5
-
If you are looking for the source code of the [React Native Archive website](https://archive.reactnative.dev/) select the [`archive`](https://github.com/facebook/react-native-website/tree/archive) branch.
5
+
> If you are looking for the source code of the [React Native Archive website](https://archive.reactnative.dev/) select the [`archive`](https://github.com/facebook/react-native-website/tree/archive) branch.
6
6
7
7
## Contents
8
8
@@ -17,15 +17,19 @@ If you are looking for the source code of the [React Native Archive website](htt
17
17
### Prerequisites
18
18
19
19
1.[Git](https://git-scm.com/downloads).
20
-
1.[Node](https://nodejs.org/en/download/)_(version 12 or greater)_.
21
-
1.[Yarn](https://yarnpkg.com/lang/en/docs/install/)_(version 1.5 or greater)_.
22
-
1. A fork of the repo _(for any contributions)_.
23
-
1. A clone of the `react-native-website` repo.
20
+
1.[Node](https://nodejs.org/en/download/)_(version 22 or greater)_.
1. A fork and clone of the `react-native-website` repo _(for any contributions)_.
24
23
25
24
### Installation
26
25
27
26
1.`cd react-native-website` to go into the project root.
27
+
1. Run `corepack enable` to enable Corepack.
28
+
29
+
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
30
+
28
31
1. Run `yarn` to install the website's workspace dependencies.
32
+
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.
29
33
30
34
### Running locally
31
35
@@ -106,7 +110,8 @@ If you're adding a new doc or you need to alter the order the docs appear in the
106
110
107
111
Part of the React Native website is versioned to allow users to go back and see the Guides or API reference documentation for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the `docs` and `website/sidebars.ts` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.
108
112
109
-
> **_Note:_** Do not edit the auto-generated files within `versioned_docs` or `versioned_sidebars` unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the versioned docs.
113
+
> [!NOTE]
114
+
> Do not edit the auto-generated files within `versioned_docs` or `versioned_sidebars` unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the versioned docs.
110
115
111
116
Docusaurus keeps track of the list of versions for the site in the `website/versions.json` file. The ordering of versions in this file should be in reverse chronological order.
112
117
@@ -122,7 +127,8 @@ This can be done by updating the `package.json` and configuration files in `scri
122
127
123
128
1.`cd react-native-website` to go into the project root.
124
129
1.`cd website` to go into the website portion of the project.
125
-
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
130
+
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released (e.g. `0.81`).
131
+
1. Open a PR and commit this change as "Cut branch <newVersion>"
126
132
127
133
## 🔧 Website configuration
128
134
@@ -143,7 +149,7 @@ The `showcase.json` file contains the list of users that are highlighted in the
143
149
1.`git checkout main` from any folder in your local `react-native-website` repository.
144
150
1.`git pull origin main` to ensure you have the latest main code.
145
151
1.`git checkout -b the-name-of-my-branch` to create a branch.
146
-
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
152
+
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
147
153
148
154
### Make the change
149
155
@@ -154,7 +160,11 @@ The `showcase.json` file contains the list of users that are highlighted in the
154
160
155
161
Visit **<http://localhost:3000/docs/next/YOUR-DOCS-PAGE>** to see your work.
156
162
157
-
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs.
163
+
> [!NOTE]
164
+
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs, if you have backported some of the changes.
165
+
166
+
> [!TIP]
167
+
> If you're adding assets, make sure they’re optimized for the web. You can use tools like [ImageOptim](https://imageoptim.com/mac) to automatically apply lossless compression to various file types.
158
168
159
169
### Test the change
160
170
@@ -166,8 +176,9 @@ If possible, test any visual changes in all latest versions of the following bro
166
176
### Push it
167
177
168
178
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
179
+
1. Run `yarn update-lock` to [deduplicate dependencies](https://yarnpkg.com/cli/dedupe).
169
180
1.`git add -A && git commit -m "My message"` to stage and commit your changes.
170
-
> replace `My message` with a commit message, such as `Fixed header logo on Android`
181
+
> replace `My message` with a commit message, such as `Fixed header logo on Android`
171
182
1.`git push my-fork-name the-name-of-my-branch`
172
183
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
0 commit comments