Skip to content

fix(plugin-report): 放宽 react/react-dom peer 到 ^18.0.0 || ^19.0.0,对齐其余 29 个包 (#3690) - #3727

Merged
yinlianghui merged 2 commits into
mainfrom
claude/issue-3690-report-peer-widen
Aug 8, 2026
Merged

fix(plugin-report): 放宽 react/react-dom peer 到 ^18.0.0 || ^19.0.0,对齐其余 29 个包 (#3690)#3727
yinlianghui merged 2 commits into
mainfrom
claude/issue-3690-report-peer-widen

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #3690

@object-ui/plugin-reportpeerDependencies.react / react-dom^18.0.0 放宽到 ^18.0.0 || ^19.0.0,与固定版本组里其余 29 个包对齐。npm 7+ 严格解析 peer,React 19 使用者装这个已发布包(17.3.0)会在首次 install 撞 ERESOLVE,而 29 个兄弟包全部装得干净。该包 README 早就写着放宽后的范围 —— 错的一直是清单这一侧

PM 裁决的三探针在动手之前逐一实测,全过。这类改动的「验证」就是探针本身:peer 范围是发布元数据,不进任何代码路径,不存在「改前红、改后绿」的断言可写。下面据实写探针输出,不造模板红绿。


探针一 · git 历史 —— 过,但机制与派发预设的不同

派发预设的形状是「28 个兄弟包批量加 || ^19.0.0,plugin-report 早于该批量且被漏改」。这个批量提交不存在。 据实报账:

仓库是 shallow clone(211 commits,graft 点 30ac2e1ee 把每个文件都显示成 new file),必须 git fetch --unshallow(7516 commits)才能看清。展开后:

$ git log --follow --diff-filter=A -- packages/plugin-report/package.json
1e557cbda  Fri Feb 6 15:25:02 2026 +0800  Jack
feat(plugin-report): add ReportRenderer and ReportViewer components ...

$ git show 1e557cbda:packages/plugin-report/package.json → peerDependencies.react = "^18.0.0"

宽范围不是某次批量补的,而是仓库从 2026-01-14 起的出生约定,逐包在创建时写入。在 plugin-report 创建的那个切点上量所有包:

$ # 在 1e557cbda 处逐包读 peerDependencies.react
19 个包  ^18.0.0 || ^19.0.0   (react, components, layout, fields, plugin-grid, plugin-form,
                               plugin-view, plugin-kanban, plugin-markdown, plugin-charts,
                               plugin-editor, plugin-detail, plugin-list, plugin-map,
                               plugin-calendar, plugin-gantt, plugin-chatbot, plugin-timeline,
                               plugin-aggrid)
 2 个包  ^18.0.0              plugin-report(刚创建)、plugin-dashboard

创建于 plugin-report 之后的每一个包都是出生即宽 —— 相隔仅两三天的也一样:

i18n            2026-02-08  bd3deb60f  ^18.0.0 || ^19.0.0
mobile          2026-02-09  8eb0ccbfc  ^18.0.0 || ^19.0.0
permissions     2026-02-09  49ddc8b6a  ^18.0.0 || ^19.0.0
plugin-ai       2026-02-09  b46dc0c1d  ^18.0.0 || ^19.0.0
plugin-designer 2026-02-09  a18302190  ^18.0.0 || ^19.0.0
auth            2026-02-10  7c2e3cd9c  ^18.0.0 || ^19.0.0
collaboration   2026-02-12  bfed0c107  ^18.0.0 || ^19.0.0
app-shell       2026-04-14  b55f88da9  ^18.0.0 || ^19.0.0
providers       2026-04-14  b55f88da9  ^18.0.0 || ^19.0.0
plugin-tree     2026-06-22  4eb9cb6ac  ^18.0.0 || ^19.0.0

另一个出生即窄的 plugin-dashboard 在 2026-05-08 被 d2b6ecec6(fix(build): externalize all bare imports in library builds)改正:

-    "react": "^18.0.0",
-    "react-dom": "^18.0.0"
+    "react": "^18.0.0 || ^19.0.0",
+    "react-dom": "^18.0.0 || ^19.0.0",

那次只碰了 plugin-dashboard 一个 package.json(git show --name-only d2b6ecec6 | grep package.json 只有一行),是定点修,不是批量 —— 所以 plugin-report 没被捎上。

逐包扫「出生即宽 / 后来变宽」,plugin-report 是唯一一个声明了 react peer 却从未拿到宽字符串的包;它 172 次提交的历史里没有任何一次动过 peer 行,创建提交的正文(六条 bullet,讲 ReportRenderer/ReportViewer/ReportBuilder/测试/注册/构建配置)也没有一个字提到 React 版本约束。

方向判定:过。 探针要回答的是「窄范围是不是被记录过的刻意约束」,答案是否 —— 它是一份手写 package.json 偏离了当时已成立的约定,此后无人回访。机制与预设不同,结论同向,故按裁决继续;预设错的那一半在此如实写明。

探针二 · API 面 —— 过,零命中

$ grep -rnE 'ReactDOM\.(render|hydrate)\b|unmountComponentAtNode|findDOMNode|createFactory|childContextTypes|contextTypes|getChildContext|defaultProps|propTypes|PropTypes|useFormState|react-test-renderer|react-dom/test-utils|unstable_batchedUpdates|renderToNodeStream|renderToStaticNodeStream' src/
(零命中)

$ grep -rnE 'ref="[^"]+"' src/                      # string refs        → 零命中
$ grep -rnE 'extends (React\.)?(Component|PureComponent)|componentWillMount|componentWillReceiveProps|componentWillUpdate' src/   → 零命中
$ grep -rnE 'useRef\(\)' src/                        # 19 的类型要求实参 → 零命中

正向清点该包用到的全部 React 面(4087 行,10 个源文件):

$ grep -rhoE 'React\.[A-Za-z]+' src/ | sort | uniq -c | sort -rn
      4 React.FC          2 React.useEffect     2 React.Fragment
      2 React.ComponentType   2 React.CSSProperties
      1 React.useState    1 React.useReducer    1 React.useMemo
      1 React.useContext  1 React.ReactNode

全部在 React 19 未变。React.FC 我故意放进了 grep 当近似项:它不是 19 移除的 API(变的是 @types/reactFC 不再隐含 children),而该包自己的 devDependencies 就是 @types/react: 19.2.18,已在 19 的类型面上编译。

附带量到:react-dom 在源码里从未被 import,只作为 UMD 全局名出现在 vite.config.ts:46 的 externals('react-dom': 'ReactDOM')。已另立观察级 finding,本 PR 仍按裁决同步放宽它 —— 保持固定组内一致优先于顺手裁剪 peer。

探针三 · 经验证据 —— 过

package.jsonpnpm.overrides 把整个 workspace 钉在 19.2.8:

"overrides": { "react": "19.2.8", "react-dom": "19.2.8",
               "@types/react": "19.2.18", "@types/react-dom": "19.2.4" }

plugin-report 自己没有 devDependencies.react,实测它解析到的就是这一份:

$ node -e "require.resolve('react/package.json',{paths:['packages/plugin-report/src']})"
node_modules/.pnpm/react@19.2.8/node_modules/react/package.json     version = 19.2.8

改动之前跑基线(此时清单仍写 ^18.0.0):

$ pnpm exec vitest run packages/plugin-report/ --maxWorkers=2
 Test Files  6 passed (6)
      Tests  78 passed (78)

也就是说这 78 个测试一直在 React 19 下跑,而清单一直声明它不支持 19。实证兼容。


改动面

文件 动作
packages/plugin-report/package.json react / react-dom peer → ^18.0.0 || ^19.0.0
scripts/__tests__/doc-version-claims.test.ts plugin-report 那一行 kind: 'stale'restatement,并把头注里的「NINE stale」修成八
.changeset/plugin-report-react-19-peer-3690.md patch(peer 放宽属用户可见);未声明 major,合仓规

README 一个字都没改,这是对的。 packages/plugin-report/README.md:24-25 本来就写着

- `react` ^18.0.0 || ^19.0.0
- `react-dom` ^18.0.0 || ^19.0.0

正如 #3711 在本单下的追评所判:是清单落后于 README,清单改对之后 README 自动为真。这也是九条 stale 债里最便宜的一条 —— 修锚点,不改句子。

pnpm-lock.yaml 零 delta,这是构造性的,不是漏跑。 跑了 pnpm install --lockfile-only,结果与 origin/main 逐字节相同。原因可机械核验:pnpm lockfile 的 importers 段对 workspace 包只记 dependencies / devDependencies,从不记 peerDependencies ——

$ # packages/plugin-report importer 块内的 key
dependencies, devDependencies
$ # importers 段里 'peerDependencies:' 的出现次数
0

所以 workspace 包改 peer 范围按构造不产生 lockfile 变化。据实写明,免得下一个读者以为这步被跳过了。

ledger 并行注记(#3708 在途也动同一文件)。 已复核在途 PR:#3708#3709 目前都没有开着的 PR(仓内在途 PR 只有 #3691 / #3598 / #3580,均不碰此文件)。因此我只动了 packages/plugin-report/README.md一行,architecture-overview / architecture.md / create-plugin.mdx 的六条 stale 行原样保留,留给 #3708 / #3709。头注的 stale 计数我从九改成八 —— 那两单落地时会各自再减,数字在同一句里,是行级冲突,取并集即可。

测试

$ pnpm exec vitest run packages/plugin-report/ scripts/__tests__/doc-version-claims.test.ts --maxWorkers=2
 Test Files  7 passed (7)
      Tests  84 passed (84)          # plugin-report 6 文件 78 测试 + ledger 1 文件 6 测试

$ pnpm exec vitest run scripts/ --maxWorkers=2          # 整个 scripts 面,确认没打断邻居
 Test Files  19 passed (19)
      Tests  351 passed (351)

$ pnpm run type-check:scripts        # 覆盖被我改的那个 ledger 测试文件
 exit=0

$ node scripts/check-control-bytes.mjs
 ✅ OK (scanned 3684 tracked text file(s); skipped 85 binary)

$ grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' 本 PR 三个文件
 exit=1(零控制字节)

一处如实交代:pnpm --filter @object-ui/plugin-report type-check 在本 worktree 未跑绿,报的是

src/ReportViewer.tsx(12,104): error TS2307: Cannot find module '@object-ui/types' ...
src/index.tsx(9,35):          error TS2307: Cannot find module '@object-ui/core' ...

这是新建 worktree 里 workspace 依赖没 build 的既有状态,不是本改动引起,两点可证:(1) 实测 packages/fields/distpackages/components/distpackages/react/distpackages/plugin-grid/dist 在本 worktree 里不存在,tsc 走 package typesdist/index.d.ts 因而解析不到,vitest 走源码 alias 所以照绿;(2) 本 PR 的 diff 只有一个 peerDependencies 块(tsc 从不读它)和一个 scripts/ 测试文件(type-check:scripts 已 exit=0),结构上不可能产生 workspace 模块的 TS2307。补齐它需要 pnpm --filter '@object-ui/plugin-report^...' build,我在容器里发起该构建时被打断,未重试。CI 每次全新安装并按拓扑先 build 依赖,会覆盖这一格 —— 但我不把它记成我跑绿的,请以远端为准。


🤖 Generated with Claude Code

https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt


Generated by Claude Code

…ckage pinned to 18 alone (#3690)

`peerDependencies.react` and `peerDependencies.react-dom` widen from `^18.0.0`
to `^18.0.0 || ^19.0.0`, matching the other 29 packages in the fixed version
group. With npm 7+ resolving peers strictly, a React 19 consumer installing the
published package hit an ERESOLVE on first install while every sibling installed
clean; the package README already documented the wider range, so the manifest was
the half that was wrong.

Three probes, run before the edit, all pointing the same way:

1. History. No batch commit ever added `|| ^19.0.0` to 28 packages, so the
   dispatch's "predates the batch and was missed" mechanism does not exist. The
   wide range is the repo's birth convention since 2026-01-14, applied per
   package at creation. plugin-report's manifest was hand-authored 2026-02-06
   (1e557cb) when nineteen siblings already carried the wide range, and every
   package created afterwards was born with it. The only other narrow-born
   package, plugin-dashboard, was corrected 2026-05-08 (d2b6ece) in a build fix
   touching only itself. No commit in the file's 172-commit history revisited the
   peer line; none mentions a React 18 requirement.
2. API surface. Zero uses of anything React 19 removed. The package's whole React
   surface is React.FC, useState, useEffect, useMemo, useReducer, useContext,
   Fragment, ComponentType, CSSProperties, ReactNode. react-dom is never imported
   by the source; it appears only as a UMD global name in the Vite externals.
3. Empirical. The workspace pins react to 19.2.8 via a root pnpm.overrides, and
   plugin-report resolves that build, so its 78 tests have been running under
   React 19 the whole time the manifest said 18 only.

Also flips the plugin-report row in scripts/__tests__/doc-version-claims.test.ts
from `kind: 'stale'` to `restatement`: that ledger row recorded the README as
wrong-versus-manifest, and widening the manifest makes the README's existing text
true without editing a character of prose. Header counts go from nine stale rows
to eight.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 8, 2026 10:28am

Request Review

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-BukWa__X.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.66KB 3.13KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
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) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
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) 4.91KB 0.87KB
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) 480.72KB 105.64KB
core (index.js) 2.96KB 1.13KB
create-plugin (index.js) 9.08KB 2.92KB
data-objectstack (index.js) 137.51KB 35.11KB
fields (index.js) 230.90KB 56.84KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.53KB 10.71KB
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) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
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.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 61.04KB 17.31KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 115.50KB 29.96KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 232.79KB 57.42KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 112.10KB 27.10KB
plugin-gantt (index.js) 162.55KB 39.57KB
plugin-grid (index.js) 186.61KB 49.34KB
plugin-kanban (index.js) 48.30KB 13.28KB
plugin-list (index.js) 105.12KB 25.48KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
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.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
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 (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) 2.71KB 1.34KB
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

