Skip to content

Commit 2279925

Browse files
authored
Merge pull request #928 from facebook/main
sync
2 parents a642204 + 95cc0ef commit 2279925

File tree

106 files changed

+584
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+584
-567
lines changed

.gitignore

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
yarn-debug.log*
5+
yarn-error.log*
6+
17
node_modules
2-
.DS_Store
8+
*.local
9+
10+
# Editor directories and files
11+
.vscode/*
312
.idea
4-
.nvmrc
5-
.docusaurus
13+
.DS_Store
14+
*.suo
15+
*.ntvs*
16+
*.njsproj
17+
*.sln
18+
*.sw?
619

7-
website/build/
20+
*.tsbuildinfo
21+
22+
scripts/lint-examples/out/
823

924
.nvmrc
1025
website/scripts/sync-api-docs/generatedComponentApiDocs.js
@@ -20,5 +35,6 @@ cnwebsite/scripts/sync-api-docs/extracted.json
2035
sync-api-docs/generatedComponentApiDocs.js
2136
sync-api-docs/extracted.json
2237

23-
scripts/lint-examples/out/
24-
38+
website/.docusaurus
39+
website/.cache-loader
40+
website/build/

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ members of the project's leadership.
7272
## Attribution
7373

7474
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
75-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
75+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7676

7777
[homepage]: https://www.contributor-covenant.org
7878

7979
For answers to common questions about this code of conduct, see
80-
https://www.contributor-covenant.org/faq
80+
<https://www.contributor-covenant.org/faq>

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The [Open Source Guides](https://opensource.guide/) website has a collection of
77
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
88
- [Building Welcoming Communities](https://opensource.guide/building-community/)
99

10-
### Code of Conduct
10+
## Code of Conduct
1111

1212
As a reminder, all contributors are expected to adhere to the [Code of Conduct](https://github.com/facebook/react-native-website/blob/main/CODE_OF_CONDUCT.md).
1313

README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ If you are looking for the source code of the [React Native Archive website](htt
2525

2626
### Prerequisites
2727

28-
1. [Git](https://git-scm.com/downloads).
29-
1. [Node](https://nodejs.org/en/download/) _(version 12 or greater)_.
30-
1. [Yarn](https://yarnpkg.com/lang/en/docs/install/) _(version 1.5 or greater)_.
31-
1. A fork of the repo _(for any contributions)_.
32-
1. A clone of the `react-native-website` repo.
28+
1. [Git](https://git-scm.com/downloads).
29+
1. [Node](https://nodejs.org/en/download/) _(version 12 or greater)_.
30+
1. [Yarn](https://yarnpkg.com/lang/en/docs/install/) _(version 1.5 or greater)_.
31+
1. A fork of the repo _(for any contributions)_.
32+
1. A clone of the `react-native-website` repo.
3333

3434
### Installation
3535

36-
1. `cd react-native-website` to go into the project root.
37-
1. Run `yarn` to install the website's workspace dependencies.
36+
1. `cd react-native-website` to go into the project root.
37+
1. Run `yarn` to install the website's workspace dependencies.
3838

3939
### Running locally
4040

41-
1. Run `yarn start` to start the development server _(powered by [Docusaurus](https://v2.docusaurus.io))_.
42-
1. Open http://localhost:3000/ site in your favorite browser.
41+
1. Run `yarn start` to start the development server _(powered by [Docusaurus](https://docusaurus.io))_.
42+
1. Open <http://localhost:3000/> site in your favorite browser.
4343

4444
## 📖 Overview
4545

@@ -93,12 +93,13 @@ react-native-website/
9393
├── versioned_sidebars/
9494
│ ├── [GENERATED VERSIONED SIDEBARS]
9595
│ └── ...
96-
├── docusaurus.config.js
96+
├── docusaurus.config.ts
9797
├── package.json
9898
├── showcase.json
99-
├── sidebars.json
100-
├── sidebarsArchitecture.json
101-
├── sidebarsContributing.json
99+
├── sidebars.ts
100+
├── sidebarsArchitecture.ts
101+
├── sidebarsCommunity.ts
102+
├── sidebarsContributing.ts
102103
└── versions.json
103104
```
104105

@@ -108,11 +109,11 @@ As mentioned above, the `docs` folder contains the source files for docs from "G
108109
The doc files for the "Architecture" and "Contribution" tabs are located inside `website` in the respective directories (unversioned/static docs).
109110
In most cases, you will only want to edit the files within those directories.
110111

111-
If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the `sidebars.json`, `sidebarsArchitecture.json` and `sidebarsContributing.json` files in the `website` directory. The sidebar files contain a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.
112+
If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the `sidebars.ts`, `sidebarsArchitecture.ts` and `sidebarsContributing.ts` files in the `website` directory. The sidebar files contain a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.
112113

113114
### Versioned docs
114115

115-
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.json` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.
116+
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`.
116117

117118
> **_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.
118119
@@ -128,13 +129,13 @@ This can be done by updating the `package.json` and configuration files in `scri
128129

129130
##### After Release
130131

131-
1. `cd react-native-website` to go into the project root.
132-
1. `cd website` to go into the website portion of the project.
133-
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
132+
1. `cd react-native-website` to go into the project root.
133+
1. `cd website` to go into the website portion of the project.
134+
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
134135

135136
## 🔧 Website configuration
136137

137-
The main config file for the website can be found at `website/docusaurus.config.js`. This file tells [Docusaurus how to build the website](https://v2.docusaurus.io/docs/configuration). Edits to this file are rarely necessary.
138+
The main config file for the website can be found at `website/docusaurus.config.ts`. This file tells [Docusaurus how to build the website](https://docusaurus.io/docs/configuration). Edits to this file are rarely necessary.
138139

139140
The `core` subdirectory contains JavaScript and React components that are the core part of the website.
140141

@@ -148,21 +149,21 @@ The `showcase.json` file contains the list of users that are highlighted in the
148149

149150
### Create a branch
150151

151-
1. `git checkout main` from any folder in your local `react-native-website` repository.
152-
1. `git pull origin main` to ensure you have the latest main code.
153-
1. `git checkout -b the-name-of-my-branch` to create a branch.
152+
1. `git checkout main` from any folder in your local `react-native-website` repository.
153+
1. `git pull origin main` to ensure you have the latest main code.
154+
1. `git checkout -b the-name-of-my-branch` to create a branch.
154155
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
155156
156157
### Make the change
157158

158-
1. Follow the "[Running locally](#running-locally)" instructions.
159-
1. Save the files and check in the browser.
160-
1. Some changes may require a server restart to generate new files. (Pages in `docs` always do!)
161-
1. Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under the `docs/next` path.
159+
1. Follow the "[Running locally](#running-locally)" instructions.
160+
1. Save the files and check in the browser.
161+
1. Some changes may require a server restart to generate new files. (Pages in `docs` always do!)
162+
1. Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under the `docs/next` path.
162163

163-
Visit **http://localhost:3000/docs/next/YOUR-DOCS-PAGE** to see your work.
164+
Visit **<http://localhost:3000/docs/next/YOUR-DOCS-PAGE>** to see your work.
164165

165-
> Visit http://localhost:3000/versions to see the list of all versions of the docs.
166+
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs.
166167
167168
### Test the change
168169

@@ -173,13 +174,13 @@ If possible, test any visual changes in all latest versions of the following bro
173174

174175
### Push it
175176

176-
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
177-
1. `git add -A && git commit -m "My message"` to stage and commit your changes.
177+
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
178+
1. `git add -A && git commit -m "My message"` to stage and commit your changes.
178179
> replace `My message` with a commit message, such as `Fixed header logo on Android`
179-
1. `git push my-fork-name the-name-of-my-branch`
180-
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
181-
1. Follow GitHub's instructions.
182-
1. Describe briefly your changes (in case of visual changes, please include screenshots).
180+
1. `git push my-fork-name the-name-of-my-branch`
181+
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
182+
1. Follow GitHub's instructions.
183+
1. Describe briefly your changes (in case of visual changes, please include screenshots).
183184

184185
## 📄 License
185186

STYLEGUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ When it comes to describing property values, be definitive in what is and is not
121121

122122
## Other grammar policies
123123

124-
* Capitalize “Hooks.”
124+
- Capitalize “Hooks.”
125125

126126
## Empathize with readers
127127

docs/_integration-with-existing-apps-ios.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ To ensure a smooth experience, create a new folder for your integrated React Nat
2828

2929
Go to the root directory and run the following command:
3030

31-
```
32-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/package.json
31+
```shell
32+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/package.json
3333
```
3434

35-
This will copy the `package.json` [file from the Community template](https://github.com/react-native-community/template/blob/0.76-stable/template/package.json) to your project.
35+
This will copy the `package.json` [file from the Community template](https://github.com/react-native-community/template/blob/0.77-stable/template/package.json) to your project.
3636

3737
Next, install the NPM packages by running:
3838

@@ -55,7 +55,7 @@ yarn install
5555

5656
Installation process has created a new `node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
5757

58-
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.76-stable/template/_gitignore)).
58+
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.77-stable/template/_gitignore)).
5959

6060
### 3. Install Development tools
6161

@@ -87,22 +87,22 @@ To configure CocoaPods, we need two files:
8787
For the **Gemfile**, go to the root directory of your project and run this command
8888

8989
```sh
90-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/Gemfile
90+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/Gemfile
9191
```
9292

9393
This will download the Gemfile from the template.
9494
Similarly, for the **Podfile**, go to the `ios` folder of your project and run
9595

9696
```sh
97-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/ios/Podfile
97+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/ios/Podfile
9898
```
9999

100-
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.76-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile).
100+
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.77-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile).
101101

102102
:::note
103-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
103+
Remember to change [this line](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
104104

105-
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26-L29).
105+
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26-L29).
106106
:::
107107

108108
Now, we need to run a couple of extra commands to install the Ruby gems and the Pods.
@@ -127,7 +127,7 @@ First, create an empty `index.js` file in the root of your React Native project.
127127

128128
`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `import`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it.
129129

130-
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.76-stable/template/index.js)):
130+
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.77-stable/template/index.js)):
131131

132132
```js
133133
import {AppRegistry} from 'react-native';
@@ -138,7 +138,7 @@ AppRegistry.registerComponent('HelloWorld', () => App);
138138

139139
### Create a `App.tsx` file
140140

141-
Let's create an `App.tsx` file. This is a [TypeScript](https://www.typescriptlang.org/) file that can have [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) expressions. It contains the root React Native component that we will integrate into our iOS application ([link](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx)):
141+
Let's create an `App.tsx` file. This is a [TypeScript](https://www.typescriptlang.org/) file that can have [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) expressions. It contains the root React Native component that we will integrate into our iOS application ([link](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx)):
142142

143143
```tsx
144144
import React from 'react';
@@ -211,7 +211,7 @@ const styles = StyleSheet.create({
211211
export default App;
212212
```
213213

214-
Here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx)
214+
Here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx)
215215

216216
## 5. Integrating with your iOS code
217217

@@ -279,7 +279,7 @@ First, we need to extends the `AppDelegate` to inherit from one of the classes p
279279

280280
To achieve this, we have to modify the `AppDelegate.h` file and the `AppDelegate.m` files:
281281

282-
1. Open the `AppDelegate.h` files and modify it as it follows (See the official template's [AppDelegate.h](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/HelloWorld/AppDelegate.h) as reference):
282+
1. Open the `AppDelegate.h` files and modify it as it follows (See the official template's [AppDelegate.h](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/HelloWorld/AppDelegate.h) as reference):
283283

284284
```diff title="AppDelegate.h changes"
285285
#import <UIKit/UIKit.h>
@@ -292,7 +292,7 @@ To achieve this, we have to modify the `AppDelegate.h` file and the `AppDelegate
292292
@end
293293
```
294294

295-
2. Open the `AppDelegate.mm` file and modify it as it follows (See the official template's [AppDelegate.mm](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/HelloWorld/AppDelegate.mm) as reference
295+
2. Open the `AppDelegate.mm` file and modify it as it follows (See the official template's [AppDelegate.mm](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/HelloWorld/AppDelegate.mm) as reference
296296

297297
```diff title="AppDelegate.mm"
298298
#import "AppDelegate.h"
@@ -349,7 +349,6 @@ To achieve this, we have to modify the `AppDelegate.swift`
349349
```diff title="AppDelegate.swift"
350350
import UIKit
351351
+import React_RCTAppDelegate
352-
+import React_RCTAppDelegate
353352

354353
@main
355354
-class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -551,7 +550,7 @@ const {getDefaultConfig} = require('@react-native/metro-config');
551550
module.exports = getDefaultConfig(__dirname);
552551
```
553552

554-
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.76-stable/template/metro.config.js) from the Community template file as reference.
553+
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.77-stable/template/metro.config.js) from the Community template file as reference.
555554

556555
Once you have the config file in place, you can run the bundler. Run the following command in the root directory of your project:
557556

0 commit comments

Comments
 (0)