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
13 changes: 7 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ announces itself in `$TMPDIR/vite-plugin-fable/daemon-<pid>.json`.
expression, which can match a `toThrow` regex and pass for the wrong reason.
- **The stub daemon must return files downstream of the edited one**, because the real daemon
does. Tests that only return the requested file agree with bugs the plugin no longer has.

## `patches/`

`crossws@0.4.12.patch` drops a guard that refuses to run crossws's Node WebSocket adapter under
Bun. Without it, Vite DevTools cannot start on the Bun runtime. Pinned to that exact version, so a
bump needs it rebased; upstream fix tracked at devframes/devframe#317.
- **On Bun, the embedded DevTools RPC runs over SSE, not WebSocket.** Vite owns the `node:http`
server, and devframe cannot re-host a foreign server on a native runtime, so it advertises
`"backend":"sse"` in `/__devtools/__connection.json` and the RPC rides `/__devtools/__sse`. The
`crossws/adapters/bun` transport only binds in servers devframe owns (hub CLI, sidecar), so a
`ws://localhost:4000/__ws` probe timing out proves nothing. Routes sit under `/__devtools/`, and
Vite's SPA fallback answers 200 with `index.html` for wrong paths. Fixed by devframe 0.9.9
(devframes/devframe#322); before that it needed `patches/crossws@0.4.12.patch`, since removed.
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ What this shape would still not show is the plugin's own view: which files a hot

**How it actually runs**, which is not shaped like `vite-plugin-inspect`

DevTools is a **separate CLI on its own port**, not a route on your dev server. `vite-devtools` (shipped as a bin by `@vitejs/devtools`) reads the Vite config, starts on port 9999 by default and opens a browser. Adding `DevTools()` to `plugins` injects nothing into the app page and mounts no `/__devtools/` route. The embedded panel does work on Bun, but only because of `patches/crossws@0.4.12.patch`; `CLAUDE.md` covers what that patch does and why it is pinned.
DevTools is a **separate CLI on its own port**, not a route on your dev server. `vite-devtools` (shipped as a bin by `@vitejs/devtools`) reads the Vite config, starts on port 9999 by default and opens a browser. The embedded `DevTools()` plugin does mount a `/__devtools/` base on the dev server (connection meta, SSE RPC, viewer assets), but injects nothing visible into the app page. It works on Bun: since devframe 0.9.9 the RPC transport adapts to the runtime, and under Vite it falls back to SSE.

**Unverified, and the reason not to start yet**

Expand All @@ -52,7 +52,7 @@ Whether custom panels are supported at all. `@vitejs/devtools-kit` and `@vitejs/
**To do**

- [ ] Confirm whether custom panels are supported, and how, before building anything against an early-preview tool.
- [ ] Track [devframes/devframe#317](https://github.com/devframes/devframe/issues/317); the embedded plugin needs it, the standalone CLI does not. Until it lands, a `crossws` bump needs the patch rebased.
- [x] Track [devframes/devframe#317](https://github.com/devframes/devframe/issues/317); fixed in devframe 0.9.9 ([#322](https://github.com/devframes/devframe/pull/322)), which binds a runtime-appropriate RPC transport on Bun/Deno. The `crossws` patch is removed.
- [ ] If both clear, decide whether a panel earns its keep next to `/api`, and if so build it and delete `debug/index.html` and the WebSocket feed.

## 3. Plain F# modules always force a page reload
Expand Down
137 changes: 71 additions & 66 deletions bun.lock

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@
"copy-to-clipboard": "^4.0.2",
"keep-a-changelog": "^3.1.0",
"lit": "^3.3.3",
"oxfmt": "0.65.0",
"oxlint": "^1.80.0",
"oxfmt": "0.66.0",
"oxlint": "^1.81.0",
"typescript": "7.0.2"
},
"patchedDependencies": {
"crossws@0.4.12": "patches/crossws@0.4.12.patch"
}
}
2 changes: 1 addition & 1 deletion packages/vite-plugin-fable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"devDependencies": {
"@types/bun": "^1.4.0",
"@types/node": "^26.4.0",
"@types/node": "^26.4.1",
"typescript": "7.0.2",
"vite": "catalog:"
},
Expand Down
13 changes: 0 additions & 13 deletions patches/crossws@0.4.12.patch

This file was deleted.

6 changes: 3 additions & 3 deletions sample-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"devDependencies": {
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.5",
"@vitejs/devtools": "^0.6.2",
"@vitejs/devtools-vite": "^0.6.2",
"@types/react-dom": "^19.2.7",
"@vitejs/devtools": "^0.7.1",
"@vitejs/devtools-vite": "^0.7.1",
"@vitejs/plugin-react": "^6.1.1",
"vite": "catalog:",
"vite-plugin-fable": "workspace:*",
Expand Down