Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
52f159a
Add first working autogenerated API
msluszniak Jan 22, 2026
71a9d05
Add subsection for generated API
msluszniak Jan 22, 2026
6ec733d
Add support for automatic documentation for the first few hooks
msluszniak Jan 22, 2026
9206bea
Another hooks handled
msluszniak Jan 23, 2026
2188c61
Update yarn.lock with docusaurus plugin for typedoc
msluszniak Jan 23, 2026
98ccf0b
Enhance VAD and part of TTS documentation
msluszniak Jan 23, 2026
ac68403
Fix docusaurus.config.js
msluszniak Jan 24, 2026
9bb82fb
Add another batch of typed docs
msluszniak Jan 26, 2026
520acc3
Add new files for better type control
msluszniak Jan 26, 2026
81b229b
Add new typedocs to another modules
msluszniak Jan 26, 2026
8aadf86
Add new typed modules
msluszniak Jan 27, 2026
378038b
Add changed *.ts files
msluszniak Jan 27, 2026
a8b0a41
Add another batch of module
msluszniak Jan 27, 2026
41ebfb4
Added all of the modules to autogenerated docs
msluszniak Jan 28, 2026
fb8c499
Organize docs into clean sections
msluszniak Jan 28, 2026
648d3b1
Fix first few pages on our traditional docs
msluszniak Jan 29, 2026
7d713f1
Add another hooks
msluszniak Jan 29, 2026
4bb7c5e
Handle another hook section
msluszniak Jan 29, 2026
7e10c82
Fix problem with overlapping columns in documentation
msluszniak Jan 30, 2026
bf7cb74
Add all TS Modules
msluszniak Jan 30, 2026
3018035
Completed all API docs
msluszniak Jan 30, 2026
ec5f7c7
Bump t-rex version
msluszniak Jan 30, 2026
b73f138
Update FAQ and getting started
msluszniak Jan 30, 2026
67c2d9d
Merge branch 'main' into @ms/add-autogenerated-api-to-docs
msluszniak Jan 30, 2026
0f14052
Fix types in llms
msluszniak Jan 30, 2026
52ba2a1
Add packages to package.json
msluszniak Jan 30, 2026
894f841
Apply lint fixes
msluszniak Jan 30, 2026
c9f95fb
Add ts to docs
msluszniak Jan 30, 2026
d2a421e
Apply suggestions from code review
msluszniak Jan 31, 2026
b44ed35
Fix one typing in Image Embeddings module
msluszniak Feb 2, 2026
adbb0fb
Apply suggestions from code review
msluszniak Feb 3, 2026
fa69ba1
Update packages/react-native-executorch/src/types/imageSegmentation.ts
msluszniak Feb 3, 2026
6829cd7
Update packages/react-native-executorch/src/types/tti.ts
msluszniak Feb 3, 2026
b5d7c22
docs: Apply first batch of suggestions from review
msluszniak Feb 3, 2026
2527130
docs: Suppress warnings when building documentation
msluszniak Feb 3, 2026
8b21a80
docs: Fix sidebar and breadcrumbs in auto-generated API
msluszniak Feb 3, 2026
85b94bb
docs: remove deprecated types from docs
msluszniak Feb 3, 2026
a487361
docs: Fix problems with sidebar
msluszniak Feb 3, 2026
b349cf4
docs: Improve documentation for Speech to Text module
msluszniak Feb 3, 2026
7e908a7
docs: Add README.md for documentation
msluszniak Feb 3, 2026
685dfaf
docs: modify existing README.md instead of creating a new one
msluszniak Feb 3, 2026
dc92f19
docs: Add note about api reference in RELEASE.md
msluszniak Feb 3, 2026
4ee3121
docs: Fix documentation so every link will work with publishing new v…
msluszniak Feb 3, 2026
b9d1a8c
docs: update links in reference api
msluszniak Feb 3, 2026
4c9dbc4
Merge branch 'main' into @ms/add-autogenerated-api-to-docs
msluszniak Feb 4, 2026
a63d2cc
Merge branch 'main' into @ms/add-autogenerated-api-to-docs
msluszniak Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ ocurred
libfbjni
libc
gradlew
AEROPLANE
DININGTABLE
POTTEDPLANT
TVMONITOR
sublist
TTFT
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The release process of new minor version consists of the following steps:
4. Create a new release branch `release/{MAJOR}.{MINOR}`and push it to the remote.
5. Stability tests are performed on the release branch and all fixes to the new-found issues are pushed into the main branch and cherry-picked into the release branch. This allows for further development on the main branch without interfering with the release process.
6. Once all tests are passed, tag the release branch with proper version tag `v{MAJOR}.{MINOR}.0` and run `npm publish`.
7. Create versioned docs by running from repo root `(cd docs && yarn docusaurus docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted).
7. Create versioned docs by running from repo root `(cd docs && yarn docusaurus docs:version {MAJOR}.{MINOR}.x)` (the 'x' part is intentional and is not to be substituted). Also, make sure that all the links in `api-reference` are not broken.
8. Create a PR with the updated docs.
9. Create the release notes on GitHub.
10. Update README.md with release video, if available.
Expand Down
4 changes: 2 additions & 2 deletions apps/computer-vision/app/ocr_vertical/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Spinner from '../../components/Spinner';
import { BottomBar } from '../../components/BottomBar';
import { getImage } from '../../utils';
import { useVerticalOCR, VERTICAL_OCR_ENGLISH } from 'react-native-executorch';
import { useVerticalOCR, OCR_ENGLISH } from 'react-native-executorch';
import { View, StyleSheet, Image, Text, ScrollView } from 'react-native';
import ImageWithBboxes2 from '../../components/ImageWithOCRBboxes';
import React, { useContext, useEffect, useState } from 'react';
Expand All @@ -16,7 +16,7 @@ export default function VerticalOCRScree() {
height: number;
}>();
const model = useVerticalOCR({
model: VERTICAL_OCR_ENGLISH,
model: OCR_ENGLISH,
independentCharacters: true,
});
const { setGlobalGenerating } = useContext(GeneratingContext);
Expand Down
105 changes: 88 additions & 17 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,112 @@
# Website
# React Native ExecuTorch Documentation

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
This directory contains the source code for the documentation website of React Native ExecuTorch, built with [Docusaurus](https://docusaurus.io/).

### Installation
## Getting Started

```
$ yarn
```
### Prerequisites

### Local Development
- Node.js (v20+)
- Yarn

```
$ yarn start
### Installation

