From 8a5356b69d0eb47ef4bcaa311818494598feac5a Mon Sep 17 00:00:00 2001 From: Pritam Date: Wed, 13 May 2026 23:58:13 +0530 Subject: [PATCH 1/3] Added NPM and PNPM installation in README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eea5c09aae..10c5347a1d 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ React Native ExecuTorch is powering [Private Mind](https://privatemind.swmansion ### :one: Installation + ```bash # Install the package yarn add react-native-executorch @@ -96,11 +97,39 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down # Depending on the platform, choose either iOS or Android yarn < ios | android > ``` +
+
+ Check for NPM Installation + + ```bash + npm install react-native-executorch + # For Expo projects, you need to install expo resource fetcher + npm install react-native-executorch-expo-resource-fetcher + npm install expo-file-system expo-asset + # For bare React Native projects, you need to install bare resource fetcher + npm install react-native-executorch-bare-resource-fetcher + npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` +
+
+
+ Check for PNPM Installation + + ```bash + pnpm install react-native-executorch + # For Expo projects, you need to install expo resource fetcher + pnpm install react-native-executorch-expo-resource-fetcher + pnpm install expo-file-system expo-asset + # For bare React Native projects, you need to install bare resource fetcher + pnpm install react-native-executorch-bare-resource-fetcher + pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` +
+
### :two: Setup & Initialization Add this to your component file: - ```tsx import { useLLM, From 103d885515f24409ed53cb05b2f17c6b26966347 Mon Sep 17 00:00:00 2001 From: Pritam Date: Thu, 14 May 2026 00:05:02 +0530 Subject: [PATCH 2/3] Added npm and pnpm installation in README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 10c5347a1d..136ef79902 100644 --- a/README.md +++ b/README.md @@ -103,12 +103,17 @@ yarn < ios | android > ```bash npm install react-native-executorch + # For Expo projects, you need to install expo resource fetcher npm install react-native-executorch-expo-resource-fetcher npm install expo-file-system expo-asset + # For bare React Native projects, you need to install bare resource fetcher npm install react-native-executorch-bare-resource-fetcher npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + + # Depending on the platform, choose either iOS or Android + npm < ios | android > ```
@@ -117,12 +122,17 @@ yarn < ios | android > ```bash pnpm install react-native-executorch + # For Expo projects, you need to install expo resource fetcher pnpm install react-native-executorch-expo-resource-fetcher pnpm install expo-file-system expo-asset + # For bare React Native projects, you need to install bare resource fetcher pnpm install react-native-executorch-bare-resource-fetcher pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + + # Depending on the platform, choose either iOS or Android + pnpm < ios | android > ```
From cd107bc376ce1169575a8e6289497fa8a2888974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Thu, 14 May 2026 13:30:38 +0200 Subject: [PATCH 3/3] docs: add npm/pnpm guidance to README and split installation steps - README: replace accordion blocks with a one-line note that npm/pnpm work too; mirror the note in es/fr/cn/pt/in translations - docs/getting-started: split the bulky combined install block into separate steps (core package, then Expo or bare resource fetcher), with small per-package-manager tabs in each step - docs/loading-models: add npm/pnpm tabs alongside the yarn commands Co-Authored-By: Pritam --- README.md | 43 +------ .../01-fundamentals/01-getting-started.md | 114 +++++++++++++----- .../docs/01-fundamentals/02-loading-models.md | 57 +++++++-- readmes/README_cn.md | 2 + readmes/README_es.md | 2 + readmes/README_fr.md | 2 + readmes/README_in.md | 2 + readmes/README_pt.md | 2 + 8 files changed, 149 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 136ef79902..691df0cd33 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,6 @@ React Native ExecuTorch is powering [Private Mind](https://privatemind.swmansion ### :one: Installation - ```bash # Install the package yarn add react-native-executorch @@ -97,49 +96,13 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down # Depending on the platform, choose either iOS or Android yarn < ios | android > ``` -
-
- Check for NPM Installation - - ```bash - npm install react-native-executorch - - # For Expo projects, you need to install expo resource fetcher - npm install react-native-executorch-expo-resource-fetcher - npm install expo-file-system expo-asset - - # For bare React Native projects, you need to install bare resource fetcher - npm install react-native-executorch-bare-resource-fetcher - npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader - - # Depending on the platform, choose either iOS or Android - npm < ios | android > - ``` -
-
-
- Check for PNPM Installation - - ```bash - pnpm install react-native-executorch - - # For Expo projects, you need to install expo resource fetcher - pnpm install react-native-executorch-expo-resource-fetcher - pnpm install expo-file-system expo-asset - - # For bare React Native projects, you need to install bare resource fetcher - pnpm install react-native-executorch-bare-resource-fetcher - pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader - - # Depending on the platform, choose either iOS or Android - pnpm < ios | android > - ``` -
-
+ +> npm and pnpm work too — use `npm install` or `pnpm add` for the packages, and `npm run ` / `pnpm ` for the run step. ### :two: Setup & Initialization Add this to your component file: + ```tsx import { useLLM, diff --git a/docs/docs/01-fundamentals/01-getting-started.md b/docs/docs/01-fundamentals/01-getting-started.md index c1d04e1ec1..0f5abf8cae 100644 --- a/docs/docs/01-fundamentals/01-getting-started.md +++ b/docs/docs/01-fundamentals/01-getting-started.md @@ -38,45 +38,85 @@ For supported React Native and Expo versions, see the [Compatibility table](../0 ## Installation -Installation is pretty straightforward, use your package manager of choice to install the package and some peer dependencies required to streamline model downloads. If you want to implement your custom model fetching logic, see [this document](../08-resource-fetcher/02-custom-adapter.md). +Installation takes two steps: install the core package, then install a resource fetcher adapter that matches your project type. If you want to implement your own model fetching logic instead, see [this document](../08-resource-fetcher/02-custom-adapter.md). - - +### 1. Install the core package + + + ```bash npm install react-native-executorch - # For Expo projects, you need to install expo resource fetcher - npm install react-native-executorch-expo-resource-fetcher - npm install expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - npm install react-native-executorch-bare-resource-fetcher - npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader ``` - + ```bash - pnpm install react-native-executorch - # For Expo projects, you need to install expo resource fetcher - pnpm install react-native-executorch-expo-resource-fetcher - pnpm install expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - pnpm install react-native-executorch-bare-resource-fetcher - pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + pnpm add react-native-executorch ``` - + ```bash yarn add react-native-executorch - # For Expo projects, you need to install expo resource fetcher - yarn add react-native-executorch-expo-resource-fetcher - yarn add expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - yarn add react-native-executorch-bare-resource-fetcher - yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + +### 2. Install a resource fetcher + +Pick the adapter that matches your project. We recommend the Expo adapter when your app uses Expo; use the bare adapter for projects without Expo. + +#### Expo projects + + + + + ```bash + npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + +#### Bare React Native projects + + + + + ```bash + npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader ``` @@ -120,9 +160,29 @@ Because we are using ExecuTorch under the hood, you won't be able to build iOS a Running the app with the library: -```bash -yarn -d -``` + + + + ```bash + npm run -- -d + ``` + + + + + ```bash + pnpm -d + ``` + + + + + ```bash + yarn -d + ``` + + + ## Supporting new models in React Native ExecuTorch diff --git a/docs/docs/01-fundamentals/02-loading-models.md b/docs/docs/01-fundamentals/02-loading-models.md index 3a3eaab722..28df1d8d6d 100644 --- a/docs/docs/01-fundamentals/02-loading-models.md +++ b/docs/docs/01-fundamentals/02-loading-models.md @@ -2,6 +2,9 @@ title: Loading Models --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + There are three different methods available for loading model files, depending on their size and location. ## Prerequisites @@ -10,10 +13,29 @@ In our library, you can use two different resource fetching mechanisms. One is i To use the Expo adapter, please add these libraries: -```bash -yarn add react-native-executorch-expo-resource-fetcher -yarn add expo-file-system expo-asset -``` + + + + ```bash + npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + and then add the following code in your React Native app: @@ -28,10 +50,29 @@ initExecutorch({ If you cannot use Expo in your project, proceed with the following steps: -```bash -yarn add react-native-executorch-bare-resource-fetcher -yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader -``` + + + + ```bash + npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + and diff --git a/readmes/README_cn.md b/readmes/README_cn.md index c8d869404e..e148e18aa0 100644 --- a/readmes/README_cn.md +++ b/readmes/README_cn.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm 和 pnpm 同样适用 — 使用 `npm install` 或 `pnpm add` 安装包,使用 `npm run ` / `pnpm ` 运行应用。 + ### :two: 设置和初始化 将此添加到您的组件文件中: diff --git a/readmes/README_es.md b/readmes/README_es.md index 4b9337bd26..63dfd5a3b7 100644 --- a/readmes/README_es.md +++ b/readmes/README_es.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm y pnpm también funcionan — usa `npm install` o `pnpm add` para los paquetes, y `npm run ` / `pnpm ` para el paso de ejecución. + ### :two: Configuración e inicialización Agrega esto a tu archivo de componente: diff --git a/readmes/README_fr.md b/readmes/README_fr.md index 8e3efdd63b..9447a91dc3 100644 --- a/readmes/README_fr.md +++ b/readmes/README_fr.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm et pnpm fonctionnent aussi — utilisez `npm install` ou `pnpm add` pour les packages, et `npm run ` / `pnpm ` pour l'étape d'exécution. + ### :two: Configuration et Initialisation Ajoutez ceci à votre fichier de composant : diff --git a/readmes/README_in.md b/readmes/README_in.md index dbc0085482..0bf15c1d96 100644 --- a/readmes/README_in.md +++ b/readmes/README_in.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm और pnpm भी काम करते हैं — पैकेजों के लिए `npm install` या `pnpm add` का उपयोग करें, और रन स्टेप के लिए `npm run ` / `pnpm ` का उपयोग करें। + ### :two: सेटअप और आरंभिककरण अपने घटक फाइल में यह जोड़ें: diff --git a/readmes/README_pt.md b/readmes/README_pt.md index b3ef308924..e8eda02f8e 100644 --- a/readmes/README_pt.md +++ b/readmes/README_pt.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm e pnpm também funcionam — use `npm install` ou `pnpm add` para os pacotes, e `npm run ` / `pnpm ` para o passo de execução. + ### :two: Configuração e Inicialização Adicione isso ao seu arquivo de componente: