How chicagodave/fyrevmweb-react works
Project Type and Purpose
• This is a frontend-centric web application platform for running Inform 7 interactive fiction stories in the browser.
• Core responsibilities:
• Hosting and rendering a compiled story file (.ulx)
• Wrapping and coordinating a Glulx interpreter (glulx-typescript)
• Managing VM memory (FyreVMMem)
• Presenting a React/semantic-UI user interface
Out the Major Code Areas (Top-Level Directories)
• src/
• FyreVMWeb wrapper & memory manager (src/FyreVMWeb)
• React components (src/components)
• Story templates (src/templates/standard)
• Entry point (src/index.js)
• public/
• index.html (loads the app)
• Sample compiled story (Cloak of Darkness.ulx)
• extensions/ – optional Inform extensions (.i7x files)
• projects/ – raw Inform source (.ni) for local compilation
• Submodules (via .gitmodules):
• glulx-typescript engine
Key Runtime Components
a. Browser / Host Environment
• Loads index.html + bundle.js (webpack or similar)
b. FyreVMWeb Manager (src/FyreVMWeb/FyreVMWeb.ts + .js)
• Initializes and orchestrates the Glulx interpreter
c. Glulx-TypeScript Engine (submodule)
• Executes the .ulx story bytecode
d. FyreVM Memory Manager (src/FyreVMWeb/FyreVMMem.ts)
• Provides custom memory allocation & inspection APIs
e. UI Layer
• React components (EmbeddedCommandLine, StatusLine, HintsStandard, etc.)
• Templates (Story.jsx) define layout & styling via semantic-UI
f. Story Data
• .ulx files served from public/ or fetched remotely
Relationships & Data Flows
• Build & Deploy
• npm scripts → install submodules → tsc compile → bundle → public assets
• Startup
1. index.html loads the JavaScript bundle
2. src/index.js boots React, uses Semantic UI theme
• Story Loading
1. Template component fetches .ulx (HTTP GET)
2. FyreVMWeb instantiates the interpreter with the fetched data
• Execution Loop
• UI → user inputs a command → command passed to FyreVMWeb
• FyreVMWeb → glulx-typescript executes instructions, reads/writes memory via FyreVMMem
• Execution events emit text, hints, status updates → React components render changes
• Loop continues until story end
Architectural Patterns & Principles
• Layered Architecture
• Presentation (React components & templates)
• Application façade (FyreVMWeb manager)
• Engine & runtime (glulx-typescript + memory manager)
• Data source (compiled story file)
• Separation of Concerns
• UI logic vs. VM orchestration vs. low-level execution
• Extensibility Points
• New React components (src/components)
• Create new story templates (src/templates/…)
• Plug in custom Inform extensions (extensions/*)