Navigate to the `docs` directory and install dependencies:

```bash
cd docs
yarn install
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Running Locally

### Build
Start the development server. **Note:** This command automatically generates the API reference from the TypeScript source before starting the site.

```bash
yarn start
```
$ yarn build
```
The site will open at `http://localhost:3000/react-native-executorch/`.

This command generates static content into the `build` directory and can be served using any static contents hosting service.
## Building
To build the static files for production:

```bash
yarn build
```
The output will be generated in the `build/` directory.

### Deployment
## Deployment

Using SSH:

```
```bash
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
```bash
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

## How API Reference Generation Works

We use `docusaurus-plugin-typedoc` to automatically generate documentation from the TypeScript source code.

1. **Source:** The plugin reads `../packages/react-native-executorch/src/index.ts`.

2. **Generation:** On `yarn start` or `yarn build`, it generates Markdown files into `docs/06-api-reference`.

3. **Sidebar Integration:** Docusaurus strips the number prefix (`06-`) from URLs but requires the folder name for configuration. We use a specific sidebar setup to ensure breadcrumbs work while keeping the UI clean.

### Sidebar Configuration (`sidebars.js`)
The "API Reference" section is configured with specific settings to handle breadcrumbs correctly:

- `collapsed: true`: Keeps the huge list of API files closed by default.

- **`link` property**: Points to `api-reference/index`. This ensures clicking the text "API Reference" redirects to the Overview page.

- **`items` array**: We nest the autogenerated items inside. This is **critical** because it creates the parent-child relationship needed for breadcrumbs (e.g., `Home > API Reference > LLMType`).

### Troubleshooting Sidebar:

If you change the folder structure, ensure `dirName` matches the physical folder (`06-api-reference`), but `id` uses the Docusaurus ID (`api-reference/index`).

## Releasing & Versioning

We use Docusaurus versioning to "freeze" documentation for older releases.

### Creating a New Version

When you release a new npm version (e.g., `1.0.0`), you must snapshot the documentation. Run this command from the `docs/` folder:

```bash
yarn docusaurus docs:version 1.0.0
```
### Why is this important?

1. It copies the current contents of `docs/` (including the **currently generated API reference**) into `versioned_docs/version-1.0.0`.
2. This ensures that if the TypeScript API changes in the future, the docs for v1.0.0 remain accurate to that version.

### Working on "Next"

Edit files in `docs/` as usual. These changes appear in the "Next" version of the site (the default view), reflecting the current `main` branch.

## Troubleshooting

### "Duplicate ID" Errors
If you see build errors about duplicate IDs, it usually means an old generation artifact is conflicting with a new one. Run:

```bash
yarn clear
```
This deletes the `.docusaurus` cache and `build` folder.

### API Docs Not Updating

TypeDoc runs strictly at startup. If you modify comments in the TypeScript package:

1. Stop the server.
2. Run `yarn start` again to regenerate the Markdown files.
5 changes: 2 additions & 3 deletions docs/docs/01-fundamentals/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,5 @@ Adding new functionality to the library follows a consistent three-step integrat
If you want to dive deeper into ExecuTorch or our previous work with the framework, we highly encourage you to check out the following resources:

- [ExecuTorch docs](https://pytorch.org/executorch/stable/index.html)
- [Native code for iOS](https://medium.com/swmansion/bringing-native-ai-to-your-mobile-apps-with-executorch-part-i-ios-f1562a4556e8?source=user_profile_page---------0-------------250189c98ccf---------------)
- [Native code for Android](https://medium.com/swmansion/bringing-native-ai-to-your-mobile-apps-with-executorch-part-ii-android-29431b6b9f7f?source=user_profile_page---------2-------------b8e3a5cb1c63---------------)
- [Exporting to Android with XNNPACK](https://medium.com/swmansion/exporting-ai-models-on-android-with-xnnpack-and-executorch-3e70cff51c59?source=user_profile_page---------1-------------b8e3a5cb1c63---------------)
- [React Native RAG](https://blog.swmansion.com/introducing-react-native-rag-fbb62efa4991)
- [Offline Text Recognition on Mobile: How We Brought EasyOCR to React Native ExecuTorch](https://blog.swmansion.com/bringing-easyocr-to-react-native-executorch-2401c09c2d0c)
4 changes: 4 additions & 0 deletions docs/docs/01-fundamentals/02-loading-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ useExecutorchModule({
The downloaded files are stored in documents directory of your application.
:::

## Predefined Models

Our library offers out-of-the-box support for multiple models. To make things easier, we created aliases for our model exported to `pte` format. For full list of aliases, check out: [API Reference](../06-api-reference/index.md#models---classification)

## Example

The following code snippet demonstrates how to load model and tokenizer files using `useLLM` hook:
Expand Down
13 changes: 12 additions & 1 deletion docs/docs/01-fundamentals/03-frequently-asked-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ Each hook documentation subpage (useClassification, useLLM, etc.) contains a sup

### How can I run my own AI model?

To run your own model, you need to directly access the underlying [ExecuTorch Module API](https://pytorch.org/executorch/stable/extension-module.html). We provide an experimental [React hook](../03-hooks/03-executorch-bindings/useExecutorchModule.md) along with a [TypeScript alternative](../04-typescript-api/03-executorch-bindings/ExecutorchModule.md), which serve as a way to use the aforementioned API without the need of diving into native code. In order to get a model in a format runnable by the runtime, you'll need to get your hands dirty with some ExecuTorch knowledge. For more guides on exporting models, please refer to the [ExecuTorch tutorials](https://pytorch.org/executorch/stable/tutorials/export-to-executorch-tutorial.html). Once you obtain your model in a `.pte` format, you can run it with `useExecuTorchModule` and `ExecuTorchModule`.
To run your own model, you need to directly access the underlying [ExecuTorch Module API](https://pytorch.org/executorch/stable/extension-module.html). We provide [React hook](../03-hooks/03-executorch-bindings/useExecutorchModule.md) along with a [TypeScript alternative](../04-typescript-api/03-executorch-bindings/ExecutorchModule.md), which serve as a way to use the aforementioned API without the need of diving into native code. In order to get a model in a format runnable by the runtime, you'll need to get your hands dirty with some ExecuTorch knowledge. For more guides on exporting models, please refer to the [ExecuTorch tutorials](https://pytorch.org/executorch/stable/tutorials/export-to-executorch-tutorial.html). Once you obtain your model in a `.pte` format, you can run it with `useExecuTorchModule` and `ExecuTorchModule`.

### How React Native ExecuTorch works under the hood?

The general workflow for each functionality in our library goes like this:

- You call a functionality from TypeScript
- TypeScript calls C++ function like model inference or data processing via JSI
- C++ returns result to TypeScript back via JSI
- You get results in TypeScript

Using JSI enables us using **zero-copy data transfer** and **fast, low-level C++**.

### Can you do function calling with useLLM?

Expand Down
Loading
Loading