冲突只有一处:scripts/__tests__/doc-version-claims.test.ts。PR #3726(fbf7d6d)
在同一文件上清偿了 #3708/#3709/#3710 的 8 条失真,KNOWN_CLAIMS 27 → 21、stale
9 → 1(刻意留下的那条就是 plugin-report,修法在清单侧,归本单)。

三段冲突按并集语义在 #3726 之后的新形态上重写,而不是把本分支的旧文本贴回去:

- 条目区(第三段):两侧各自删掉了自己那条 stale——main 删的是 layout(#3710
  已把 README 的 `>= 18.0.0` 收窄成清单拼写),本分支删的是 plugin-report。
  删除的并集就是整块去掉。layout 那条必须删:它指的宣称已不在树里,留着会让
  「no entry may outlive the claim it excuses」这条棘轮红。plugin-report 那条也
  必须删:本分支新增的 restatement 单行与它 keyOf() 完全相同,两条并存会撞上
  「KNOWN_CLAIMS has duplicate entries」。
- 两段散文:改以 main 的事实清单为底(谁清偿了哪几条),把计数按合并后文件的
  真实行重算。本分支原来写的「NINE → eight」在 #3726 之后本身已经过期。

计数逐行数出来,不靠推断:合并后 21 条(与 main ±0),restatement 12 → 13,
stale 1 → 0。逐行比对 main 与解析结果的行集合,唯一差异是
`packages/plugin-report/README.md :: stale` → `:: restatement`,没有任何文件被
整条丢掉——即 #3726 的 9 条清偿全部完好过桥。另外同步了两处非冲突但被本次翻转
写旧的注释:restatement 类「12 of 21」→「13 of 21」,PEER_18_19 头注的「10 个
README / 第十一个 plugin-report 仍是 stale」→ 11 个,并说明它是从相反方向
(改清单而非改散文)加入的。

