onda-engine 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -39
- package/dist/cinema.js +1 -1
- package/dist/cinema.js.map +1 -1
- package/dist/components.d.ts +12 -1
- package/dist/components.js +24 -1
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react.d.ts +3 -1
- package/dist/react.js +101 -17
- package/dist/react.js.map +1 -1
- package/dist/wasm/pkg/onda_wasm.d.ts +195 -0
- package/dist/wasm/pkg/onda_wasm_bg.wasm.d.ts +34 -0
- package/dist/wasm-audio/pkg/onda_wasm_audio.d.ts +106 -0
- package/dist/wasm-audio/pkg/onda_wasm_audio_bg.wasm.d.ts +20 -0
- package/dist/wasm-vello/index.d.ts +1 -0
- package/dist/wasm-vello/pkg/onda_wasm_vello.d.ts +96 -0
- package/dist/wasm-vello/pkg/onda_wasm_vello_bg.wasm.d.ts +24 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="https://raw.githubusercontent.com/onda-engine/onda-engine/main/assets/brand/readme-hero.svg" alt="ONDA Engine — motion graphics at GPU speed, no browser" width="100%" />
|
|
4
|
+
|
|
5
|
+
<br/>
|
|
6
|
+
|
|
7
|
+
### Motion graphics at GPU speed. No browser. No Chromium.
|
|
8
|
+
|
|
9
|
+
**Author video in React → compile it to a scene graph → render it natively on the GPU.**
|
|
10
|
+
One `npm install` for the entire engine.
|
|
4
11
|
|
|
5
12
|
[](https://www.npmjs.com/package/onda-engine)
|
|
6
|
-
[](#license--read-this-first)
|
|
14
|
+
[](#whats-in-the-box)
|
|
15
|
+
[](#why-onda)
|
|
16
|
+
|
|
17
|
+
[Why ONDA](#why-onda) · [Install](#install) · [What's in the box](#whats-in-the-box) · [Onda Studio](#onda-studio) · [License](#license--read-this-first) · [onda.video](https://onda.video)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
7
22
|
|
|
8
|
-
ONDA turns a
|
|
23
|
+
**ONDA turns a React composition into a renderer-agnostic _scene graph_, then rasterizes it with a native GPU renderer ([Vello](https://github.com/linebender/vello))** — or a deterministic CPU reference renderer, or a WebAssembly path for live in-browser preview. No DOM. No headless browser. No screenshot round-trip. Just a scene graph, straight to the GPU.
|
|
9
24
|
|
|
10
|
-
|
|
25
|
+
`onda-engine` is the **all-in-one** package — the React renderer, the motion-language component library, the interactive player, the headless renderer, and the WASM cores — bundled into a single install, one version.
|
|
11
26
|
|
|
12
|
-
> **Pre-1.0.** The Rust + WASM core powers a production studio, but the public API isn't frozen — expect breaking changes before 1.0
|
|
27
|
+
> **Pre-1.0.** The Rust + WASM core already powers a production studio, but the public API isn't frozen — expect breaking changes before `1.0`.
|
|
28
|
+
|
|
29
|
+
## Why ONDA
|
|
30
|
+
|
|
31
|
+
Programmatic video today (e.g. Remotion) renders by driving a **headless browser**: correct, but heavy — a Chromium process per render, slow cold starts, high memory, painful to scale. ONDA keeps the **React authoring model** you already know, but compiles it to a scene graph and renders it **natively**. There is no browser anywhere in the pipeline.
|
|
32
|
+
|
|
33
|
+
> **It's faster because it does less.** Measured on an Apple M4 Pro (1080p, Remotion's best case): **~4.5× faster per thread** and **~9.3× higher machine throughput** than Remotion — and the gap *widens* with scene complexity, GPU acceleration, and cold-start / memory pressure.
|
|
34
|
+
|
|
35
|
+
The scene graph is the universal language; the renderer is the platform. **One composition** drives them all — live browser preview (WebGPU / WASM), native GPU export, or a deterministic CPU reference render.
|
|
13
36
|
|
|
14
37
|
## Install
|
|
15
38
|
|
|
@@ -17,23 +40,19 @@ This is the **all-in-one** package: the React renderer, the motion-language comp
|
|
|
17
40
|
npm install onda-engine react
|
|
18
41
|
```
|
|
19
42
|
|
|
20
|
-
`react` (v19) is a peer dependency
|
|
21
|
-
|
|
22
|
-
> The engine is developed as granular [`@onda-engine/*`](https://github.com/onda-engine/onda-engine) workspace packages; `onda-engine` bundles them into a single public install (one package, one version) — this is the package you install.
|
|
43
|
+
`react` (v19) is a peer dependency you provide. Everything else — including the ~11 MB of WASM cores — ships in the box. No runtime downloads, no extra registry to configure, no Rust toolchain on your machine.
|
|
23
44
|
|
|
24
|
-
## What's
|
|
45
|
+
## What's in the box
|
|
25
46
|
|
|
26
47
|
| Import | What it is |
|
|
27
48
|
| --- | --- |
|
|
28
49
|
| `onda-engine` | The Onda **motion language** — choreography + component library (the main authoring surface) |
|
|
29
50
|
| `onda-engine/react` | The React → scene-graph renderer (`renderToScene`, primitives, hooks) |
|
|
30
|
-
| `onda-engine/player` | Interactive `<Player>` — real-time canvas/WebGPU preview |
|
|
31
|
-
| `onda-engine/render` | **Node-only** headless render to video/still (no Chromium) |
|
|
51
|
+
| `onda-engine/player` | Interactive `<Player>` — real-time canvas / WebGPU preview |
|
|
52
|
+
| `onda-engine/render` | **Node-only** headless render to video / still (no Chromium) |
|
|
32
53
|
| `onda-engine/cinema` | Render a timeline composition payload to an engine element |
|
|
33
54
|
| `onda-engine/components/manifest` | Per-component prop manifest (semantic roles) |
|
|
34
|
-
| `onda-engine/wasm` | The renderer
|
|
35
|
-
| `onda-engine/wasm-audio` | Audio decode + FFT (audio-reactive visuals) |
|
|
36
|
-
| `onda-engine/wasm-vello` | The Vello GPU renderer over WebGPU |
|
|
55
|
+
| `onda-engine/wasm` · `/wasm-audio` · `/wasm-vello` | The renderer, audio FFT, and Vello GPU cores, compiled to WebAssembly |
|
|
37
56
|
|
|
38
57
|
## Usage
|
|
39
58
|
|
|
@@ -41,44 +60,46 @@ npm install onda-engine react
|
|
|
41
60
|
import { TitleCard } from 'onda-engine'
|
|
42
61
|
import { renderToScene } from 'onda-engine/react'
|
|
43
62
|
|
|
44
|
-
const scene = renderToScene(<TitleCard title="Hello" />)
|
|
63
|
+
const scene = renderToScene(<TitleCard title="Hello, motion" />)
|
|
45
64
|
```
|
|
46
65
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Under a bundler that supports the `new URL(..., import.meta.url)` asset convention (Vite, modern webpack), the WASM **loads itself** — each `.wasm` ships next to its glue and is fetched automatically. Nothing to wire up:
|
|
66
|
+
**The WASM loads itself.** Under a bundler that supports the `new URL(..., import.meta.url)` asset convention (Vite, modern webpack), each `.wasm` ships next to its glue and is fetched automatically — nothing to wire up:
|
|
50
67
|
|
|
51
68
|
```ts
|
|
52
69
|
import { preloadTextMetrics, measureText } from 'onda-engine'
|
|
53
70
|
|
|
54
|
-
await preloadTextMetrics()
|
|
55
|
-
measureText('Hello', 48)
|
|
71
|
+
await preloadTextMetrics() // locates + instantiates the wasm core
|
|
72
|
+
measureText('Hello', 48) // real shaped glyph metrics
|
|
56
73
|
```
|
|
57
74
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
import wasmUrl from 'onda-engine/wasm/pkg/onda_wasm_bg.wasm?url'
|
|
62
|
-
import init, { OndaEngine } from 'onda-engine/wasm'
|
|
75
|
+
> **`onda-engine/render` is Node-only** — it uses `fs`, `child_process`, and ffmpeg. Don't import it into browser code; use it from a server or CLI.
|
|
63
76
|
|
|
64
|
-
|
|
65
|
-
const engine = new OndaEngine()
|
|
66
|
-
```
|
|
77
|
+
## Onda Studio
|
|
67
78
|
|
|
68
|
-
|
|
79
|
+
ONDA is the **engine**; **[Onda Studio](https://studio.onda.video)** is the **director**.
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```ts
|
|
73
|
-
import { renderToFile } from 'onda-engine/render'
|
|
74
|
-
```
|
|
81
|
+
Studio is an AI motion-graphics studio — *"Lovable for video."* Describe a scene in plain language and an agent composes, renders, and ships it — frame-accurate, on this exact engine. The engine stands on its own as a programmatic-video toolkit; Studio is what it makes possible.
|
|
75
82
|
|
|
76
83
|
## Requirements
|
|
77
84
|
|
|
78
85
|
- **React 19** (peer dependency)
|
|
79
|
-
- A bundler that handles `.wasm` assets for browser use (Vite recommended), or Node ≥ 20 for server-side
|
|
80
|
-
- WebGPU for the GPU (`wasm-vello`) path; the CPU
|
|
86
|
+
- A bundler that handles `.wasm` assets for browser use (**Vite** recommended), or **Node ≥ 20** for server-side rendering
|
|
87
|
+
- **WebGPU** for the GPU (`wasm-vello`) path; the CPU core (`wasm`) is the always-available fallback
|
|
88
|
+
|
|
89
|
+
## License — read this first
|
|
90
|
+
|
|
91
|
+
**Source-available — _not_ open source.** `onda-engine` is licensed under the **[Functional Source License](https://raw.githubusercontent.com/onda-engine/onda-engine/main/LICENSE)** (`FSL-1.1-Apache-2.0`):
|
|
92
|
+
|
|
93
|
+
- ✅ **You may** read, run, self-host, modify, and build **non-competing** products with it — freely, no fee.
|
|
94
|
+
- 🚫 **You may not** use it to make a product that **competes** with ONDA.
|
|
95
|
+
- ⏳ **It turns into Apache-2.0:** each release automatically converts to full [Apache-2.0](https://raw.githubusercontent.com/onda-engine/onda-engine/main/LICENSE-APACHE) **two years** after it ships.
|
|
96
|
+
|
|
97
|
+
If you need terms beyond the FSL grant, get in touch via [onda.video](https://onda.video).
|
|
81
98
|
|
|
82
|
-
|
|
99
|
+
---
|
|
83
100
|
|
|
84
|
-
|
|
101
|
+
<div align="center">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/onda-engine/onda-engine/main/assets/brand/onda-mark.svg" alt="ONDA" width="34" />
|
|
103
|
+
<br/><br/>
|
|
104
|
+
<sub><b>ONDA</b> · Motion graphics at GPU speed · <a href="https://onda.video">onda.video</a></sub>
|
|
105
|
+
</div>
|
package/dist/cinema.js
CHANGED
|
@@ -1184,7 +1184,7 @@ function SceneTracks({
|
|
|
1184
1184
|
const key = entry.id ?? `entry-${ei}`;
|
|
1185
1185
|
const slot = createElement(EntrySlot, { entry, registry, suppress: suppress?.get(entry) });
|
|
1186
1186
|
if (!responsive) return cloneElement(slot, { key });
|
|
1187
|
-
const t = Components.responsiveEntryTransform(
|
|
1187
|
+
const t = Components.isFullBleed(entry.props, responsive.design) ? Components.responsiveCoverTransform(responsive.design, responsive.out) : Components.responsiveEntryTransform(
|
|
1188
1188
|
Components.entryDesignAnchor(entry.props),
|
|
1189
1189
|
responsive.design,
|
|
1190
1190
|
responsive.out
|