Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/expo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Expo example
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
expo-checks:
runs-on: ubuntu-latest
env:
CI: '1'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 22
- name: Install dependencies
run: yarn install --immutable

- name: Build local library
run: yarn prepare

- name: Check Expo dependencies
working-directory: example
run: npx --yes expo-doctor@1.20.4 --verbose

- name: Export native bundles
run: yarn example export

build-android:
runs-on: ubuntu-latest
env:
CI: '1'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 22
- name: Install dependencies
run: yarn install --immutable

- name: Build local library
run: yarn prepare

- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: zulu
java-version: '17'

- name: Generate Android project
run: yarn example prebuild --clean --no-install --platform android

- name: Build Android example
run: yarn example build:android

build-ios:
runs-on: macos-latest
env:
CI: '1'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 22
- name: Install dependencies
run: yarn install --immutable

- name: Build local library
run: yarn prepare

- name: Use Xcode 26
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '26'

- name: Generate iOS project
run: yarn example prebuild --clean --no-install --platform ios

- name: Install CocoaPods dependencies
working-directory: example/ios
run: pod install

- name: Build iOS example
run: yarn example build:ios

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ CLAUDE.md
.claude/
GEMINI.md
.gemini/

# Generated Expo example projects
/example/ios/
/example/android/
/example/dist/
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The [example app](/example/) demonstrates usage of the library. You need to run

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.

Generate the native example projects first with `yarn example prebuild --clean`. See [the Expo example setup](example/README.md) for prerequisites and configuration. Keep example native changes in config plugins because regeneration replaces these directories.

If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ZstdExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-zstd`.

To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-zstd` under `Android`.
Expand Down
87 changes: 16 additions & 71 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,24 @@
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
# Expo development example

# Getting Started
This example uses Expo SDK 57 and a development build containing the local native library. Expo Go cannot load it.
Run these commands from the repository root:

>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.

## Step 1: Start the Metro Server

First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.

To start Metro, run the following command from the _root_ of your React Native project:

```bash
# using npm
npm start

# OR using Yarn
yarn start
```sh
yarn install --immutable
yarn prepare
yarn example prebuild --clean
yarn example android
# Or: yarn example ios
```

## Step 2: Start your Application

Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:

### For Android

```bash
# using npm
npm run android

# OR using Yarn
yarn android
```

### For iOS

```bash
# using npm
npm run ios

# OR using Yarn
yarn ios
```

If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.

This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.

## Step 3: Modifying your App

Now that you have successfully run the app, let's modify it.

1. Open `App.tsx` in your text editor of choice and edit some lines.
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!

For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!

## Congratulations! :tada:

You've successfully run and modified your React Native App. :partying_face:

### Now what?

- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).

# Troubleshooting
Use `yarn example start` for subsequent JavaScript development. Rebuild after changing native code.
The example's `ios/` and `android/` directories are generated and ignored. Keep native configuration in app config and config plugins; `prebuild --clean` replaces generated projects.

If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
Validate with `yarn lint`, `yarn typecheck`, `yarn prepare`, `yarn example export`, and `cd example && npx expo-doctor@1.20.4`.
After prebuild, `yarn example build:android` builds an arm64 debug APK and `yarn example build:ios` compiles an unsigned simulator app. CI runs both native builds.

# Learn More
Initialize the native dependency first with `git submodule update --init --recursive`. Run `yarn test --runInBand` for the existing Jest suite.

To learn more about React Native, take a look at the following resources:
The playground includes editable text, JSON, repetition, Unicode, and empty-input samples, with levels 1, 3, and 9 and round-trip verification. The benchmark compares native Zstd with the example-only `zstdify` development dependency using your input or generated JSON. It reports timings, throughput, output sizes, and cross-decoding checks; expand Methodology for measurement details. Use a release build on a physical device for representative performance.

- [React Native Website](https://reactnative.dev) - learn more about React Native.
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
Theme colors and bundled Raleway/Montserrat fonts follow obiapp-ui without importing it. Font licenses are included in `assets/fonts/`.
120 changes: 0 additions & 120 deletions example/android/app/build.gradle

This file was deleted.

Binary file removed example/android/app/debug.keystore
Binary file not shown.
10 changes: 0 additions & 10 deletions example/android/app/proguard-rules.pro

This file was deleted.

9 changes: 0 additions & 9 deletions example/android/app/src/debug/AndroidManifest.xml

This file was deleted.

25 changes: 0 additions & 25 deletions example/android/app/src/main/AndroidManifest.xml

This file was deleted.

Loading
Loading