Web Runtime
Web Runtime 0.1.0
Release notes for Web Runtime 0.1.0.
4 changes — 4 features
Minor Changes
-
#58
798acd0Thanks @dm-balakin! - The Web host implementssoundor:ui,soundor:storageandsoundor:fs, so plugin UIs written with@soundor/reactrun in the browser unchanged.soundor:uidraws with DOM elements in the host's plugin viewport; there is no ReactDOM. A stylesheet gives the DOM Yoga's defaults (flex columns that do not shrink, border-box sizes, no inherited text style), and styles are validated with the JUCE runtime's messages.- All five node types, the tree rules,
layoutandgetBoundingClientRect()(in view coordinates, whatever the viewport's scale), focus and selection, scrolling,pressable, the clipboard (with an in-page fallback),focusedNode()andviewSize(). - Events capture and bubble along the Soundor tree, with UiNode targets. Input follows the JUCE runtime's rules: implicit pointer capture, hover enter and leave along the tree, a click to the deepest node holding both press and release, focus on press, Tab cycling, and the wheel scrolling the nearest scroll view. Text inputs edit natively and report
beforeinput,inputandchange. All fourpointerEventsmodes are honored. soundor:storageandsoundor:fskeep their data in IndexedDB, one database perplugin.id, so plugins on one site never share data.soundor:fsis a private file tree: relative paths only, and the JUCE runtime's errors. Each write is atomic.- A failed Vite build now reports Vite's error instead of only the phase that failed.
-
#62
ffd78aeThanks @dm-balakin! - The Web runtime is documented and proven on the example plugin.examples/basicruns in the browser next to JUCE: the same config and the samesrc/main.tsx, with aGainNodeinruntimes/web/src/audio.tswhere JUCE applies the gain in C++. Its static build works below any path and in iframes, each with its own host, transport, audio and plugin view.- An integration test renders
@soundor/react(View, Text, Pressable, TextInput, Image, ScrollView, reconciliation) on the DOMsoundor:ui. - A dev server that cannot start reports Vite's error. A plugin without native methods is scaffolded
native = {}. - The README covers the lifecycle, ownership, the Vite architecture,
soundor:*in the browser, the native API, Web Audio, the host UI, static and iframe use, limitations, and the post-MVP DSP direction.
-
#56
158c765Thanks @dm-balakin! - New@soundor/web-runtime: runs a Soundor plugin in the browser, with Vite as its host and build system.webRuntime()implements the five lifecycle phases.initscaffolds a user-owned Web host underruntimes/web/and never overwrites a file; it adds nopackage.jsonor lockfile there.genemits a deterministic manifest (plugin identity and parameters).devserves the host with Vite until stopped.buildwrites a static site with relative URLs to.soundor/dist/web.doctorchecks Node.js, Vite and the scaffold.@soundor/web-runtime/viteexportsdefineWebConfig()for the host'svite.config.ts, and@soundor/web-runtime/clientexportsstartSoundorWebHost().soundor:parameters: one parameter store per page, shared by the plugin UI, the user's Web code and the host. It follows the JUCE runtime's semantics: numbers are clamped and ints rounded, a value of the wrong type is aTypeError, listeners hear of changes only, and gestures nest.soundor:host: the host is "Soundor Web", with its audio format and a transport (play, pause, stop, tempo, time signature, a four-bar loop). Positions and bar starts honor the time signature's denominator, and subscribers get a snapshot every animation frame while it plays. The plugin observes the transport; only the host controls it.- The plugin UI is the bundle the CLI builds, loaded as it is: Vite never rebundles
src/main.tsx. Itssoundor:*imports resolve to the page's host modules, and its image assets are served and emitted undersoundor-assets/. Insoundor dev, a newbuild-idreloads the page (a failed build leaves it as it is), and the page's console appears in the terminal. A project without a UI gets an empty viewport.
-
#61
ddcbdaeThanks @dm-balakin! - The Web host implementssoundor:nativein TypeScript and gains Web Audio and a host UI.genemitsnative.ts, aWebNativeApiinterface generated from the config's native API (primitives, binary types, arrays, structs, enums, handles, sync and async methods). A method added to the config is a type error inruntimes/web/src/native.tsuntil it is implemented.soundor:nativecalls that implementation directly: the same values, exceptions and promises, with no serialization. Handles are opaque objects made with each handle type'swrap(), and they cannot be forged.initalso scaffoldssrc/native.tsandsrc/audio.ts.startSoundorWebHost({ native, audio })loads them after the host exists.- The host owns one
AudioContext, created from the user's first Play as browsers require. Its graph is source → input → the project'ssetupAudio({ context, input, output })→ output → master volume. A missing or failing setup passes the input through. Sources are an oscillator, an audio file or none, and they play while the transport does. The transport follows the audio clock and reports the context's sample rate. - The host UI: play/pause, stop, loop, tempo, time signature, position, source, volume and mute, and the sample rate in the status bar. A plugin view too big for the page is scaled to fit, which helps in iframes.
soundor devadds an inspector of the host state and the parameters; builds show the clean demo.