@goxjs/goxjs 0.9.0 → 0.11.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 CHANGED
@@ -85,6 +85,7 @@ GUI examples (40+ runnable demos live in the repo's `testdata/` directory):
85
85
  goxjs testdata/view_demo2.js # list reuse / conditional keep-alive / multi-branch
86
86
  goxjs testdata/model_demo.js # two-way binding across all eight control types
87
87
  goxjs testdata/router_demo.js # route table / param matching / three-level guards / lazy loading
88
+ goxjs testdata/media_demo.js # media: GIF video / MJPEG / WAV audio, really playing
88
89
  ```
89
90
 
90
91
  ## Router & Screens (`gx/router` / `gx/screen`)
@@ -183,6 +184,51 @@ try {
183
184
  Demo: `goxjs testdata/native_demo.js`. Semantics and export tables:
184
185
  [`docs/gui-guide.md` §9.6](https://github.com/14752222/Gox/blob/main/docs/gui-guide.md#96-原生能力层).
185
186
 
187
+ ## Media (`<video>` / `<audio>`)
188
+
189
+ **New in 0.11.0**: the two media tags finally *play* on Linux — until now the core only defined a host
190
+ contract and every desktop backend downgraded to a poster / placeholder.
191
+
192
+ ```jsx
193
+ <video src="testdata/media_demo.gif" fit="contain" loop playing width={320} height={180}
194
+ onTimeUpdate={(e) => setPos(e.currentTime)} />
195
+ <audio src="testdata/media_demo.wav" playing loop volume={0.8}
196
+ onEnded={() => console.log("done")} />
197
+ ```
198
+
199
+ - **Contract first, never a fake play**: the core only knows the `nativeVideoHost` / `nativeAudioHost`
200
+ interfaces. A backend without that capability draws a poster (or a placeholder bar for audio) and
201
+ **reports honestly** — one stderr warning, one `onError({code:"unsupported"})`, and
202
+ `canIUse("video" / "audio")` answering `false`. It never pretends to be playing.
203
+ - **`gfx/softmedia` (default on Linux)** is the reference implementation of both interfaces, covering
204
+ exactly what the Go standard library can decode: video **GIF** (disposal 0/1/2/3 compositing) and
205
+ **MJPEG**; audio **WAV** (PCM 8/16/24/32-bit + IEEE float) out through PulseAudio (`purego` dlopen,
206
+ zero cgo). No libpulse / no server / no device ⇒ **null sink**: silent, but the playback clock and
207
+ every event stay real.
208
+ - **Out of scope on purpose**: h264 / hevc / vp9 / av1 and mp3 / aac / ogg are not decoded. Those belong
209
+ to a platform media layer (Windows MF / macOS AVPlayerLayer / Linux GStreamer) — it just has to
210
+ implement the same two interfaces.
211
+ - `playing` / `muted` / `loop` / `volume` / `fit` are **controlled** props; whatever the host reports
212
+ comes back as `onReady` / `onPlay` / `onPause` / `onEnded` / `onTimeUpdate({currentTime, duration})`.
213
+
214
+ Demo: `goxjs testdata/media_demo.js` — **run it from the repo root**, asset paths resolve against the
215
+ process working directory. Manual: [`docs/gui-guide.md`](https://github.com/14752222/Gox/blob/main/docs/gui-guide.md);
216
+ scope and rationale: [`docs/media-decision.md`](https://github.com/14752222/Gox/blob/main/docs/media-decision.md).
217
+
218
+ ## 0.11.0 Release Notes
219
+
220
+ - **Media actually plays**: `<video>` / `<audio>` now ship with `gfx/softmedia`, a pure-Go software
221
+ media backend (GIF / MJPEG video, WAV + PulseAudio audio) wired into the default Linux build.
222
+ `<audio>` is a new tag; `<video>` gained `fit`. Everywhere else the honest-downgrade path is unchanged.
223
+ - **`gx/datav`**: dashboard / data-visualisation component library, with a 29-script screenshot gallery.
224
+ - **GPU presentation backend prototype** (`-tags gpu`): presentation wrappers now stack as a chain in
225
+ front of the software rasteriser. Experimental — the default build is untouched.
226
+ - **Language**: `for...in` destructuring bindings, and heads without a declaration.
227
+ - **Apps**: a foldable-screen demo app covering four scenarios.
228
+ - **Fixes & housekeeping**: `device.vibrate` no longer declares a capability it can never honour (that
229
+ made `canIUse` lie); new platform-independent host-contract test suite; test262 language compliance
230
+ 78.76% → 78.9%.
231
+
186
232
  ## 0.6.0 Release Notes
187
233
 
188
234
  - **GUI on all platforms**: the macOS window backend (cocoa, driving AppKit via purego in pure Go) has landed —
@@ -290,6 +336,7 @@ GUI 示例(仓库 `testdata/` 下有 40+ 个可直接运行的演示):
290
336
  goxjs testdata/view_demo2.js # 列表复用 / 条件保活 / 多分支
291
337
  goxjs testdata/model_demo.js # 八类受控组件的双向绑定
292
338
  goxjs testdata/router_demo.js # 路由表 / 参数匹配 / 三级守卫 / 懒加载
339
+ goxjs testdata/media_demo.js # 媒体:GIF 视频 / MJPEG / WAV 音频真播放
293
340
  ```
294
341
 
295
342
  ### 路由与屏幕(`gx/router` / `gx/screen`)
@@ -384,6 +431,46 @@ try {
384
431
  演示:`goxjs testdata/native_demo.js`。语义与导出表见
385
432
  [`docs/gui-guide.md` §9.6](https://github.com/14752222/Gox/blob/main/docs/gui-guide.md#96-原生能力层)。
386
433
 
434
+ ### 媒体组件(`<video>` / `<audio>`)
435
+
436
+ **0.11.0 起在 Linux 上真的能播** —— 此前内核只有宿主契约,桌面三后端一律降级成封面 / 占位条。
437
+
438
+ ```jsx
439
+ <video src="testdata/media_demo.gif" fit="contain" loop playing width={320} height={180}
440
+ onTimeUpdate={(e) => setPos(e.currentTime)} />
441
+ <audio src="testdata/media_demo.wav" playing loop volume={0.8}
442
+ onEnded={() => console.log("done")} />
443
+ ```
444
+
445
+ - **先有契约,绝不假装在播**:内核只认 `nativeVideoHost` / `nativeAudioHost` 两个接口。后端没有这块
446
+ 能力就画封面(音频是一条占位条)并**诚实报错** —— stderr 告警一次、派发一次 `onError({code:"unsupported"})`、
447
+ `canIUse("video" / "audio")` 照实回答 `false`。
448
+ - **`gfx/softmedia`(Linux 默认挂上)**是这两个接口的参考实现,只覆盖标准库够得着的格式:视频
449
+ **GIF**(disposal 0/1/2/3 合成)与 **MJPEG**;音频 **WAV**(PCM 8/16/24/32 位 + IEEE float)经
450
+ PulseAudio 输出(`purego` dlopen,零 cgo)。没有 libpulse / 没有服务 / 没有设备 ⇒ **null sink**:
451
+ 不放声,但播放时钟与事件全部照真。
452
+ - **刻意的边界**:h264 / hevc / vp9 / av1 与 mp3 / aac / ogg 一概不解 —— 那些属于平台媒体层
453
+ (Windows MF / macOS AVPlayerLayer / Linux GStreamer),它只要实现同样两个接口即可接入。
454
+ - `playing` / `muted` / `loop` / `volume` / `fit` 都是**受控**属性;宿主上报的状态经 `onReady` /
455
+ `onPlay` / `onPause` / `onEnded` / `onTimeUpdate({currentTime, duration})` 回到脚本。
456
+
457
+ 演示:`goxjs testdata/media_demo.js` —— **必须从仓库根运行**,素材路径按进程工作目录解析。手册见
458
+ [`docs/gui-guide.md`](https://github.com/14752222/Gox/blob/main/docs/gui-guide.md);边界与理由见
459
+ [`docs/media-decision.md`](https://github.com/14752222/Gox/blob/main/docs/media-decision.md)。
460
+
461
+ ### 0.11.0 更新
462
+
463
+ - **媒体真的能播了**:`<video>` / `<audio>` 配上 `gfx/softmedia` 软件媒体后端(GIF / MJPEG 视频,
464
+ WAV + PulseAudio 音频),已接进 Linux 默认构建。`<audio>` 是新标签,`<video>` 新增 `fit`;其余平台
465
+ 的诚实降级路径不变。
466
+ - **`gx/datav`**:大屏 / 数据可视化组件库,附带 29 个单组件画廊截图脚本。
467
+ - **GPU 呈现后端原型**(`-tags gpu`):呈现包装器改为**链式叠加**,可挂在软件光栅化之前。实验轨,
468
+ 默认构建不受影响。
469
+ - **语言**:`for...in` 解构绑定,以及无声明的 `for...in` 头部。
470
+ - **应用**:折叠屏四场景演示应用。
471
+ - **修复与收尾**:`device.vibrate` 撤下了"声明了却恒 unsupported"的能力声明(那让 `canIUse` 说谎);
472
+ 新增平台无关的宿主契约测试套件;test262 language 合规率 78.76% → 78.9%。
473
+
387
474
  ### 0.6.0 更新
388
475
 
389
476
  - **GUI 全平台**:macOS 窗口后端(cocoa,purego 纯 Go 驱动 AppKit)落地 —— 桌面 GUI 现在 Windows / macOS / Linux 三平台可用,npm 预编译二进制开箱即含。
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goxjs/goxjs",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Gox — 用 Go 从零实现的 JavaScript 运行时(lexer → parser → 字节码 VM),单二进制零外部依赖",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {