Skip to content

Adding Quest Viva WebEditor#1716

Merged
alexwarren merged 14 commits into
mainfrom
webeditor-wasm
May 8, 2026
Merged

Adding Quest Viva WebEditor#1716
alexwarren merged 14 commits into
mainfrom
webeditor-wasm

Conversation

@alexwarren
Copy link
Copy Markdown
Contributor

This PR adds the scaffolding for the new Quest Viva WebEditor. It will replace Quest 5's desktop and web editors, running entirely locally (in the browser, or wrapped in a desktop app) - compiling the C# code to WASM for an in-browser "back-end", with a Svelte front-end talking to it.

alexwarren and others added 14 commits May 3, 2026 11:52
- Add WasmEditor project (net10.0/browser-wasm) with JSExport bridge:
  Initialise, GetTreeNodes, GetEditorData, Save, Undo, Redo
- Add ByteArrayGameDataProvider to Common for passing file bytes from JS
- Change EditorController.Initialise to accept IGameDataProvider instead
  of a filename string; update EditorCoreTests call sites accordingly
- Remove unused System.Data.DataSetExtensions from EditorCore.csproj
- Use source-generated JSON (JsonSerializerContext) and
  [assembly: SupportedOSPlatform("browser")] — builds with zero warnings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add src/WebEditor/ — SvelteKit 2 / Svelte 5 / Vite 6 project
- vite.config.ts serves WasmEditor AppBundle at /AppBundle/ with COOP/COEP
  headers required for .NET WASM SharedArrayBuffer
- src/lib/wasm.ts loads the .NET runtime and exposes WasmBridge
- src/lib/editor-store.ts wraps all WASM calls behind Svelte stores
- Welcome page: file picker → Uint8Array → Initialise() → /editor
- Editor page: TreePanel (hierarchical, indented) + PropertyEditor (attr list)
  + Toolbar (save-as-download, undo, redo)
- Simplify WasmEditor/Program.cs — no JSHost.ImportAsync needed until
  JSImport callbacks are wired up in a later phase

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Wire up SvelteKit to the .NET WASM runtime via a dynamic import (new Function
  pattern) pointing at /AppBundle/_framework/dotnet.js, with nested object
  property access for exports (exports.QuestViva.WasmEditor.WasmEditorBridge)
- Fix tree population: subscribe no-op handlers to ClearTree/BeginTreeUpdate/
  EndTreeUpdate so UpdateTree() doesn't bail early, then call UpdateTree() after
  Initialise succeeds
- Fix JSON camelCase: add JsonSourceGenerationOptions(CamelCase) so tree node keys
  deserialise correctly in TypeScript (was causing each_key_duplicate errors)
- Fix navigation guard: replace $effect (fires during SSR) with onMount + get()
  so redirecting to / only runs client-side
- Add +layout.ts disabling SSR/prerender for the WASM SPA
- Add return; to Program.cs to satisfy CS5001 entry-point requirement
- Set Vite dev server port to 5174 to avoid clash with Squiffy editor
- Add build-editor.sh convenience script for rebuilding the WASM module

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alexwarren alexwarren marked this pull request as ready for review May 8, 2026 13:07
@alexwarren alexwarren merged commit 2c37514 into main May 8, 2026
2 checks passed
@alexwarren alexwarren deleted the webeditor-wasm branch May 8, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant