Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

refactor(schema-catalog): 103 个 div 节点的布局意图改写成 flex/stack/container/grid props (#4003) - #4892

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-4003-catalog-layout-props
Aug 17, 2026
Merged

yinlianghui merged 1 commit into
mainfrom
claude/issue-4003-catalog-layout-props

Conversation

@yinlianghui

Copy link
Copy Markdown
Contributor

Fixes #4003
Part of #3965

基 origin/main @ 372d9f9b4。

前置核查(两项,均已确认)

#4001 已落 main —— 34a00bf29 fix(schema-catalog): grid 示例的列数键 cols → columns (#4001) (#4008)。本单基于其结果动工,新增的 5 个 grid 节点一律写声明键 columns,#4001 留下的 grid-columns-key.test.tsx 全程绿。

106 节点清单按 origin/main 重扫对账 —— 与 PR #3998 的判定表逐格一致,catalog 一周内无增删影响:189 个 div 节点 / 47 个文件 / 全目录 423 个示例,四类计数 flex 84、stack 9、container 8、grid 5,合计 106。差异为零。

转换结果:106 判定 → 103 转换 + 3 豁免

类别 判定 转换 目标 props
flex(含 flex 不含 flex-col) 84 84 align / justify / gap / wrap
stack(space-y-*) 9 8 gap
container(max-w-*) 8 6 maxWidth / centered / padding
grid(grid / grid-cols-*) 5 5 columns 对象 + gap
合计 106 103

转换后 catalog 的 div 节点从 189 降到 86,含 div 的文件从 47 降到 28。

3 个豁免(逐个有据,并写进测试的 allowlist)

卡内 4 个 body 节点:前提不成立,已改为前瞻性防护

卡内列的第一个坑是「4 个节点用 body 而非 children,先改 body 再换类型」。按 origin/main 重扫,这 4 个节点不在本单范围内 —— 它们是 components-basic-sidebar/*.json 的四个 {"type":"div","className":"p-4","body":[...]},className 只有 p-4,落在 PR3998 判定表的「纯装饰盒子 61」里,属于 83 个无对等物那批。本单 103 个转换节点里 body 键出现 0 次,body→children 改写数因此是 0,不是漏做。

坑本身是真的,只是命中面在别处。所以没有强行凑一个改写,而是把它钉成面向整个类型族的前瞻守卫:flex/stack/grid/container 一律不得携带 body 键。下一轮 sweep 处理那 83 个时,naive 换类型会当场撞红而不是静默丢内容(反向验证已实测,见下)。

两处渲染器读法修复(本 PR 越出了卡内文件面,单独声明)

卡内给 container 的等价办法是「默认 padding 4,需显式 padding: 0 保等价」。实测该办法本身失效:

packages/components/src/renderers/layout/flex.tsx:19       const gap = schema.gap || 2;
packages/components/src/renderers/layout/container.tsx:21  const padding = schema.padding || 4;

FlexSchema.gap / ContainerSchema.padding 都声明为 number,0 是合法值,但 || 把它折进默认值 —— 于是两个渲染器里各自那行专门为零值写的分支是死代码:

flex.tsx:47       gap === 0 && 'gap-0',
container.tsx:43  padding === 0 && 'p-0',

后果实测:声明 padding: 0 的 container 渲染出 p-2 sm:p-3 md:p-4(6 个 container 节点凭空长出内边距,其中 4 个是 ecommerce / marketing 文档页的顶层包装),声明 gap: 0 的 flex 渲染出 gap-1.5 sm:gap-2。这就是 #4001 的同型故障往下一层:声明了的键,引擎默默丢弃,JSON 说一套 DOM 做一套。

两行改为 ??,与同族的 stack.tsx:25 / grid.tsx:88 本来就用的读法一致 —— 不是新发明的约定,是把跑偏的两个收回来。未声明该键时默认值一字不变(gap: 2 / padding: 4);只有显式声明的 0 会变,而基线 commit 上全仓 JSON 声明 gap: 0 或 padding: 0 的节点数是 0,所以今天渲染的任何东西都不改变。

为什么放进本 PR 而不是拆单:不修则卡内的 container 验收条款无法达成,而唯一的绕法是在 className 里塞 p-0 sm:p-0 md:p-0 去对冲自己声明的 padding —— 正是卡里 ⛔ 掉的「自相矛盾的授权」。若维护者认为该走独立单,回退这 2 行 + 对应 pin 测试即可,代价是本 PR 需撤下 6 个 container 节点、49 个 flex 节点改回不声明 gap。

等价验证:103/103 渲染子树逐字节一致

把每个转换后的节点、与它替换掉的那个 div(用转换前的真实 className、包住同一批 children)双双送进真的 SchemaRenderer 渲染后比对。逐节点隔离比较,不比整棵子树 —— 否则差异只会来自后代也被转换了。

103 个节点的 innerHTML 全部逐字节相同。 类名增减的全集(按 token 统计出现节点数)只有下面这些,没有一项是回归:

增加的 token 节点数 性质
flex-row 84 flex 的 CSS 初始方向,裸 div 加 flex 本来就是 row
justify-start 43 CSS 初始值 flex-start,原本没写
items-stretch 23 CSS 初始值,原本没写 items-*(15 flex + 8 stack)
gap-0 49 原本就没有任何 gap 类
p-0 6 原本就没有 padding 类
w-full 2 block 元素常规流下 width:auto 已铺满,等效(另 4 个 container 原本就带 w-full)
grid-cols-1 5 只有 md:grid-cols-* 之类响应式列类的裸 grid,基础断点本就解析成单列
flex flex-col 8 stack:space-y-* 的块级间距换成 flex column
gap 阶梯(gap-2 sm:gap-3 等) 40 + 4 见下
减少的 token 节点数 换成了
gap-3 35 gap-2 sm:gap-3(mobile-first 阶梯)
space-y-4 / space-y-2 / space-y-3 / space-y-6 4 / 2 / 1 / 1 stack 的 gap 阶梯

前 8 行全部是无渲染差异的显式化:要么是 CSS 初始值被写明,要么是原本就没有的属性被声明成零。真正改变渲染的只有最后一类 —— gap/space-y 换成阶梯。

gap 阶梯在 640px 以下不是逐字节等价,这是正确语义 —— 阶梯就是 FlexSchema.gap 的含义。⛔ 没有用「gap: 0 + className 留着 gap-3」去硬凑逐字节:那种写法自相矛盾,而且恰好再教一遍本单要消除的反模式。

grid 一类卡内写的是「逐字节等价」,实测略有出入且出入是对的:5 个节点原本都只有响应式列类(md:grid-cols-3 之类)、没有基础列类,渲染器必然产出一个基础列类,于是 5 个各多出一个 grid-cols-1;其余 token 逐字节同序。多出来的正是裸 grid 隐式解析出的单列基线。

反向验证(三组,均先写预判再执行)

RV1 —— 渲染器读法。 把 flex.tsx 的 ?? 改回 ||。预判:gap-0 钉子翻红、features-grid 等价钉翻红,而「省略 gap 时仍默认 2」应当保持绿(|| 与 ?? 在键缺席时一致)。实测与预判一致:

× renders gap-0, not the default ladder
  Expected: "flex flex-row justify-start items-start gap-0"
  Received: "flex flex-row justify-start items-start gap-1.5 sm:gap-2"
× marketing/features-grid (... 转 flex)
  AssertionError: marketing/features-grid has no flex node rendering
  `flex flex-row justify-center items-center gap-0 h-12 w-12 rounded-lg bg-primary/10`
 Tests  2 failed | 17 passed (19)

17 个通过的里就含「省略 gap 时仍默认 2」 —— 预判的不变方向也确认了(这条正是 ?? 正确、|| 不正确的分界)。

RV2 —— body 陷阱守卫。 卡内预设的靶子(范围内的 body 转 children 转换)不存在,故改用真实标本反向验证守卫本身:取范围外的 components-basic-sidebar/basic-sidebar.json 的 body 节点,naive 换成 flex。预判:body 守卫翻红,且内容静默丢失。实测一致:

× no layout node carries a `body` key, which those renderers never render
  + "components-basic-sidebar/basic-sidebar (type: flex)"

内容丢失实测(同一节点两种 type 渲染):div 的 innerHTML 是 "Main content area"(17 字节),flex 的是 ""(0 字节)—— 静默清零,没有任何报错。

RV3 —— 反模式棘轮。 把 marketing/testimonials 的 grid 节点改回 div 原写法。预判:棘轮翻红。实测一致:

× no div carries layout-intent classes outside the documented exemptions
  + "marketing/testimonials :: grid md:grid-cols-3 gap-6 (转 grid)"

三组变异均已 git checkout 还原(⛔ 未用 git stash —— stash 栈是跨 worktree 共享的)。

新增测试

examples/schema-catalog/test/layout-props-conversion.test.tsx(13 条),沿 fields-form-hosted 的 harness 形态,钉三件不同的事:

  1. 棘轮 —— catalog 里没有任何 div 携带布局意图 className,除上述 3 个豁免;另有一条「豁免仍然命中」的反向条款,防止 allowlist 比事实更宽。
  2. 无死插槽 —— 没有任何 flex/stack/grid/container 节点携带 body 键(即上文的前瞻守卫);外加非空性下限(当前 441 个布局节点)。
  3. 等价 —— 每类至少 2 个抽样(共 8 个),内联转换前的真实 className,断言渲染子树逐字节一致 + 转换后类名逐字面钉死。

packages/components/src/__tests__/layout-zero-scale-values.test.tsx(6 条)钉住零值可达:gap: 0 得 gap-0、padding: 0 得 p-0;并各配一条「省略时仍取默认值」(防止把 || 的 bug 修成反向的 bug)与一条非零阶梯不受影响。

验证

pnpm --workspace-concurrency=2 --filter "@object-ui/example-schema-catalog^..." build
  BUILD EXIT: 0

pnpm exec vitest run examples/schema-catalog --maxWorkers=2
  Test Files  9 passed (9)
       Tests  1589 passed (1589)

pnpm exec vitest run packages/components --maxWorkers=2
  Test Files  144 passed (144)
       Tests  1293 passed (1293)

pnpm exec turbo run type-check --concurrency=2
  Tasks:    81 successful, 81 total
  Cached:    25 cached, 81 total
    Time:    6m33.999s

node scripts/check-control-bytes.mjs
  OK (scanned 4370 tracked text file(s); skipped 85 binary)
  改动文件另做了越过门禁盲区的自查(grep -naP 控制字符类),零命中

全部重活都在 flock /tmp/os-heavy-verify.lock 里串行执行,堆上限 4GB。

changeset

catalog 侧不欠 changeset:@object-ui/example-schema-catalog 命中 .changeset/config.json 的 ignore 项 @object-ui/example-*,changesets 从不给它发版。node scripts/check-changeset-presence.mjs 实测:

Compared the working tree with 372d9f9b4 (merge-base with origin/main): 25 file(s) changed,
0 of them under the src/ of a package the release covers, 0 under a package changesets ignores,
0 changeset(s) added.
✅  No source of a released package changed in this range, so no changeset is owed.

但 packages/components 的两行读法修复动的是已发版包,故补了 .changeset/tidy-poems-shave.md,按 AGENTS.md 版本策略标 minor(⛔ 不标 major)。

边界

只动了 25 个 catalog JSON + 2 个渲染器读法 + 2 个测试 + 1 个 changeset。没有碰 83 个无对等物节点、div.mdx 的 2 个 legacy 示例、任何 MDX 文档页,没有碰 content/docs/releases/,没有给渲染器加任何宽容别名。

浏览器抽查

未做。容器内没有可用的 preview / 浏览器通道,如实记录:以上述 103/103 的真实 SchemaRenderer DOM 断言代替,该断言比缩略图目视更严(逐字节比对子树 + 类名逐字面钉死)。

相邻发现(已另立单,不在本 PR 扩围)

三条都打了 finding(今天都没有用户撞到),交分诊定级;三条都做过关键词 + 文件路径的重复检索,无既有单。

完整的 103 节点转换清单(文件 → 原 className → 新 props)见下方评论,避免正文过长。


Generated by Claude Code

…des (#4003)

106 of the catalog's 189 `div` nodes hand-wrote in Tailwind exactly what
`flex` / `stack` / `container` / `grid` already expose as declared props.
103 are converted here; the remaining three are documented exemptions.

  flex       84  items-*/justify-*/gap-N  -> align/justify/gap
  stack       8  space-y-N                -> gap
  container   6  max-w-*/mx-auto          -> maxWidth/centered/padding
  grid        5  (sm|md|lg):grid-cols-N   -> columns object + gap

Every conversion was verified by rendering the converted node and the `div`
it replaced through the real SchemaRenderer around the same children: all 103
subtrees are byte-identical. The only class deltas are the CSS initial values
the renderers state explicitly (`flex-row`, `justify-start`, `items-stretch`,
`gap-0`, `p-0`, `w-full`), the explicit single-column grid base (`grid-cols-1`),
and the mobile-first gap ladder that `FlexSchema.gap` means.

Two renderer reads blocked the conversion and are fixed with it: `flex.tsx`
read `schema.gap || 2` and `container.tsx` read `schema.padding || 4`, so a
declared `0` was folded into the default and the `gap === 0 && 'gap-0'` /
`padding === 0 && 'p-0'` branches below were unreachable. Both now use `??`,
matching sibling `stack.tsx` / `grid.tsx`. No node in the repository declared
either key as `0` before this change.

Co-authored-by: Claude <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor Author

附录:103 个节点的转换清单(文件 → 原 className → 新 props)

每行的 n 是该文件内完全相同的转换重复次数(例如 document-browser 的 20 个列表项写法一字不差)。

block-schema/block-marketplace-listing.json (1 node)

n was className now
1 h-32 bg-gradient-to-br from-blue-500/20 to-purple-500/20 rounded-t-lg flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className h-32 bg-gradient-to-br from-blue-500/20 to-purple-500/20 rounded-t-lg

block-schema/block-with-variable-overrides-analytics-feature.json (1 node)

n was className now
1 w-12 h-12 rounded-lg bg-purple-500/10 flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className w-12 h-12 rounded-lg bg-purple-500/10

block-schema/block-with-variable-overrides-security-feature.json (1 node)

n was className now
1 w-12 h-12 rounded-lg bg-green-500/10 flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className w-12 h-12 rounded-lg bg-green-500/10

block-schema/feature-card-block.json (1 node)

n was className now
1 w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className w-12 h-12 rounded-lg bg-primary/10

components-complex-carousel/photo-gallery.json (4 nodes)

n was className now
1 aspect-video bg-gradient-to-br from-blue-400 to-blue-600 rounded-lg flex items-center justify-center text-white text-2xl font-bold flex — justify: "center", align: "center", gap: 0 + className aspect-video bg-gradient-to-br from-blue-400 to-blue-600 rounded-lg text-white text-2xl font-bold
1 aspect-video bg-gradient-to-br from-purple-400 to-purple-600 rounded-lg flex items-center justify-center text-white text-2xl font-bold flex — justify: "center", align: "center", gap: 0 + className aspect-video bg-gradient-to-br from-purple-400 to-purple-600 rounded-lg text-white text-2xl font-bold
1 aspect-video bg-gradient-to-br from-green-400 to-green-600 rounded-lg flex items-center justify-center text-white text-2xl font-bold flex — justify: "center", align: "center", gap: 0 + className aspect-video bg-gradient-to-br from-green-400 to-green-600 rounded-lg text-white text-2xl font-bold
1 aspect-video bg-gradient-to-br from-orange-400 to-orange-600 rounded-lg flex items-center justify-center text-white text-2xl font-bold flex — justify: "center", align: "center", gap: 0 + className aspect-video bg-gradient-to-br from-orange-400 to-orange-600 rounded-lg text-white text-2xl font-bold

components-complex-filter-builder/search-interface.json (1 node)

n was className now
1 space-y-4 p-6 border rounded-lg max-w-3xl stack — gap: 4 + className p-6 border rounded-lg max-w-3xl

components-complex-resizable/horizontal-split.json (2 nodes)

n was className now
1 p-4 h-full flex items-center justify-center bg-slate-50 flex — justify: "center", align: "center", gap: 0 + className p-4 h-full bg-slate-50
1 p-4 h-full flex items-center justify-center bg-slate-100 flex — justify: "center", align: "center", gap: 0 + className p-4 h-full bg-slate-100

components-complex-scroll-area/chat-messages.json (31 nodes)

n was className now
1 p-4 space-y-3 stack — gap: 3 + className p-4
15 flex gap-3 p-3 rounded-lg bg-slate-50 hover:bg-slate-100 flex — align: "stretch", gap: 3 + className p-3 rounded-lg bg-slate-50 hover:bg-slate-100
15 w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white font-semibold flex-shrink-0 flex — justify: "center", align: "center", gap: 0 + className w-10 h-10 rounded-full bg-blue-500 text-white font-semibold flex-shrink-0

components-complex-scroll-area/document-browser.json (20 nodes)

n was className now
20 p-3 hover:bg-slate-50 cursor-pointer flex items-center gap-3 flex — align: "center", gap: 3 + className p-3 hover:bg-slate-50 cursor-pointer

components-complex-scroll-area/horizontal-scroll.json (10 nodes)

n was className now
10 w-40 h-32 bg-slate-200 rounded flex-shrink-0 flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className w-40 h-32 bg-slate-200 rounded flex-shrink-0

components-complex-scroll-area/short-150px.json (1 node)

n was className now
1 space-y-2 stack — gap: 2 (no className)

components-complex-scroll-area/tall-300px.json (1 node)

n was className now
1 space-y-2 stack — gap: 2 (no className)

components-data-display-statistic/sales-dashboard.json (1 node)

n was className now
1 max-w-4xl container — maxWidth: "4xl", centered: false, padding: 0 (no className)

components-feedback-toaster/with-toast-trigger.json (1 node)

n was className now
1 space-y-4 stack — gap: 4 (no className)

components-form-calendar/form-integration.json (1 node)

n was className now
1 max-w-sm space-y-4 p-4 border rounded-lg stack — gap: 4 + className max-w-sm p-4 border rounded-lg

components-form-file-upload/form-example.json (1 node)

n was className now
1 max-w-md space-y-6 p-6 border rounded-lg stack — gap: 6 + className max-w-md p-6 border rounded-lg

components-form-toggle/settings-example.json (1 node)

n was className now
1 max-w-md p-6 border rounded-lg space-y-4 stack — gap: 4 + className max-w-md p-6 border rounded-lg

components-layout-semantic/complete-layout.json (1 node)

n was className now
1 max-w-4xl border rounded-lg overflow-hidden container — maxWidth: "4xl", centered: false, padding: 0 + className border rounded-lg overflow-hidden

ecommerce/order-summary.json (2 nodes)

n was className now
1 grid md:grid-cols-2 gap-6 grid — columns: {"xs":1,"md":2}, gap: 6 (no className)
1 h-10 w-16 rounded bg-muted flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className h-10 w-16 rounded bg-muted

ecommerce/product-card.json (1 node)

n was className now
1 aspect-square bg-muted flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className aspect-square bg-muted

ecommerce/product-grid.json (6 nodes)

n was className now
1 w-full max-w-6xl mx-auto container — maxWidth: "6xl", padding: 0 (no className)
1 grid sm:grid-cols-2 lg:grid-cols-4 gap-6 grid — columns: {"xs":1,"sm":2,"lg":4}, gap: 6 (no className)
4 aspect-square bg-muted flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className aspect-square bg-muted

ecommerce/shopping-cart.json (2 nodes)

n was className now
2 h-24 w-24 rounded-lg bg-muted flex items-center justify-center flex-shrink-0 flex — justify: "center", align: "center", gap: 0 + className h-24 w-24 rounded-lg bg-muted flex-shrink-0

marketing/features-grid.json (8 nodes)

n was className now
1 w-full max-w-6xl mx-auto container — maxWidth: "6xl", padding: 0 (no className)
1 grid md:grid-cols-3 gap-8 grid — columns: {"xs":1,"md":3}, gap: 8 (no className)
6 h-12 w-12 rounded-lg bg-primary/10 flex items-center justify-center flex — justify: "center", align: "center", gap: 0 + className h-12 w-12 rounded-lg bg-primary/10

marketing/pricing-table.json (2 nodes)

n was className now
1 w-full max-w-6xl mx-auto container — maxWidth: "6xl", padding: 0 (no className)
1 grid md:grid-cols-3 gap-8 grid — columns: {"xs":1,"md":3}, gap: 8 (no className)

marketing/testimonials.json (2 nodes)

n was className now
1 w-full max-w-6xl mx-auto container — maxWidth: "6xl", padding: 0 (no className)
1 grid md:grid-cols-3 gap-6 grid — columns: {"xs":1,"md":3}, gap: 6 (no className)

Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 24.7 KB 350 KB
Entry file index-TipVbxEF.js —
Status PASS —

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 9.56KB 3.59KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 8.92KB 3.41KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 25.13KB 5.40KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 38.46KB 10.17KB
auth (createAuthenticatedFetch.js) 6.34KB 2.43KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.02KB 0.88KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 26.07KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.65KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 498.36KB 111.03KB
core (index.js) 3.79KB 1.52KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 157.05KB 43.28KB
fields (index.js) 231.73KB 57.60KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.35KB 1.38KB
i18n (pickLocalized.js) 3.69KB 1.73KB
i18n (provider.js) 23.12KB 7.62KB
i18n (useDisplayLocale.js) 2.84KB 1.45KB
i18n (useObjectLabel.js) 27.59KB 6.63KB
i18n (useSafeTranslation.js) 7.77KB 3.13KB
layout (index.js) 38.86KB 10.83KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 9.35KB 3.31KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 4.42KB 1.42KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.81KB 0.83KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 46.62KB 12.83KB
plugin-charts (index.js) 64.75KB 18.37KB
plugin-chatbot (index.js) 181.21KB 43.14KB
plugin-dashboard (index.js) 128.14KB 32.58KB
plugin-designer (index.js) 212.39KB 42.83KB
plugin-detail (index.js) 239.81KB 59.97KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 115.34KB 27.74KB
plugin-gantt (index.js) 164.06KB 39.94KB
plugin-grid (index.js) 192.23KB 51.30KB
plugin-kanban (index.js) 52.72KB 14.54KB
plugin-list (index.js) 111.23KB 26.97KB
plugin-map (index.js) 17.91KB 5.72KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 41.70KB 11.19KB
plugin-timeline (index.js) 26.68KB 7.66KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 83.81KB 20.49KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 27.53KB 9.41KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.28KB 0.68KB
react (schema-input.js) 1.45KB 0.83KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 3.05KB 1.52KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Contributor Author

【PM 验收 · ACCEPT,越界核准】objectui 分片 PM(session_01GTRjn8xBqp75dk7kFupVRt)对 #4003(catalog 106 布局节点转 props)的实施验收:

实物核验:30 文件 —— catalog 26 + components 侧恰为两行 ||→??(带注释)+ 零值 pin 测试 + minor changeset,与越界声明逐项一致。模型标识 0、releases 0。对账:106 判定与 PR3998 逐格一致,103 转换 + 3 豁免各有据(2 个 legacy 刻意示例 + 1 个 max-w-none 不可表达 → #4889);103/103 真实 SchemaRenderer 隔离前后逐字节比对,类名增量逐项归因。

越界裁定(A 案核准,留否决窗):flex/container 两行 ||→?? 留在本 PR。理由:①卡内等价条款(「显式 padding:0 保等价」)自身依赖它 —— || 把声明的 0 折进默认值,两处零值分支是死代码,不修则条款无法达成;②恢复 declared=delivered 不变量(引擎不再静默丢弃已声明值),与 #4001「在 producer 修」同向;③B 案会迫使 49 个节点用「不声明 gap」规避渲染器 bug,把 bug 形状固化进 103 个 AI 教材范本 —— 正是本车道第二轴最忌;④爆炸半径实测零(全仓声明 gap:0/padding:0 的节点数 0)+ 同族 stack/grid 本就用 ?? + 双 pin + 精确回退路径。维护者可低成本改判(回退 2 行 + 撤 pin 测试)。

卡内指引三处出入全部如实修正:4 个 body 节点实不在 106 内(改前瞻守卫 + 真标本反证 17→0 字节静默清零)、grid 非逐字节(多一个 grid-cols-1 是裸 grid 隐式基线,正确)、padding:0 手段自身失效(即越界的成因)。三组反向验证逐字命中预判。CI:19/19 全部完成零失败(dev 终报,PM 采信其逐项清单)。新 findings #4889/#4890/#4891(后两者文件面重叠建议合并 sweep,本 PR 建的棘轮即落点)记账合格,留分诊。

处置:undraft + auto-merge(SQUASH)。


Generated by Claude Code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

catalog:106 个 className 明确写着布局意图的 div 节点转成 flex/stack/grid/container props(#3965 的词表无关部分)

2 participants