From b724a71d87e4df0ce70f8c243fda2363b0bbff77 Mon Sep 17 00:00:00 2001 From: Ben Dodson Date: Thu, 12 Mar 2026 08:55:28 -0700 Subject: [PATCH 1/4] Update AGENTS.md --- AGENTS.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ac3a856b..0892cbba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,6 +12,60 @@ Valdi has been used in production at Snap for 8 years and is now available as op The Valdi compiler takes TypeScript source files (using TSX/JSX syntax) and compiles them into `.valdimodule` files. These compiled modules are read by the Valdi runtime on each platform to render native views. **This is not TypeScript rendered in a WebView** - Valdi generates true native UI components. +## Android Hot Reload And Logs + +For local Android iteration, prefer the standalone Valdi app plus the hot reloader over repeated native rebuilds. + +### Repo-local CLI fallback + +If `valdi` is not on `PATH`, use the repo-local CLI directly: + +```bash +cd /path/to/Valdi +npm ci --prefix npm_modules/cli +node npm_modules/cli/dist/index.js hotreload --target //path/to:your_app_hotreload +``` + +This is useful when the global CLI is not installed but the repo checkout is available. + +### Typical Android loop + +1. Install or refresh the app: + +```bash +cd /path/to/project +node ../Valdi/npm_modules/cli/dist/index.js install android --application //modules/Valdi_Dil:dil_playground_app --device_id emulator-5554 +``` + +2. Launch the installed app: + +```bash +adb -s emulator-5554 shell am start -W -n com.snap.valdi.dil_playground_app/.StartActivity +``` + +3. Start hot reload: + +```bash +cd /path/to/project +node ../Valdi/npm_modules/cli/dist/index.js hotreload --target //modules/Valdi_Dil:dil_playground_app_hotreload +``` + +### Logs + +For the fastest signal on Android, tail the Valdi tag directly: + +```bash +adb -s emulator-5554 logcat 'Valdi:I' '*:S' +``` + +That shows app-side Valdi and `[JS]` logs without the rest of logcat noise. + +### Practical notes + +- The first hot reload startup can be slow because Bazel may build toolchains and native dependencies the first time. +- If you add a new file, Bazel target, or other build graph input, restart the hot reloader after the change. +- For UI-only edits inside already-tracked files, prefer leaving the hot reloader running and saving the file to trigger an incremental rebuild. + ## 🚨 AI Anti-Hallucination: This is NOT React! **CRITICAL**: Valdi uses TSX/JSX syntax but **is fundamentally different from React**. The most common AI error is suggesting React patterns that do not exist in Valdi. From c0210fbb8edf36b4158089319b11f36ed0ad8a5b Mon Sep 17 00:00:00 2001 From: Ben Dodson Date: Fri, 13 Mar 2026 09:53:20 -0700 Subject: [PATCH 2/4] Update AGENTS.md --- AGENTS.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 0892cbba..6f01ca14 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,18 +16,6 @@ The Valdi compiler takes TypeScript source files (using TSX/JSX syntax) and comp For local Android iteration, prefer the standalone Valdi app plus the hot reloader over repeated native rebuilds. -### Repo-local CLI fallback - -If `valdi` is not on `PATH`, use the repo-local CLI directly: - -```bash -cd /path/to/Valdi -npm ci --prefix npm_modules/cli -node npm_modules/cli/dist/index.js hotreload --target //path/to:your_app_hotreload -``` - -This is useful when the global CLI is not installed but the repo checkout is available. - ### Typical Android loop 1. Install or refresh the app: From 0d43d3f58813bf70fb60bb72714d731cdcf7d846 Mon Sep 17 00:00:00 2001 From: Ben Dodson Date: Wed, 25 Mar 2026 10:12:24 -0700 Subject: [PATCH 3/4] Update AGENTS.md --- AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6f01ca14..86d92e6d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,7 @@ For local Android iteration, prefer the standalone Valdi app plus the hot reload ```bash cd /path/to/project -node ../Valdi/npm_modules/cli/dist/index.js install android --application //modules/Valdi_Dil:dil_playground_app --device_id emulator-5554 +valdi install android --application //modules/Valdi_Dil:dil_playground_app --device_id emulator-5554 ``` 2. Launch the installed app: @@ -35,7 +35,7 @@ adb -s emulator-5554 shell am start -W -n com.snap.valdi.dil_playground_app/.Sta ```bash cd /path/to/project -node ../Valdi/npm_modules/cli/dist/index.js hotreload --target //modules/Valdi_Dil:dil_playground_app_hotreload +valdi hotreload --target //modules/Valdi_Dil:dil_playground_app_hotreload ``` ### Logs From 72758104a78406fad8cd012e584c64f0b8962f95 Mon Sep 17 00:00:00 2001 From: Ben Dodson Date: Wed, 25 Mar 2026 10:15:35 -0700 Subject: [PATCH 4/4] Update AGENTS.md --- AGENTS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 86d92e6d..f72b1421 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,20 +22,20 @@ For local Android iteration, prefer the standalone Valdi app plus the hot reload ```bash cd /path/to/project -valdi install android --application //modules/Valdi_Dil:dil_playground_app --device_id emulator-5554 +valdi install android --application //modules/Valdi_Demo:demo_app --device_id emulator-5554 ``` 2. Launch the installed app: ```bash -adb -s emulator-5554 shell am start -W -n com.snap.valdi.dil_playground_app/.StartActivity +adb -s emulator-5554 shell am start -W -n com.snap.valdi.demo_app/.StartActivity ``` 3. Start hot reload: ```bash cd /path/to/project -valdi hotreload --target //modules/Valdi_Dil:dil_playground_app_hotreload +valdi hotreload --target //modules/Valdi_Demo:demo_app_hotreload ``` ### Logs