refactor(postcss): 统一样式转换归属并复用解析与规则索引 - #1217
Draft
sonofmagic wants to merge 12 commits into
Draft
sonofmagic wants to merge 12 commits into
sonofmagic wants to merge 12 commits into
Conversation
Contributor
PR 性能基准报告:失败
总览
Benchmark 项目矩阵
Benchmark 插件处理阶段
Benchmark 内存
Watch 明细
门禁与诊断
运行链接统计口径
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSS 转换实现原先分散在 generator、Vite、Webpack、uni-app x 与 Native 包中。本 PR 将纯转换归入
@weapp-tailwindcss/postcss,消费包保留构建图、文件身份、平台/会话和输出交付职责,并复用单次调用的解析与规则索引。本 PR 保持草稿:包级与定向真实项目验证已通过。HBuilderX 5.26、浏览器预检及 demo 编译器/基座版本已对齐;App 增量更新重启回退仍未解决,并已在迁移前基线复现,尚未全端通过。
实现
/native子入口;manifest、Babel/Metro 与 runtime 保留原归属。LightningCSS visitor 放入实验子入口,稳定根入口不加载实验引擎;injector 仅迁移纯指令插入。本地验证
--update=none复核。仅 HBuilderX 5.26 reset 选择器顺序/空白变化,声明未变。所有常规 Vitest 使用
CI=1 --update=none。命令与持久回归见 工程记录。未新增或放宽 AGENTS 规则。性能证据与边界
基线
821f4dd4b与迁移后ad8ec641b使用同一锁文件、Node 24.18.0、pnpm 12.4.1、独立 workspace 产物;五项目各 3 次构建、5 次 watch 更新,正反顺序两轮共 20 条记录均无 error。首轮早期有短暂并发 H5 诊断,保留原样本,第二轮全程串行确认。第二轮构建 steady 中位数(基线→当前,ms):Mpx 5376→5376,Taro React 11569→11520,Taro Vue3 11048→10981,uni-app 3716→3719,weapp-vite 2692→2679。HMR 与 RSS 没有一致收益,Taro React HMR 的快慢顺序在两轮反转;不能宣称全框架显著提速或稳定降内存。
确定改善限定为重复解析减少和 scoped-rule 热点:15,840 字节、500 选择器、每规则 30 声明,20 次预热后交替 30 组×10 次,旧 16.30 ms、新 7.02 ms,输出相等。完整性能表及原始报告位置见工程记录。
完整验收状态
升级后 preflight
c117bf03-f1be-482f-99b8-aebfac670b34已通过并用于首轮 full-report:build:ci、五项目完整 watch、uni-app 14 平台产物、H5 dev(2 通过、1 过滤跳过)通过。visual 阶段因上述基线已有问题失败,Android/iOS/Harmony 后续专用阶段未执行。uni-app memory build 被既有 guard 跳过,不将其 1 MB 采样算作有效构建数据;功能回归中的 weapp-vite 使用构建回退,不与性能 runner 的 watch 数据混用。上述 H5 问题已完成定向修正验证。在
baa57d7ce8f9eead9f72ee89208d69a3599b4b81重新 prepare,run ID 为3662e7cf-57b3-42f6-a8a0-092c056b7261:base、微信、HBuilderX 5.26、iOS、Android、Harmony、Web 脚本探针全部通过,但当前会话cua.getState()返回Browsers: Error: Codex auth token is unavailable。已立即通知用户并通过 preflight block 保存原始原因。上述浏览器阻塞已恢复。在
4603ee84876e26ee369fca637285e6ac3533b79b新建 preflight0dc8d5b0-3879-4d1a-a445-72774f2af964,脚本与当前会话 computer use 全部通过,实际启动 full-report:@dcloudio/* 3.0.0-5010520260709002不随 IDE 升级自动更新。App Launch,不符合既有纯 HMR 条件。不能全部归因为版本不匹配,仍需独立定位。报告:
.tmp/postcss-full-acceptance-resumed/2026-09-18T15-18-25-224Z/,保留原始 launch 日志、截图和执行日志。后续已将普通 uni-app Vite demo 的 21 个同系列编译依赖对齐到正式版
3.0.0-5020620260917001,实际元数据为编译器 5.26;未改其他项目依赖声明。frozen install 通过,限定项目重生成 13 个 static 快照无 diff,2 项 static 复核通过;14 平台构建及登记检查共 15 项通过,H5 dev 为 2 通过、1 过滤跳过。有界 iOS 恢复检查确认版本弹窗消失,初始页面和样式探针通过,但增量后仍触发
App Launch。独立迁移前基线821f4dd4b的 HBuilderX Vue3 iOS 在相同 5.26 环境下也触发相同断言;生命周期检查和 App visual 实现本次未修改。这是可在基线复现的未解决项,不计为重构后纯 HMR 通过。只读检查 HBuilderX 5.26 的上游实现后,普通 uni-app Vue3 的重启路径已定位:
vite-plugin-uni在BUNDLE_END排除包含app-service.js的普通文件增量;没有PAGES:/FILES:的编译结果由 IDE 分类为全量同步,iOS launcher 的pushPackage显式发送restart。这与迁移前后的运行日志一致。App Launch证明应用生命周期重新执行,不证明操作系统进程退出或重新安装;官方“热刷新”也不承诺保持运行状态。完整源码路径和边界见工程记录。剩余阻塞是平台原生热重载与既有纯 HMR 验收条件不一致。继续完整验收需确认保留状态的上游更新路径,或由维护者明确平台原生热重载的独立验收标准;本 PR 未将重启计为纯 HMR 成功。uni-app x 与 Harmony 不直接套用普通 Vue3 的结论。未修改 IDE、断言或旧门禁,未等待远端 CI。新 demo 编译器的结果不混入此前旧锁文件的性能样本。
Refs #1214。依赖 PR #1216,base 为
codex/docs-spacing-rpx-limitations;原 rpx warning PR 范围保持独立。