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:
@@ -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`.
|
||||
|
||||
The Electron workspace package trusts Electron's install script so `bun install` downloads the platform runtime in fresh checkouts and worktrees.
|
||||
|
||||
Useful variants:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
"electron": "^41.2.1",
|
||||
"electron-builder": "^26.0.0"
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"electron"
|
||||
],
|
||||
"desktopPrerequisites": [
|
||||
"Electron runtime dependencies installed via bun install",
|
||||
"Bun available for sidecar compilation",
|
||||
|
||||
+5
-2
@@ -64,7 +64,7 @@ Options:
|
||||
--deployment-mode <global|testing>
|
||||
--remote-id <id> Remote deployment id from ${configPath}
|
||||
--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-task <task>
|
||||
--adb-address <host:port> Wireless ADB address for android-connect
|
||||
@@ -409,11 +409,14 @@ async function deployRemoteWeb(options, config) {
|
||||
async function startWebDev(options) {
|
||||
const mode = await chooseValue(options.webMode, [
|
||||
{ value: 'hmr', label: 'Web HMR' },
|
||||
{ value: 'hmr-react-scan', label: 'Web HMR + React Scan' },
|
||||
{ value: 'hmr-lan', label: 'Web HMR LAN/mobile' },
|
||||
{ value: 'full', label: 'Web prod-like' },
|
||||
], '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.');
|
||||
run('bun', ['run', 'dev:web:hmr'], { env: { OPENCHAMBER_HMR_HOST: '0.0.0.0' } });
|
||||
} else if (mode === 'full') {
|
||||
|
||||
Reference in New Issue
Block a user