Document Monaco TypeScript mode for AssemblyScript editing
- Monaco's built-in TS language service provides IDE features - AS type definitions loaded at startup for autocomplete - Real errors come from `asc` compiler at build time - No separate LSP server (asls) needed = zero infra cost Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3a128d4d1f
commit
51cd94f0f2
1 changed files with 39 additions and 1 deletions
|
|
@ -128,10 +128,47 @@ Nextra is a SaaS platform for building AI agent workflows using the xml-pipeline
|
|||
- **UI Generation:** Vercel v0
|
||||
- **Components:** shadcn/ui + Tailwind CSS
|
||||
- **Flow Canvas:** React Flow (Xyflow)
|
||||
- **Code Editor:** Monaco Editor
|
||||
- **Code Editor:** Monaco Editor (TypeScript mode)
|
||||
- **State:** Zustand or Jotai
|
||||
- **API Client:** tRPC or React Query
|
||||
|
||||
#### Code Editor Architecture (Pro+ WASM)
|
||||
|
||||
AssemblyScript editing uses Monaco's built-in TypeScript language service — no separate
|
||||
language server required. Since AssemblyScript is a strict TypeScript subset, this provides:
|
||||
|
||||
- Syntax highlighting
|
||||
- Autocomplete / IntelliSense
|
||||
- Type checking
|
||||
- Error diagnostics
|
||||
|
||||
The AssemblyScript type definitions (`.d.ts`) are loaded into Monaco at startup.
|
||||
|
||||
```
|
||||
User writes code in Monaco (TypeScript mode)
|
||||
│
|
||||
▼
|
||||
Real-time feedback from TS language service
|
||||
(syntax, types, autocomplete)
|
||||
│
|
||||
▼
|
||||
User clicks "Build" / "Deploy"
|
||||
│
|
||||
▼
|
||||
Backend runs `asc` compiler
|
||||
│
|
||||
├── Success → .wasm file stored, module registered
|
||||
│
|
||||
└── Errors → Returned to UI with line numbers
|
||||
(Monaco shows error markers)
|
||||
```
|
||||
|
||||
**Why no AssemblyScript Language Server (asls)?**
|
||||
- Monaco TypeScript covers 90%+ of editing needs
|
||||
- The `asc` compiler catches AS-specific errors accurately at build time
|
||||
- Eliminates $7+/month infrastructure cost
|
||||
- Zero cold-start latency (runs in browser)
|
||||
|
||||
#### Key Pages
|
||||
|
||||
| Route | Purpose |
|
||||
|
|
@ -744,6 +781,7 @@ Paid tier flows:
|
|||
|----------|--------|-----------|
|
||||
| Frontend Framework | Next.js | v0 generates it, Vercel hosts it |
|
||||
| Canvas Library | React Flow | Most popular, good docs, n8n uses it |
|
||||
| Code Editor | Monaco (TS mode) | No LSP server needed; asc compiler catches AS errors |
|
||||
| Control Plane | FastAPI | Matches xml-pipeline, async-native |
|
||||
| Database | PostgreSQL | Render managed, reliable |
|
||||
| Cache/Pubsub | Redis | Already needed for xml-pipeline shared backend |
|
||||
|
|
|
|||
Loading…
Reference in a new issue