mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:44:18 -08:00
fix(PKG-VAST-07): restore historical default factory calls
This commit is contained in:
1 parent
eb6402fdca
commit
fe5534ac24
20 files changed
+3706
-52
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,57 @@
|
||||
# PKG-VAST-07: retain historical default calls
|
||||
|
||||
Baseline: eb6402fdca910fd39d329d0c26222c4359915150. Independent of the
|
||||
unresolved eager/lazy initialization decision; task04 depends on this delivery.
|
||||
|
||||
## Implementation and contract
|
||||
|
||||
The frozen npm1.0.0 CommonJS main/legacy exports a namespace with a default
|
||||
factory; the current workspace main exports a direct function without that
|
||||
property. Consequently existing JavaScript `require('artplayer-plugin-vast').default(cb)`
|
||||
fails before registration. The final four-format regression also fails against
|
||||
the exact pre-change main and ESM files retrieved from Git.
|
||||
|
||||
The entry now assigns `artplayerPluginVast.default = artplayerPluginVast` before
|
||||
default export, as in other ecosystem compatibility factories. Direct and default
|
||||
calls reach the same function, preserve closure state and create no wrapper or
|
||||
SDK load at module evaluation. TypeScript infers the self-reference without casts.
|
||||
The property is writable/enumerable/configurable. Current exports remain callable;
|
||||
this is supported historical call compatibility, not recreation of the old
|
||||
namespace object's `typeof`, keys or identity. Existing namespace-derived reflection
|
||||
and public declaration reconciliation remain under VAST-DIST-01 and task04/06.
|
||||
|
||||
API-04/05/06/09: original SDK/callback waits, request behavior, Promise result and
|
||||
cleanup remain unchanged. Initialization defaults, IDs, callback aliases and SDK
|
||||
settings are not reconciled by this change; VAST-CONTEXT-01 and task03 remain open.
|
||||
Public declarations, dependency versions, lockfile and package version are unchanged.
|
||||
The export suite joins existing test:vast/test:unit; no new tool is installed.
|
||||
|
||||
## Validation
|
||||
|
||||
See [evidence and fingerprints](../baselines/vast-alias-validation.json).
|
||||
|
||||
- Initial SDK-controlled alias plus three UMD-format tests: all four fail on the
|
||||
old source. An initial AMD harness signature error was corrected before this
|
||||
red result; final errors are missing alias assertions.
|
||||
- Final bundled CommonJS/global/AMD/ESM tests: four fail on pre-change artifacts,
|
||||
four pass on actual main+ESM and four on actual legacy+ESM.
|
||||
- Full VAST suite:65 pass, including historical observations and current lifecycle
|
||||
assertions. Source alias test covers deferred SDK, deferred callback, request and
|
||||
cleanup; artifact tests use a destroyed host and do not load Google IMA.
|
||||
- Strict package TypeScript and targeted source/Node/browser lint pass. A test
|
||||
import ordering error was corrected. Normal package build regenerates three
|
||||
formats and docs copies.
|
||||
- Three desktop engines across old5.1.7, published5.4.1 and candidate core:117
|
||||
wrapper browser assertions pass, zero retries/skips. Nine candidate registration
|
||||
cases use the alias and wait for SDK and callback; other cases keep direct calls.
|
||||
SDK is controlled, while core DOM/main-video decoding is real. Historical bug
|
||||
observations remain explicitly historical, not successful compatibility claims.
|
||||
- Actual Google IMA ad loading/playback, device coverage, full declarations and
|
||||
installed distribution remain unverified. No VPN exception or remote CI claim.
|
||||
|
||||
## Rollback and remaining work
|
||||
|
||||
Revert this dedicated commit and rebuild VAST to restore the previous exports;
|
||||
the alias tests then reproduce the broken old call. Continue the initialization
|
||||
decision in vast-compatibility-decision.md, then complete task03/04 and real SDK
|
||||
and package acceptance. This task is not overall VAST completion.
|
||||
+6
-4
@@ -2,9 +2,9 @@
|
||||
|
||||
> 由 tasks.json 生成。请修改数据后运行 `node refactor/scripts/plan.mjs --write`,不要手改本表。
|
||||
|
||||
基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 252 项,范围 22 个包及工作区/示例。
|
||||
基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 253 项,范围 22 个包及工作区/示例。
|
||||
|
||||
状态:todo 55 / doing 17 / blocked 0 / done 180 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
状态:todo 55 / doing 17 / blocked 0 / done 181 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
|
||||
前置依赖是启动条件;验收是完成条件。任务可以继续拆分,但不能复用或悄悄删除旧 ID。
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
| artplayer-plugin-hls-control | 1.1.0 | PKG-HLS-01, PKG-HLS-02, PKG-HLS-03, PKG-HLS-04, PKG-HLS-SDK-01, PKG-HLS-05, PKG-HLS-06 |
|
||||
| artplayer-plugin-jassub | 1.1.0 | PKG-JASSUB-01, PKG-JASSUB-02, PKG-JASSUB-03, PKG-JASSUB-04, PKG-JASSUB-05, PKG-JASSUB-06, PKG-JASSUB-07, PKG-JASSUB-08, PKG-JASSUB-09 |
|
||||
| artplayer-plugin-multiple-subtitles | 1.2.0 | PKG-MULTI-SUB-01, PKG-MULTI-SUB-02, PKG-MULTI-SUB-03, PKG-MULTI-SUB-04, PKG-MULTI-SUB-07, PKG-MULTI-SUB-08, PKG-MULTI-SUB-05, PKG-MULTI-SUB-06, PKG-MULTI-SUB-09, PKG-MULTI-SUB-10, PKG-MULTI-SUB-11 |
|
||||
| artplayer-plugin-vast | 1.2.0 | PKG-VAST-01, PKG-VAST-02, PKG-VAST-03, PKG-VAST-04, PKG-VAST-05, PKG-VAST-06 |
|
||||
| artplayer-plugin-vast | 1.2.0 | PKG-VAST-01, PKG-VAST-02, PKG-VAST-03, PKG-VAST-04, PKG-VAST-05, PKG-VAST-06, PKG-VAST-07 |
|
||||
| artplayer-plugin-vtt-thumbnail | 1.1.0 | PKG-VTT-THUMB-01, PKG-VTT-THUMB-02, PKG-VTT-THUMB-03, PKG-VTT-THUMB-04, PKG-VTT-THUMB-05, PKG-VTT-THUMB-06 |
|
||||
| artplayer-proxy-canvas | 1.1.0 | PKG-AMBILIGHT-PROXY-01, PKG-CANVAS-01, PKG-CANVAS-02, PKG-CANVAS-03, PKG-CANVAS-04, PKG-CANVAS-05, PKG-CANVAS-06, PKG-FACTORY-01 |
|
||||
| artplayer-proxy-mediabunny | 1.2.0 | PKG-MB-01, PKG-MB-02, PKG-MB-03, PKG-MB-04, PKG-MB-05, PKG-MB-06, PKG-MB-07, PKG-MB-08, PKG-MB-09, PKG-MB-10 |
|
||||
@@ -292,9 +292,10 @@
|
||||
| PKG-VAST-01 | artplayer-plugin-vast<br>核对包契约与历史用法 | BASE-05 | 异步工厂、callback context、playUrl/playRes/init 与 SDK 版本;实际 npm 1.0.0 与未发布 1.2.0、SDK 1.21.0/1.21.2 的60成员归档和发布关联核心5.1.7 | 源码/声明/README/demo/发布包差异已登记;公开形状和版本范围冻结 | H | done |
|
||||
| PKG-VAST-02 | artplayer-plugin-vast<br>建立特有行为与错误测试 | PKG-VAST-01, ENG-03, ENG-05 | SDK 失败、重复初始化、广告事件、内容恢复和销毁竞态;发布 id/$container/eager 与工作区 lazy/config 覆盖、callback拒绝、加载中销毁、同毫秒多实例与晚到事件 | 旧版本行为可重跑,成功/失败/切源/销毁有必要断言 | H | done |
|
||||
| PKG-VAST-03 | artplayer-plugin-vast<br>整理内部职责与资源 | PKG-VAST-02, CORE-10, CORE-13 | SDK loader、IMA adapter、广告状态和 DOM 清理分离;保持发布 callback 别名,明确初始化冲突;核心终止与显式 destroy 后重建区分 | 结构变化和缺陷修复分开记录;原 API/事件/资源生命周期通过 | H | doing |
|
||||
| PKG-VAST-04 | artplayer-plugin-vast<br>迁移自有源码和公开类型 | PKG-VAST-03, ENG-04, ENG-06, CORE-07 | IMA/context/Promise 真实类型,外部 SDK 动态对象限定边界;修复 @alugha/ima 声明依赖链,保留 export= 和 require.default 消费;同步错误声明的兼容决策单列 | 严格类型检查、旧消费样例通过;声明路径/导出和同步异步兼容 | H | todo |
|
||||
| PKG-VAST-04 | artplayer-plugin-vast<br>迁移自有源码和公开类型 | PKG-VAST-03, ENG-04, ENG-06, CORE-07, PKG-VAST-07 | IMA/context/Promise 真实类型,外部 SDK 动态对象限定边界;修复 @alugha/ima 声明依赖链,保留 export= 和 require.default 消费;同步错误声明的兼容决策单列 | 严格类型检查、旧消费样例通过;声明路径/导出和同步异步兼容 | H | todo |
|
||||
| PKG-VAST-05 | artplayer-plugin-vast<br>验证新旧核心和组合 | PKG-VAST-04, CORE-22 | 官方测试广告或受控 SDK 环境,错误后主视频状态恢复;核验真实5.1.7/5.4.1/候选核心,VAST VPN外部脚本例外逐项记录,不将受控SDK当作实际IMA验收 | 最终核心与原支持范围核心分别通过;设备/SDK 缺证据不能标完成 | H | todo |
|
||||
| PKG-VAST-06 | artplayer-plugin-vast<br>验证分发并同步文档 | PKG-VAST-05, ENG-07 | vast.js、SDK 资源、声明消费和独立版本记录;核验实际发布 namespace default、历史深路径、ESM和准确声明,版本按政策2.0.0由REL-09统一处理 | tarball 入口/资源、类型、8082 demo 和 README 一致,有回退记录 | H | todo |
|
||||
| PKG-VAST-07 | artplayer-plugin-vast<br>恢复旧发布VAST工厂default调用入口 | PKG-VAST-01, PKG-VAST-02 | 保留当前直接工厂并增加default自身别名,验证四类分发调用及异步注册,初始化决策独立保留 | 旧产物default用例失败,新源码/实际main/legacy/ESM通过;真实核心三浏览器控制SDK注册验证、模块文档/构建/测试入口同步;不冒充namespace反射、声明和IMA验收 | M | done |
|
||||
|
||||
## 5 包迁移:artplayer-plugin-chromecast
|
||||
|
||||
@@ -655,3 +656,4 @@
|
||||
- PKG-MULTI-SUB-10: [记录](changes/2026-09-14-PKG-MULTI-SUB-10-legacy-captions.md) [记录](baselines/multiple-subtitles-legacy-validation.json)
|
||||
- PKG-MULTI-SUB-11: [记录](changes/2026-09-14-PKG-MULTI-SUB-11-ass-conversion.md) [记录](baselines/multiple-subtitles-ass-validation.json)
|
||||
- PKG-AUTO-THUMB-11: [记录](changes/2026-09-14-PKG-AUTO-THUMB-11-handler-cleanup.md) [记录](baselines/auto-thumbnail-handler-validation.json)
|
||||
- PKG-VAST-07: [记录](changes/2026-09-14-PKG-VAST-07-default-alias.md) [记录](baselines/vast-alias-validation.json)
|
||||
@@ -1,5 +1,16 @@
|
||||
# 进度与证据
|
||||
|
||||
## PKG-VAST-07 旧default调用兼容完成
|
||||
|
||||
VAST入口增加default自身别名,恢复旧require(...).default调用并保留现有直接调用。
|
||||
四格式测试在旧产物全部失败,实际main+ESM、legacy+ESM各4项通过;完整VAST65项、
|
||||
三浏览器117项、CI脚本30项通过。浏览器SDK为受控替身,主视频和DOM为真实核心;
|
||||
旧缺陷观察仍单列。严格TS和定向lint通过,三格式及docs产物已重建,未修改公开声明。
|
||||
见[变更](changes/2026-09-14-PKG-VAST-07-default-alias.md)和[证据](baselines/vast-alias-validation.json)。253项:181 done、17 doing、55 todo。
|
||||
VAST已拆成5个TS模块,但03/04仍未完成;初始化冲突已向用户提出具体选择,等待回复。
|
||||
原namespace反射、准确声明、真实IMA和最终分发仍未验收。下一步收到选择后继续VAST
|
||||
初始化兼容;等待期间转向HLS SDK或其他不依赖该决定的剩余包任务。
|
||||
|
||||
## PKG-AUTO-THUMB-11 抽帧清理异常修复完成
|
||||
|
||||
事件属性清除现在与定时器、原生帧回调取消分别执行,单个异常不截断剩余清理。
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
| VAST-CONTEXT-01 | open / 已复现 | Published VAST callback aliases and eager Player differ from the unpublished lazy workspace | PKG-VAST-02, PKG-VAST-03, PKG-VAST-04 |
|
||||
| VAST-TYPE-01 | open / 已复现 | VAST declares an async factory as synchronous and imports an unavailable SDK type dependency | PKG-VAST-04, PKG-VAST-06 |
|
||||
| VAST-LIFE-01 | open / 已复现 | VAST SDK and container lack core destruction ownership and pending work cancellation | PKG-VAST-02, PKG-VAST-03, PKG-VAST-05 |
|
||||
| VAST-DIST-01 | open / 已复现 | Published VAST CommonJS default namespace differs from the current callable distribution | PKG-VAST-04, PKG-VAST-06 |
|
||||
| VAST-DIST-01 | open / 已复现 | Published VAST CommonJS default namespace differs from the current callable distribution | PKG-VAST-04, PKG-VAST-06, PKG-VAST-07 |
|
||||
| AMBILIGHT-LIFE-01 | open / 已复现 | Ambilight sampling and RAF/DOM ownership lack terminal/error handling | PKG-AMBILIGHT-02, PKG-AMBILIGHT-03, PKG-AMBILIGHT-05 |
|
||||
| AMBILIGHT-TYPE-01 | resolved / 已复现 | Ambilight declarations disagree with optional factory argument and differ across published generations | PKG-AMBILIGHT-04, PKG-AMBILIGHT-06 |
|
||||
| AMBILIGHT-DIST-01 | resolved / 已复现 | Ambilight 1.0.0 CommonJS default namespace differs from callable 1.1.0 | PKG-AMBILIGHT-04, PKG-AMBILIGHT-06 |
|
||||
|
||||
+8
-3
@@ -3301,16 +3301,21 @@
|
||||
"status": "open",
|
||||
"owners": [
|
||||
"PKG-VAST-04",
|
||||
"PKG-VAST-06"
|
||||
"PKG-VAST-06",
|
||||
"PKG-VAST-07"
|
||||
],
|
||||
"evidence": [
|
||||
"refactor/baselines/vast-contract.md",
|
||||
"refactor/baselines/vast-release.json",
|
||||
"refactor/changes/2026-09-12-PKG-VAST-01-contract.md",
|
||||
"refactor/baselines/vast-contract-validation.json"
|
||||
"refactor/baselines/vast-contract-validation.json",
|
||||
"refactor/changes/2026-09-14-PKG-VAST-07-default-alias.md",
|
||||
"refactor/baselines/vast-alias-validation.json",
|
||||
"test/vast-exports.test.js"
|
||||
],
|
||||
"compatibleResolution": "Preserve require(pkg).default alongside callable factory, script global and current ESM/legacy paths.",
|
||||
"closureCriteria": "Real packed main/legacy/ESM, historical deep imports, export= consumers and local demo/editor all pass with immutable published comparisons."
|
||||
"closureCriteria": "Real packed main/legacy/ESM, historical deep imports, export= consumers and local demo/editor all pass with immutable published comparisons.",
|
||||
"workspaceState": "Task07 restores historical JavaScript .default calls using a callable self-alias. Final four-format tests fail on pre-change main/ESM and pass produced main+ESM and legacy+ESM.65 Node and117 controlled-SDK browser checks pass. Old namespace reflection shape, public declarations, deep paths and installed distribution remain04/06; this risk stays open."
|
||||
},
|
||||
{
|
||||
"id": "AMBILIGHT-LIFE-01",
|
||||
|
||||
+22
-1
@@ -3050,7 +3050,8 @@
|
||||
"PKG-VAST-03",
|
||||
"ENG-04",
|
||||
"ENG-06",
|
||||
"CORE-07"
|
||||
"CORE-07",
|
||||
"PKG-VAST-07"
|
||||
],
|
||||
"status": "todo",
|
||||
"risk": "H",
|
||||
@@ -5244,6 +5245,26 @@
|
||||
"changes/2026-09-14-PKG-AUTO-THUMB-11-handler-cleanup.md",
|
||||
"baselines/auto-thumbnail-handler-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "PKG-VAST-07",
|
||||
"phase": "5 包迁移:artplayer-plugin-vast",
|
||||
"title": "恢复旧发布VAST工厂default调用入口",
|
||||
"scope": [
|
||||
"artplayer-plugin-vast"
|
||||
],
|
||||
"dependsOn": [
|
||||
"PKG-VAST-01",
|
||||
"PKG-VAST-02"
|
||||
],
|
||||
"status": "done",
|
||||
"risk": "M",
|
||||
"deliverable": "保留当前直接工厂并增加default自身别名,验证四类分发调用及异步注册,初始化决策独立保留",
|
||||
"acceptance": "旧产物default用例失败,新源码/实际main/legacy/ESM通过;真实核心三浏览器控制SDK注册验证、模块文档/构建/测试入口同步;不冒充namespace反射、声明和IMA验收",
|
||||
"evidence": [
|
||||
"changes/2026-09-14-PKG-VAST-07-default-alias.md",
|
||||
"baselines/vast-alias-validation.json"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -14,6 +14,14 @@
|
||||
|
||||
## 文件与执行
|
||||
|
||||
PKG-VAST-07补回工厂`.default`自身别名,不改变初始化决策。当前`yarn test:vast`
|
||||
65项通过;实际main/legacy加ESM各4项导出通过。117项三浏览器检查通过,其中候选
|
||||
异步注册场景使用`.default`,其他场景保留直接调用。浏览器仍替换SDK边界,实际
|
||||
打包SDK只做无广告的导出/已销毁宿主验证。详见
|
||||
[变更](changes/2026-09-14-PKG-VAST-07-default-alias.md)。
|
||||
|
||||
- `test/vast-exports.test.js`:源码构建或环境变量指定的实际main/legacy/ESM导出。
|
||||
保持现有callable,不宣称复刻旧namespace对象的反射形状;新文件纳入test:vast/test:unit。
|
||||
- `test/helpers/vast-sdk.js`:可在Node和浏览器使用的SDK记录器,控制加载、构造、
|
||||
监听、请求、销毁失败和晚到事件;不实现IMA、广告请求或主片暂停恢复。
|
||||
- `test/helpers/vast.js`:只在精确的`@glomex/vast-ima-player`导入边界替换SDK。
|
||||
|
||||
Reference in new issue
Block a user