You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-25Lines changed: 0 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,8 +96,6 @@ The renderer creates text nodes and styled spans rather than injecting HTML. The
96
96
97
97
Status events have a `type` of `monaco-loading`, `monaco-ready`, `clangd-downloading`, `clangd-starting`, `clangd-ready`, or `clangd-error`. Download events also contain `loaded` and, when the server provides it, `total` bytes.
98
98
99
-
See [demo/index.html](demo/index.html), [demo/demo.js](demo/demo.js), and [demo/demo.css](demo/demo.css) for a complete framework-free highlighted fallback editor, seamless handoff, ANSI-aware Run output, and Compiler Explorer link. The demo's **Show fallback / Show Monaco** toggle recreates the fallback on demand for visual comparison; the normal one-way startup handoff still removes and cleans up the fallback.
100
-
101
99
## Headers
102
100
103
101
The host document must be cross-origin isolated for clangd's SharedArrayBuffer/pthread build:
@@ -161,29 +159,6 @@ Install an existing artifact directory or archive with:
161
159
162
160
The input must contain `clangd.js`, `clangd.wasm`, and any other `clangd*` files produced by Emscripten. `build.sh` remains a separate manual reference workflow and is not invoked by `pnpm build` or CI.
163
161
164
-
## Cross-origin demo and tests
165
-
166
-
Build first, then start all acceptance origins:
167
-
168
-
```bash
169
-
pnpm build
170
-
pnpm demo:origins
171
-
```
172
-
173
-
-`http://localhost:4173` serves the demo host with COOP/COEP.
174
-
-`http://localhost:4174` serves runtime assets with CORS/CORP.
175
-
-`http://localhost:4175` serves the same runtime at `/assets/clangd/` for same-origin testing.
176
-
-`http://localhost:4176` serves a non-isolated host for graceful-degradation testing.
177
-
178
-
Run the Chromium acceptance suite with:
179
-
180
-
```bash
181
-
pnpm exec playwright install chromium
182
-
pnpm test:browser
183
-
```
184
-
185
-
The tests cover immediate fallback editing and Run, delayed runtime/WASM, edit-preserving handoff, DOM ownership, cross-origin isolation and worker startup, real clangd diagnostics, failure behavior, and same-origin extraction layout.
186
-
187
162
## Compiler Explorer Run UI
188
163
189
164
Compilation is intentionally a host concern. The demo keeps an `activeEditor.getValue()` abstraction that initially reads the textarea and later points to Monaco, then sends that source directly to the Compiler Explorer API. This makes Run independent of both Monaco and clangd readiness.
Copy file name to clipboardExpand all lines: public/index.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,9 @@
9
9
<body>
10
10
<main>
11
11
<pclass="eyebrow">C++ - Monaco - clangd</p>
12
-
<h1>Edit and run C++ in the browser</h1>
13
-
<pclass="intro">The native editor is ready now. Monaco and clangd upgrade it in the background.</p>
12
+
<h1>Code blocks with clangd support</h1>
13
+
<pclass="intro">The simple fallback editor is ready immediately. Monaco and clangd upgrade it in the background.</p>
14
+
<pclass="intro">This is intended to be used on <ahref="https://cpp.social">cpp.social</a>, but if you find use for this please do reach out. This tool is based on Guyutongxue's excellent work in <ahref="https://github.com/guyutongxue/clangd-in-browser/">guyutongxue/clangd-in-browser</a>.</p>
0 commit comments