Skip to content

Commit f9ad669

Browse files
committed
Merge branch 'main' of https://github.com/zaferatli/react-native-website into fix/hermes
2 parents 7e2cee5 + 927f161 commit f9ad669

File tree

315 files changed

+881
-389
lines changed

Some content is hidden

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

315 files changed

+881
-389
lines changed

.github/workflows/pre-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Node.js
1919
uses: actions/setup-node@v4
2020
with:
21-
node-version: "20"
21+
node-version: "22"
2222
cache: yarn
2323

2424
- name: Check lock for duplications
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up Node.js
4646
uses: actions/setup-node@v4
4747
with:
48-
node-version: "20"
48+
node-version: "22"
4949
cache: yarn
5050

5151
- name: Install dependencies

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [reactnative.dev](https://reactnative.dev/) &middot; [![CC BY 4.0 license](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](LICENSE-docs) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) <a href="https://twitter.com/intent/follow?screen_name=reactnative"><img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative" /></a>
1+
# [reactnative.dev](https://reactnative.dev/) &middot; [![CC BY 4.0 license](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](LICENSE-docs) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) <a href="https://twitter.com/intent/follow?screen_name=reactnative"><img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative on X" /></a> <a href="https://bsky.app/profile/reactnative.dev"><img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff" alt="Follow @reactnative.dev on Bluesky" /></a>
22

33
This repo contains the website configuration and documentation powering the [React Native website](https://reactnative.dev/).
44

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.
66
77
## Contents
88

@@ -17,21 +17,19 @@ If you are looking for the source code of the [React Native Archive website](htt
1717
### Prerequisites
1818

1919
1. [Git](https://git-scm.com/downloads).
20-
1. [Node](https://nodejs.org/en/download/) _(version 20 or greater)_.
20+
1. [Node](https://nodejs.org/en/download/) _(version 22 or greater)_.
2121
1. [Yarn](https://yarnpkg.com/getting-started/install) _(version 4)_.
22-
1. A fork of the repo _(for any contributions)_.
23-
1. A clone of the `react-native-website` repo.
22+
1. A fork and clone of the `react-native-website` repo _(for any contributions)_.
2423

2524
### Installation
2625

2726
1. `cd react-native-website` to go into the project root.
2827
1. Run `corepack enable` to enable Corepack.
2928

30-
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
29+
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
3130
3231
1. Run `yarn` to install the website's workspace dependencies.
33-
34-
> If you want to retain the globally instaled `yarn` v1, you can use `corepack yarn` instead.
32+
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.
3533
3634
### Running locally
3735

@@ -112,7 +110,8 @@ If you're adding a new doc or you need to alter the order the docs appear in the
112110

113111
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`.
114112

115-
> **_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.
116115
117116
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.
118117

@@ -150,7 +149,7 @@ The `showcase.json` file contains the list of users that are highlighted in the
150149
1. `git checkout main` from any folder in your local `react-native-website` repository.
151150
1. `git pull origin main` to ensure you have the latest main code.
152151
1. `git checkout -b the-name-of-my-branch` to create a branch.
153-
> 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`
154153
155154
### Make the change
156155

@@ -161,7 +160,11 @@ The `showcase.json` file contains the list of users that are highlighted in the
161160

162161
Visit **<http://localhost:3000/docs/next/YOUR-DOCS-PAGE>** to see your work.
163162

164-
> 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.
165168
166169
### Test the change
167170

@@ -175,7 +178,7 @@ If possible, test any visual changes in all latest versions of the following bro
175178
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
176179
1. Run `yarn update-lock` to [deduplicate dependencies](https://yarnpkg.com/cli/dedupe).
177180
1. `git add -A && git commit -m "My message"` to stage and commit your changes.
178-
> 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`
179182
1. `git push my-fork-name the-name-of-my-branch`
180183
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
181184
1. Follow GitHub's instructions.

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

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
import constants from '@site/core/TabsConstants';
4+
import CodeBlock from '@theme/CodeBlock';
5+
import RNTemplateRepoLink from '@site/core/RNTemplateRepoLink';
6+
import {getTemplateBranchNameForCurrentVersion} from '@site/src/getTemplateBranchNameForCurrentVersion';
27

38
## Key Concepts
49

@@ -28,11 +33,11 @@ To ensure a smooth experience, create a new folder for your integrated React Nat
2833

2934
Go to the root directory and run the following command:
3035

31-
```shell
32-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.78-stable/template/package.json
33-
```
36+
<CodeBlock language="bash" title="shell">
37+
{`curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/${getTemplateBranchNameForCurrentVersion()}/template/package.json`}
38+
</CodeBlock>
3439

35-
This will copy the `package.json` [file from the Community template](https://github.com/react-native-community/template/blob/0.78-stable/template/package.json) to your project.
40+
This will copy the `package.json` <RNTemplateRepoLink href="template/package.json">file from the Community template</RNTemplateRepoLink> to your project.
3641

3742
Next, install the NPM packages by running:
3843

@@ -55,7 +60,7 @@ yarn install
5560

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

58-
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.78-stable/template/_gitignore)).
63+
Add `node_modules/` to your `.gitignore` file (here the <RNTemplateRepoLink href="template/_gitignore">Community default one</RNTemplateRepoLink>).
5964

6065
### 3. Install Development tools
6166

@@ -86,9 +91,9 @@ To configure CocoaPods, we need two files:
8691

8792
For the **Gemfile**, go to the root directory of your project and run this command
8893

89-
```sh
90-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.78-stable/template/Gemfile
91-
```
94+
<CodeBlock language="bash" title="shell">
95+
{`curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/${getTemplateBranchNameForCurrentVersion()}/template/Gemfile`}
96+
</CodeBlock>
9297

9398
This will download the Gemfile from the template.
9499

@@ -108,14 +113,14 @@ Xcode 16 generates a project in a slightly different ways from previous versions
108113

109114
Similarly, for the **Podfile**, go to the `ios` folder of your project and run
110115

111-
```sh
112-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.78-stable/template/ios/Podfile
113-
```
116+
<CodeBlock language="bash" title="shell">
117+
{`curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/${getTemplateBranchNameForCurrentVersion()}/template/ios/Podfile`}
118+
</CodeBlock>
114119

115-
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.78-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile).
120+
Please use the Community Template as a reference point for the <RNTemplateRepoLink href="template/Gemfile">Gemfile</RNTemplateRepoLink> and for the <RNTemplateRepoLink href="template/ios/Podfile">Podfile</RNTemplateRepoLink>.
116121

117122
:::note
118-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17).
123+
Remember to change <RNTemplateRepoLink href="template/ios/Podfile#L17">this line</RNTemplateRepoLink>.
119124
:::
120125

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

141146
`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.
142147

143-
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.78-stable/template/index.js)):
148+
Our `index.js` should look as follows (here the <RNTemplateRepoLink href="template/index.js">Community template file as reference</RNTemplateRepoLink>):
144149

145150
```js
146151
import {AppRegistry} from 'react-native';
@@ -151,7 +156,7 @@ AppRegistry.registerComponent('HelloWorld', () => App);
151156

152157
### Create a `App.tsx` file
153158

154-
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.78-stable/template/App.tsx)):
159+
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 (<RNTemplateRepoLink href="template/App.tsx">link</RNTemplateRepoLink>):
155160

156161
```tsx
157162
import React from 'react';
@@ -224,7 +229,7 @@ const styles = StyleSheet.create({
224229
export default App;
225230
```
226231

227-
Here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.78-stable/template/App.tsx)
232+
Here is the <RNTemplateRepoLink href="template/App.tsx">Community template file as reference</RNTemplateRepoLink>.
228233

229234
## 5. Integrating with your iOS code
230235

@@ -460,15 +465,15 @@ const {getDefaultConfig} = require('@react-native/metro-config');
460465
module.exports = getDefaultConfig(__dirname);
461466
```
462467

463-
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.78-stable/template/metro.config.js) from the Community template file as reference.
468+
You can checkout the <RNTemplateRepoLink href="template/metro.config.js">`metro.config.js` file</RNTemplateRepoLink> from the Community template file as reference.
464469

465470
Then, you need to create a `.watchmanconfig` file in the root of your project. The file must contain an empty json object:
466471

467472
```sh
468473
echo {} > .watchmanconfig
469474
```
470475

471-
Once you have the configurations file in place, you can run the bundler. Run the following command in the root directory of your project:
476+
Once you have the configuration file in place, you can run the bundler. Run the following command in the root directory of your project:
472477

473478
<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>
474479
<TabItem value="npm">

0 commit comments

Comments
 (0)