清单侧重新核对(一行读):packages/plugin-report/package.json 的
peerDependencies 现为 react / react-dom 皆 `^18.0.0 || ^19.0.0`,README:24-25
逐字相同,故 restatement 的 why 文本成立。package.json 与 changeset 均干净合并。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt

Copy link
Copy Markdown
Collaborator Author

已合并 main 并补齐上文交代的验证缺口(commit 5b4aeca40)

origin/main 已推进到 4e93e40d7,本分支 git merge origin/main(未 rebase、未 force-push)。上文「测试」一节末尾那段“type-check 未跑绿”的交代现已作废 —— 缺口已补,见下。

一、冲突只有一处,按并集语义在 #3726 之后的新形态上重写

scripts/__tests__/doc-version-claims.test.ts。PR #3726(fbf7d6d01)在同一文件上清偿了 #3708/#3709/#3710 的 8 处失真:KNOWN_CLAIMS 27 → 21,stale 9 → 1(刻意留下的那条正是 plugin-report,修法在清单侧,归本单)。三段冲突逐段处置:

条目区 —— 两侧各自删掉了自己那条 stale:main 删的是 layout(#3710 已把 README 的 >= 18.0.0 收窄成清单拼写),本分支删的是 plugin-report。删除的并集 = 整块去掉,并非二者取一。两条都必须删,各有机械理由(下面第三节实测):layout 那条指的宣称已不在树里;plugin-report 那条与本分支新增的 restatement 单行 keyOf() 完全相同。

两段散文 —— 以 main 的事实清单为底(谁清偿了哪几条),计数按合并后文件的真实行重算。本分支原写的「NINE → eight」在 #3726 之后本身已经过期,没有贴回。

另同步两处非冲突、但被本次翻转写旧的注释:restatement 类「12 of 21」→「13 of 21」;PEER_18_19 头注的「10 个 README / 第十一个 plugin-report 仍是 stale」→ 11 个,并写明 plugin-report 是从相反方向(改清单而非改散文)加入的。

计数逐行数出来,不靠推断,并逐行比对 main 与解析结果的行集合:

合并后 KNOWN_CLAIMS:  21 条(与 main ±0)
kind 分布:            restatement 12 → 13,stale 1 → 0,anchored 1 / sample 5 / unanchored 2 不变
行集合差异(唯一):    packages/plugin-report/README.md :: stale  →  :: restatement
整条丢掉的文件:        无(即 #3726 的 9 条清偿全部完好过桥)

packages/plugin-report/package.json 与 changeset 均干净合并(git diff --stat HEAD 对这两个文件为空),清单侧一行复核:peerDependencies 现为 react / react-dom^18.0.0 || ^19.0.0,与 README.md:24-25 逐字相同 —— restatement 的 why 文本成立。

二、补齐的验证缺口:先 build 依赖,type-check 现为 exit=0

上文的 TS2307 诊断被证实是「worktree 里 workspace 依赖没 build」的既有状态,不是本改动引起:

$ pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-report^...' build
packages/plugin-grid build: ✓ built in 7.75s
packages/plugin-grid build: Done
→ 14 个包 build: Done,ELIFECYCLE / ERR_PNPM / error TS 命中数 0,exit=0
→ 上文点名缺失的 fields / components / react / plugin-grid,dist/index.d.ts 现均存在

$ pnpm --workspace-concurrency=2 --filter @object-ui/plugin-report type-check
> tsc --noEmit && tsc -p tsconfig.test.json
exit=0        # 两个 tsc 均无输出

三、其余验证(全部在合并后的树上重跑)

$ pnpm exec vitest run packages/plugin-report/ scripts/__tests__/doc-version-claims.test.ts --maxWorkers=2
 Test Files  7 passed (7)
      Tests  84 passed (84)

$ pnpm exec vitest run scripts/ --maxWorkers=2
 Test Files  20 passed (20)          # 19 → 20:main 新增 merge-queue-reporting.test.ts
      Tests  361 passed (361)        # 351 → 361

$ pnpm run type-check:scripts
exit=0

$ node scripts/check-control-bytes.mjs
✅ OK (scanned 3687 tracked text file(s); skipped 85 binary)

$ grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' 本 PR 三个文件
exit=1(零控制字节)

四、反向验证:三个方向先判后跑,其中一个如实报「不动」

上文说过 peer 范围不进代码路径、写不出红绿断言。但冲突解析这一半可以,故先写下预期方向再跑:

探针 预判 实测
A 恢复 layout 那条 stale(我删掉的 HEAD 一侧) 红,且应由「no entry may outlive the claim it excuses」点名 红,如预判:AssertionError: KNOWN_CLAIMS names version claims that are no longer in the tree: - packages/layout/README.md :: react >= 18.0.0`,1 failed / 5 passed
B 两条 plugin-report 并存(改用「并集=相加」) 红,且应由重复键断言点名 红,如预判:AssertionError: KNOWN_CLAIMS has duplicate entries: expected 21 to be 22
C 单把 kind 翻回 stale(清单仍是宽范围) 绿 —— 不动,因为没有任何断言读 .kind 绿,6 passed,如预判

C 这一格据实写明,不造红绿:grep 全文确认没有任何 expect 读取 .kind,该字段只受 ClaimKind 联合类型约束。这与本文件头注自己的说法一致 —— restatement 类命名的等价关系「由读清单复核,而不是本门禁」。所以 A/B 证明的是解析的删除那一半是必需的、不是顺手,而 kind 翻转本身是记账性的,由第一节那次一行清单复核背书。

worktree 按约定保留,待 PM 确认落地后再清。auto-merge 未由我重新武装。


Generated by Claude Code

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-BEAgjw06.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.66KB 3.13KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
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) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
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) 4.91KB 0.87KB
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) 480.72KB 105.64KB
core (index.js) 2.96KB 1.13KB
create-plugin (index.js) 9.08KB 2.92KB
data-objectstack (index.js) 137.51KB 35.11KB
fields (index.js) 230.90KB 56.84KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.53KB 10.71KB
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) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
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.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 61.04KB 17.31KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 115.50KB 29.96KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 232.79KB 57.42KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 112.10KB 27.10KB
plugin-gantt (index.js) 162.55KB 39.57KB
plugin-grid (index.js) 186.61KB 49.34KB
plugin-kanban (index.js) 48.30KB 13.28KB
plugin-list (index.js) 105.12KB 25.48KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
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.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
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 (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) 2.71KB 1.34KB
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

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

Projects

None yet

2 participants