fix(runtime): 按参考主题硬切换为 loader/main/auto_fun 单一 DOM 生命周期
- 删除 AksrtFrontend registry/rehydrate 双路架构及 build/public.js 拼包入口,
前台唯一初始路径为 PHP 本地栈(jQuery 1.9.1 → Bootstrap 3.4.1)
→ loader_js(_win/aksrtData 唯一注入)→ tbquire(['main']) → runtime/main.min.js
- window.auto_fun = debounce(z_auto_fun, 100) 为唯一重扫入口;所有模块改为
执行一次 + off/on('auto_fun.aksrt-*') 命名空间重扫,data/class 标记幂等
- 局部更新协议统一:HTML 注入 → post_ajax.ed → auto_fun();
远程 modal → loaded.bs.modal → auto_fun();JSON 成功 → zib_ajax.success
- 灯箱恢复 Miniimgbox/imgbox 唯一 owner(imgbox-container、a[data-imgbox]、
imgbox_data),删除 AksrtLightbox/data-aksrt-lightbox 第二实现及 CSS/overlay,
_win.imgbox* 重新接上 post-display 设置
- 死代码清理:runtime 下 11 组被自有实现替代的旧模块副本、无消费 vendored 库、
顶层 grade.min.js、revenue.js、无调用方的 aksrt_get_win_runtime_config(),
以及 loader 中 16 条死 mapping
- PHP 入队改为本地栈 + loader_js,routed/widget/submit 依赖统一换绑;
用户卡片发布按钮恢复 nav_user_newposts_btn 设置门控
- 测试对齐:新增 frontend-lifecycle-contract,重写 navigation/lazyload/toast/
auth-source/comment/page-display/post-visual 等断言为目标架构契约
验证:node --test widget-system+navigation 223 通过 0 失败;
构建脚本重建 main/imgbox min 与 CSS bundles;改动 PHP php -l、JS node --check
全部通过;git diff --check 干净;credits 重入 harness 通过。
This commit is contained in:
@@ -38,19 +38,13 @@ const header = join([
|
||||
]);
|
||||
|
||||
test('the public dependency graph is the single local runtime stack', () => {
|
||||
const buildTool = read('tools/build-public-assets.mjs');
|
||||
|
||||
assert.match(scripts, /registered\['jquery'\]->deps = \['jquery-core'\]/);
|
||||
assert.match(scripts, /wp_enqueue_script\('jquery'\)/);
|
||||
assert.doesNotMatch(scripts, /wp_deregister_script\('jquery'\)/);
|
||||
assert.match(scripts, /'aksrt-runtime'/);
|
||||
assert.match(scripts, /assets\/js\/build\/public\.js/);
|
||||
assert.match(buildTool, /assets\/css\/bootstrap\.min\.css/);
|
||||
assert.match(buildTool, /assets\/fontawesome5\/css\/all\.min\.css/);
|
||||
assert.match(buildTool, /assets\/css\/main\.min\.css/);
|
||||
assert.match(buildTool, /assets\/js\/runtime\/libs\/bootstrap\.min\.js/);
|
||||
assert.match(buildTool, /assets\/js\/runtime\/loader\.js/);
|
||||
assert.match(buildTool, /assets\/js\/runtime\/main\.min\.js/);
|
||||
assert.match(scripts, /wp_deregister_script\('jquery'\)/);
|
||||
assert.match(scripts, /jquery\.min\.js'[\s\S]*?'1\.9\.1'/);
|
||||
assert.match(scripts, /bootstrap\.min\.css'[\s\S]*?'3\.4\.1'/);
|
||||
assert.match(scripts, /fontawesome5'[\s\S]*?all\.min\.css'[\s\S]*?'5\.15\.4'/);
|
||||
assert.match(scripts, /main\.min\.css/);
|
||||
assert.match(scripts, /loader\.js'[\s\S]*?\['jquery', 'bootstrap'\]/);
|
||||
assert.match(read('assets/js/runtime/loader.js'), /tbquire\(\['main'\]\)/);
|
||||
for (const file of [
|
||||
'assets/js/runtime/libs/jquery.min.js',
|
||||
'assets/js/runtime/libs/bootstrap.min.js',
|
||||
@@ -152,17 +146,16 @@ test('mobile navigation is one setting-driven left right or top drawer', () => {
|
||||
|
||||
test('guest account member VIP and publish contracts share reference header DOM', () => {
|
||||
const userboxCss = read('assets/css/frontend/header-userbox.css');
|
||||
const buildTool = read('tools/build-public-assets.mjs');
|
||||
|
||||
assert.match(header, /is_user_logged_in\(\)/);
|
||||
assert.match(header, /sub-user-box aksrt-header-userbox/);
|
||||
assert.match(header, /signin-loader|signin/);
|
||||
assert.match(header, /get_payment_vip_settings/);
|
||||
assert.match(header, /navbar-newposts/);
|
||||
assert.match(header, /nav_user_newposts_btn/);
|
||||
assert.match(header, /nav_newposts/);
|
||||
assert.match(header, /navbar-form navbar-right/);
|
||||
assert.match(header, /navbar-form navbar-right navbar-but/);
|
||||
assert.match(header, /pay-vip/);
|
||||
assert.match(buildTool, /assets\/css\/frontend\/header-userbox\.css/);
|
||||
assert.match(scripts, /\$enqueue_module\('header-userbox'\)/);
|
||||
assert.match(userboxCss, /\.aksrt-header-userbox \.user-info > \.avatar/);
|
||||
assert.match(userboxCss, /\.aksrt-header-wallet/);
|
||||
assert.match(userboxCss, /\.aksrt-header-checkin/);
|
||||
@@ -278,7 +271,7 @@ test('old navigation settings and runtime handles do not survive the hard switch
|
||||
'src/Settings/FacadeBulk.php',
|
||||
'src/Core/ScriptsPart1b.php',
|
||||
'src/Core/ScriptsPart1c.php',
|
||||
'assets/js/aksrt-runtime.js',
|
||||
'assets/js/runtime/main.js',
|
||||
]);
|
||||
assert.doesNotMatch(source, /bootstrap5|aksrt-mini-touch|aksrt\.Drawer|aksrt\.minitouch|updateScrollBus/);
|
||||
assert.doesNotMatch(source, /aksrt_nav_|legacy_nav|nav_compat/);
|
||||
|
||||
Reference in New Issue
Block a user