r/expo • • 1h ago

Yeah, it’s Expo!!!

3 Upvotes

I launched the world’s most beautiful water tracker. I was tired of how ugly and generic they all looked, so I decided to make the most beautiful one-one that makes you want to open it as often as possible and play around with it.

I got bored of using a tracker that was too basic, I had absolutely no desire to open an app just to tap the “refill” button, so I decided to build my own solution.

In the end, I’m incredibly happy with how it works and yes, it’s built with Expo. I’d love to hear your feedback and questions.

P.S. I thought about naming the app “Liquid Glass” because it’s basically a glass of water.

App Store: https://apps.apple.com/us/app/mizu-water-tracker-reminder/id6814633548


r/expo • • 28m ago

Running local GGUF LLMs (Llama 3.2) 100% offline in Expo 52 — Config Plugin setup & handling mobile OOMs

1 Upvotes

Hey everyone,

A common misconception I kept hearing in the React Native community is that running heavy on-device LLMs (via C++ llama.cpp bindings) requires ejecting into a messy bare workflow and manually hacking Gradle and CMake scripts every time.

Over the past few weeks, I’ve been testing and documenting a turnkey setup running Llama 3.2 (1B/3B) and Qwen 2.5 completely offline inside an Expo 52 project using Custom Development Clients (expo-dev-client) and Continuous Native Generation (prebuild).

Here are the key architecture hurdles and how we solved them for Expo:

  1. Native C++ Bindings via Config Plugins

Instead of touching native Android/iOS directories manually, we configured llama.rn (llama.cpp C++ bindings) through Expo config plugins.

- On iOS: Podspec configuration targets modern Apple Silicon frameworks (Accelerate and Metal).

- On Android: Custom build properties configure the NDK 26+ toolchain and CMake flags directly through app.json, so running "npx expo prebuild --clean" builds cleanly every time.

2. Model File Management (No binary bloat)

You can't (and shouldn't) bundle a 1.2GB GGUF model file inside your Expo app binary.

- We use expo-file-system to stream and manage local GGUF models directly to the app’s documentDirectory.

- Added checksum verification before loading into memory so corrupted downloads don't trigger native SIGSEGV crashes.

3. Preventing JS Thread Freezing & Thermal Runaway

Running inference on mobile hardware will easily trigger OS memory watchdogs (OOM kills) if peak RAM crosses ~1.2GB.

- Duty-Cycle Throttling: Token generation yields sub-millisecond slices back to the OS, allowing heat dissipation and ensuring the JS bridge and UI animations stay responsive at 60fps.

- Context Size Limits: Bound default context windows to 2048 with 4-bit KV caching, keeping active RAM consumption under ~850MB for 1B Q4_K_M quants.

- Token Checkpointing: Streaming tokens are committed to local SQLite incrementally, so if the app is backgrounded, user session history remains intact.

Real Device Performance (Llama 3.2 1B Q4_K_M):

- iPhone (A16 / A17 Pro): ~16 – 22 tokens/sec

- Snapdragon 8 Gen 2 / Gen 3: ~12 – 18 tokens/sec

- Mid-range (Dimensity 7000 / 8000): ~6 – 10 tokens/sec

The architecture, Expo config plugin examples, and documentation are open on GitHub:

https://github.com/Itsvks17/localai-mobile

Curious to hear from other Expo devs: is anyone else experimenting with local edge AI in Expo 52? How are you handling model downloading and caching strategies in production?


r/expo • • 1h ago

Why is dex code optimization at 0% in android

1 Upvotes
 android: {
            enableMinifyInReleaseBuilds: true,
            enableShrinkResourcesInReleaseBuilds: true,


            extraProguardRules: `
              -keep class androidx.work.impl.WorkDatabase_Impl {
                  <init>();
              }
                    `,
          },

I have already done this. My obfuscation percentage and shrinking percentage are both decent, but why aint my optimization optimizing?


r/expo • • 5h ago

Expo starter pack SDK 58 is out: no more hand-written query keys, a complete UI kit, built-in documentation, now on npm

1 Upvotes

I posted this Expo starter a couple weeks ago, and I promised an SDK 58 update soon. A commenter also suggested generating the query keys from the OpenAPI spec instead of hand writing key factories, and I said I'll add it on the next drop. Both are out now. It's on SDK 58, the spec-derived queries and mutations cover the whole data layer, and it's now an npm package, so you can start a project with:

npx create-expo-app my-app --template u/amirgazerani/expo-starter-pack

There's a LOT more into this release, so here's all of it.

SDK 58

The starter now runs on Expo SDK 58 with React Native 0.88, React 19.3 and the New Architecture, with expo-router's typed routes. If you're still on SDK 57, that version stays available on GitHub under the sdk-57 tag.

Query keys and mutations come from the spec

Before, every resource had a key factory I had to keep in sync with the backend:

ts

export const itemKeys = {
  all: ["items"] as const,
  lists: () => [...itemKeys.all, "list"] as const,
  detail: (id: number) => [...itemKeys.all, "detail", id] as const,
};

Now keys and query options are derived from the method and path, so there are no factories, and a create mutation is this:

ts

export function useCreateItem() {
  const queryClient = useQueryClient();
  return $api.useMutation("post", "/v1/items", {
    onSuccess: () =>
      queryClient.invalidateQueries({
        queryKey: $api.queryOptions("get", "/v1/items").queryKey,
      }),
    meta: { skipGlobalError: true },
  });
}

I invalidate with the same call I fetch with, and the mutation variables are the request itself: mutate({ body, params }). If the backend renames something, I regenerate the types and TypeScript lists every call that broke.

Mutations that need to shape the request, like login, which adds the device name and stores the token, are still written by hand using the same predesigned conventions as before.

A complete UI kit instead of scattered components

This is the biggest visual change. The kit now has buttons (solid, outline, ghost and gradient), inputs, text areas, switches, checkboxes, radio groups, chips, badges, avatars, cards, dropdowns, modals and toasts. Modals come as center, bottom sheet, fullscreen and side drawer. Everything that used to be decided per component is now centralized:

  • Theme tokens for colors, radius and spacing, with light and dark mode. To rebrand, edit one file.
  • Typography in one file. List your font files, map them to the four weights and pick a default family. Body text, button labels and field labels each get their own default weight, so changing the font of the whole app is one setting, and no component hard-codes a font.
  • One size scale (sm, md, lg) shared by every control, so a md button and a md input are the same height. To make the whole kit a bit bigger, change the numbers once. A single component can still override.

I also replaced sonner-native with my own toast store, so toast.error() works from anywhere, not only inside components. It has swipe to dismiss, a countdown bar and dedupe, and the modal mounts its own host so toasts show above it.

The app documents itself

The Home tab documents every component with its props, an import line and live variants. The Data tab explains the networking, mutations, how the token is stored and how errors are handled. A demo dashboard shows an infinite list, create and delete, and a profile form with inline validation errors, and each section names the file it's built from.

When you start a real project, npm run strip-example removes all of it, plus any API resource only the demo used, and leaves a Hello world home screen and an empty dashboard under the same auth guard. It shows you the plan first, won't run on a dirty git tree, and type-checks before and after.

Backend

The mock backend is still there, and the template assumes a Laravel-style JSON API for your real backend. If yours is different, no worries, the README lists the files you need to change.

Links:

Give it a shot and tell me how it goes. If you like it, a star on the repo helps. If you have a suggestion, open an issue; they'll be evaluated.


r/expo • • 6h ago

Created first game using Expo

1 Upvotes

Created my first game using Expo + React Native Skia

check my game out Bitwalker. It is offline game with no ads.