refactor(postcss): 将 CSS 处理收口到 @weapp-tailwindcss/postcss - #1206
Merged
Merged
Conversation
主包不再直接依赖 postcss-scss、@csstools/css-tokenizer 和 lightningcss, 相关 API 与仓库约束一并落到 postcss 包。
Contributor
PR 性能基准报告:部分结果
总览
Benchmark 项目矩阵
Benchmark 插件处理阶段
Benchmark 内存
Watch 明细
门禁与诊断
运行链接统计口径
|
把 hoist/create border preflight 和 preflight import / vendor keyframes 清理从主包挪到 @weapp-tailwindcss/postcss,主包只保留模板注入与生成编排。
把 selector/unit 兼容、@apply 清理、空 CSS 块扫描以及 class style value 编译从主包挪到 @weapp-tailwindcss/postcss。Vite marker 去重仍留在主包。
uni-app Vite 构建在大量无 escape 的 @import 上不必每次走 tokenizer。 复杂输入(注释、escape、残缺引号)仍回退到 @csstools/css-tokenizer。
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 语法解析、tokenize 和存量 CSS AST 变换收到
@weapp-tailwindcss/postcss。weapp-tailwindcss不再直接依赖postcss-scss、@csstools/css-tokenizer和未使用的lightningcss。变更
packages/postcss/src/syntax/:parseCssImportSpecifier、quoteCssImportSpecifier、parseScssSource、parseUniAppXStyleSourceparseTailwindCssDirectiveRequest改为 tokenizer 实现@apply清理、空块扫描、Harmony CSS style valuetest/ci/architecture-contract.test.ts禁止主包再引入 CSS 处理库@reference路径解析和生成编排验证
pnpm --filter @weapp-tailwindcss/postcss testpnpm --filter weapp-tailwindcss exec vitest run test/ci/architecture-contract.test.ts test/tailwindcss/v4-import-paths.test.ts test/core.test.ts test/uni-app-x test/postcss test/bundlers/css-imports.test.ts test/bundlers/shared/generator-css/legacy-selectors.test.ts test/bundlers/shared/generator-css/legacy-compat.test.ts test/bundlers/final-css-cleanup.unit.test.ts test/tailwindcss/v4-engine.test.tspnpm --filter @weapp-tailwindcss/postcss buildpnpm agents:check