feat: enable React Scan in web HMR dev mode

Adds a new `hmr-react-scan` web dev option in `oc-dev`
Turns on React Scan via `VITE_ENABLE_REACT_SCAN` for that mode
Documents Electron workspace trust so fresh installs fetch the runtime automatically
This commit is contained in:
Bohdan Triapitsyn
2026-07-20 12:54:46 +03:00
parent 70e7c37372
commit ca1cf9a3d1
3 changed files with 10 additions and 2 deletions
+2
View File
@@ -38,6 +38,8 @@ bun run electron:dev
`bun run electron:dev` starts the web dev server with HMR, then launches Electron against `packages/electron/main.mjs`. `bun run electron:dev` starts the web dev server with HMR, then launches Electron against `packages/electron/main.mjs`.
The Electron workspace package trusts Electron's install script so `bun install` downloads the platform runtime in fresh checkouts and worktrees.
Useful variants: Useful variants:
```bash ```bash
+3
View File
@@ -17,6 +17,9 @@
"electron": "^41.2.1", "electron": "^41.2.1",
"electron-builder": "^26.0.0" "electron-builder": "^26.0.0"
}, },
"trustedDependencies": [
"electron"
],
"desktopPrerequisites": [ "desktopPrerequisites": [
"Electron runtime dependencies installed via bun install", "Electron runtime dependencies installed via bun install",
"Bun available for sidecar compilation", "Bun available for sidecar compilation",
+5 -2
View File
@@ -64,7 +64,7 @@ Options:
--deployment-mode <global|testing> --deployment-mode <global|testing>
--remote-id <id> Remote deployment id from ${configPath} --remote-id <id> Remote deployment id from ${configPath}
--target <test-api|test-ui> Compatibility alias for remote deployment selection --target <test-api|test-ui> Compatibility alias for remote deployment selection
--web-mode <hmr|hmr-lan|full> --web-mode <hmr|hmr-react-scan|hmr-lan|full>
--mobile-mode <ios-sim-local|ios-sim-lan|android-local|android-lan> --mobile-mode <ios-sim-local|ios-sim-lan|android-local|android-lan>
--mobile-task <task> --mobile-task <task>
--adb-address <host:port> Wireless ADB address for android-connect --adb-address <host:port> Wireless ADB address for android-connect
@@ -409,11 +409,14 @@ async function deployRemoteWeb(options, config) {
async function startWebDev(options) { async function startWebDev(options) {
const mode = await chooseValue(options.webMode, [ const mode = await chooseValue(options.webMode, [
{ value: 'hmr', label: 'Web HMR' }, { value: 'hmr', label: 'Web HMR' },
{ value: 'hmr-react-scan', label: 'Web HMR + React Scan' },
{ value: 'hmr-lan', label: 'Web HMR LAN/mobile' }, { value: 'hmr-lan', label: 'Web HMR LAN/mobile' },
{ value: 'full', label: 'Web prod-like' }, { value: 'full', label: 'Web prod-like' },
], 'Select web dev mode'); ], 'Select web dev mode');
if (mode === 'hmr-lan') { if (mode === 'hmr-react-scan') {
run('bun', ['run', 'dev:web:hmr'], { env: { VITE_ENABLE_REACT_SCAN: '1' } });
} else if (mode === 'hmr-lan') {
log.info('Starting web HMR LAN/mobile loop. Open the LAN URL printed after startup.'); log.info('Starting web HMR LAN/mobile loop. Open the LAN URL printed after startup.');
run('bun', ['run', 'dev:web:hmr'], { env: { OPENCHAMBER_HMR_HOST: '0.0.0.0' } }); run('bun', ['run', 'dev:web:hmr'], { env: { OPENCHAMBER_HMR_HOST: '0.0.0.0' } });
} else if (mode === 'full') { } else if (mode === 'full') {