Repository navigation
Commit 04ca403
perf(app-shell): the form list's words load with the Studio list, not at boot (#38682)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ844kETyNGBBt9atKc1Snfzd)_
Part of #37444
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:看不到界面变化。打开 Console 的每一页时,首屏不再提前下载 Studio 的翻译包(约 82
KiB);表单列表的「开/关」文字在打开 Studio 列表时才加载。
- 为什么做:#38484 之后,表单列表的列定义在启动时就静态引入了 Studio 翻译模块,把 #38429
已经挪出首屏的翻译包又带了回来(#37444 的固定对照测量发现,评论 7264938326)。
- 效果:首屏少下载 82 KiB;但复测对象列表 LCP 只快 15 ms(p 0.54,误差内),仍比 2500 ms 超约 68
ms。所以本 PR 修掉回退,不关卡;列表剩下的差距在渲染 CPU,归 #37575。
- 出错会怎样:最坏是表单列表「开/关」一栏首次显示时晚一帧;可直接撤回。
- 要你做的:无。发布冻结期保持 draft。
## What changes
-
`ui/packages/app-shell/src/views/studio-design/publicForm/formListColumns.tsx`
no longer imports `../../metadata-admin/i18n.js` statically. The form
list's On cell loads the designer string table with `React.lazy` on
first draw; the Studio list has already loaded that module by then, so
it resolves at once.
- `services/builtinComponents.tsx` still registers `FORM_LIST_COLUMNS`
at boot, but the boot closure no longer reaches the metadata-admin i18n
module, so the built Console's `index.html` no longer preloads
`i18n-ns-studio-en` (70.8 KiB) or the metadata-admin i18n chunk (10.3
KiB): 134 modulepreloads, list 229 → 225 scripts before LCP.
- Pin:
`ui/packages/app-shell/src/services/__tests__/builtinComponents.formListWordsOffBoot-37444.test.tsx`
— (1) the walk sees the edge it guards (ResourceListPage reaches the
designer table); (2) `builtinComponents.tsx` reaches no designer table
through static imports; (3) the On cell renders "On"/"Off" after the
lazy load.
- Changeset: patch, `@object-ui/app-shell`.
## Tests
Head `e1bbe0b8` (reworded to `394a0455` for the commit-trailer check;
identical tree):
- Under the lock: the new pin plus `studio-design/publicForm` and
`firstScreenStudioCatalogue-37444`: 4 files, 54/54 passed; `ui
scripts/__tests__/check-i18n-call-site-keys.test.ts`: 152/152 passed.
- Ablation (`scripts/ablation-replace.mjs`): a static `import { t } from
'../../metadata-admin/i18n.js'` put back into `formListColumns.tsx`
turns case 2 red (1 failed, 2 passed); restored, blob == HEAD.
- `pnpm --filter @object-ui/app-shell type-check`: exit 0. `pnpm
console:build`: exit 0; `index.html` has no `i18n-ns-studio` or
metadata-admin i18n chunk.
- Browser, branch production build:
`/_console/studio/~all/metadata/form` shows "On" for
`showcase_inquiry.contact` and `showcase_inquiry.feedback`.
## Measurement (production build, HTTP/2, Lighthouse desktop, ruling
conditions)
One session, arms branch / base `f5da514b` / control `1afd9c13`, 20 runs
per arm per page; control list 2535.1 ms, inside the pre-set band, so
scored; no block discarded.
| page | branch | base | branch − base |
|:--|--:|--:|--:|
| object list | 2568.4 | 2583.4 | −15.0 ms (p 0.54, 95% CI −60…+71) |
| record | 2446.9 | 2434.3 | +12.7 ms (p 0.81) |
The cut restores the bytes but has no measurable LCP effect; the
done-when stays unmet on the list. Readings and instrument: project
folder `card-37444/a-measure/recut/`; report comment 7266607998 on
#37444.
## Verification
- `dispatch-gates --commands`: 38 derived, 38 run, all exit 0 (`ui
scripts/` vitest re-run with `--maxWorkers=2` after an OOM kill while
measurement servers were up: 172 passed, 2 skipped). `--ran`: 0
NOT-MEASURED.
- `overlap-check.mjs`: clean against origin/main; `git merge-tree`
against origin/main at push: clean.
- CI check-runs: read on this PR.
Files to read first: `formListColumns.tsx` (the lazy On cell).
Two-minute check: open Studio → Forms list; the On column reads
"On"/"Off".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH
<!-- signed: repo:objectstack#2 · os-warren ·
session_01JQwxbamiNxp7695qyaEYsH -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1d959b0 commit 04ca403
3 files changed
Lines changed: 135 additions & 3 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- services/__tests__
- views/studio-design/publicForm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
19 | | - | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
39 | 55 | | |
40 | | - | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
45 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
| |||
0 commit comments