Soundor
Web Runtime

Web Runtime 0.1.0

Release notes for Web Runtime 0.1.0.

All Web Runtime releases

4 changes — 4 features

Minor Changes

  • #58 798acd0 Thanks @dm-balakin! - The Web host implements soundor:ui, soundor:storage and soundor:fs, so plugin UIs written with @soundor/react run in the browser unchanged.

    • soundor:ui draws 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, layout and getBoundingClientRect() (in view coordinates, whatever the viewport's scale), focus and selection, scrolling, pressable, the clipboard (with an in-page fallback), focusedNode() and viewSize().
    • 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, input and change. All four pointerEvents modes are honored.
    • soundor:storage and soundor:fs keep their data in IndexedDB, one database per plugin.id, so plugins on one site never share data. soundor:fs is 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 ffd78ae Thanks @dm-balakin! - The Web runtime is documented and proven on the example plugin.

    • examples/basic runs in the browser next to JUCE: the same config and the same src/main.tsx, with a GainNode in runtimes/web/src/audio.ts where 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 DOM soundor: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 158c765 Thanks @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. init scaffolds a user-owned Web host under runtimes/web/ and never overwrites a file; it adds no package.json or lockfile there. gen emits a deterministic manifest (plugin identity and parameters). dev serves the host with Vite until stopped. build writes a static site with relative URLs to .soundor/dist/web. doctor checks Node.js, Vite and the scaffold.
    • @soundor/web-runtime/vite exports defineWebConfig() for the host's vite.config.ts, and @soundor/web-runtime/client exports startSoundorWebHost().
    • 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 a TypeError, 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. Its soundor:* imports resolve to the page's host modules, and its image assets are served and emitted under soundor-assets/. In soundor dev, a new build-id reloads 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 ddcbdae Thanks @dm-balakin! - The Web host implements soundor:native in TypeScript and gains Web Audio and a host UI.

    • gen emits native.ts, a WebNativeApi interface 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 in runtimes/web/src/native.ts until it is implemented. soundor:native calls that implementation directly: the same values, exceptions and promises, with no serialization. Handles are opaque objects made with each handle type's wrap(), and they cannot be forged.
    • init also scaffolds src/native.ts and src/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's setupAudio({ 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 dev adds an inspector of the host state and the parameters; builds show the clean demo.

On this page