Conversation
The web build emitted every WASM asset referenced by library code before tree-shaking, so the Office lean pptx engine, both preflight modules and the metafile SVG engine shipped although no output file can load them. A build plugin now removes hashed assets that no emitted file names. Linux builds link glibc and the npm launcher already refuses musl hosts, so staging fff's musl binary next to the gnu one only added weight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@betteroffice/fonts-cjk lists every CJK face both as one whole file and as progressive slices, about 27 MB each. The Office previews load faces whole through loadBundledFontBytes and never build a sliced provider, so the slices were never fetched but still shipped in every server update archive. Drop the slice entries from the package's URL map so Vite stops emitting them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This trims unused build assets, duplicate CJK font slices, and musl binaries from release archives while retaining the existing loading paths. The changes introduce no product-default change or persistent-data operation. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The automated pipeline stopped on this pull request and will not merge it: the capture step could not show the problem on the base commit, so there is nothing to prove fixed. Built web with vp run --filter @t3tools/web build; built server with node apps/server/scripts/cli.ts build-exe and build; packaged with node scripts/build-cli-archive.ts --platform linux --arch x64 --version 0.1.13. Measured archive bytes and SHA-256, seven alternating tar -xzf runs per side, and executable version. Started each extracted t3 serve with isolated fresh state and requested / plus entry assets. Base archive: 217265385 bytes; head: 178832824 bytes (38432561 bytes / 17.7% smaller). Extraction base median 2.742923 s, range 2.511991–3.212316; head median 2.467109 s, range 2.286416–2.789673. Median improvement 0.275814 s is smaller than base spread 0.700325 s and head spread 0.503257 s. Both CLIs printed t3 v0.1.13; both servers returned HTTP 200 for HTML and entry assets. The reported update download was not driven. It stays open for a person to finish or close. |
Dismissing prior approval to re-evaluate 9be338f
Every server update downloads the whole Linux archive, and it had grown to about 218 MB. Close to 40 MB of that was files nothing in T3 Code can load. This change stops shipping them, which brings the archive down to about 179 MB (18% smaller) and changes nothing the app does.
wholeCjkFontsOnlyPlugininapps/web/vite.config.ts(added for the main build and for worker builds):@betteroffice/fonts-cjklists each Noto CJK face twice, as a whole.otf.zstand as about 130 progressive slices, roughly 27 MB each way. The Office previews only ever load whole faces throughloadBundledFontBytes, so the plugin removes the slice entries from the package's URL map and Vite stops emitting them.dropUnreferencedAssetsPlugin: Vite emits every WASM file that library code mentions, even after tree-shaking has removed the code that uses it. That shipped the Office lean pptx engine, the pptx and xlsx preflight modules and the metafile SVG engine. The plugin deletes hashed assets whose names appear in no emitted file. Unhashed assets such as the PDF.js decoders are left alone because they are looked up by name.resolveFffNativeDependenciesstages only@ff-labs/fff-bin-linux-*-gnu. Linux builds link glibc and the npm launcher already refuses musl hosts, so the musl binary could never load.Fixes #46386
Reproduction on main
Commit origin/main 18757df. The server update path (apps/server/src/cloud/pinnedRuntime.ts, downloadArchive -> fetchNamedReleaseAsset) fetches the whole -linux-x64.tar.gz release asset, checks its SHA-256 against SHA256SUMS, then extracts it. There is no delta or partial path. I did not drive a real server update. I measured the artifacts that path downloads. (1) Sizes: I listed every linux-x64.tar.gz asset across 376 releases through the GitHub REST releases API. They were 64 MB through 20260921.2071, 72 MB on 0926, 86-88 MB on 1004, 93-94 MB on 1012-1024, 122 MB on 20261027.3748, 147-149 MB on 1106-1111, 182-187 MB on 1114-1126 (v0.1.10 and v0.1.13 stable are 182 and 185 MB), and 217 MB on 20261129.5438 through 20261130.5508. This matches the reporter's figures. (2) Download time: I fetched each archive 5 times with curl from github.com/pingdotgg/t3code/releases/download on this VM. 5508 (217,734,024 B): 0.760, 0.603, 0.582, 0.591, 0.552 s. Median 0.591 s, spread 0.55-0.76. 2071 (64,406,229 B): 2.80 (cold), 0.235, 0.283, 0.247, 0.265 s. Median 0.265 s. Throughput is about 370 MB/s on this VM, so the time is set by size alone. At the reporter's 7-12 MB/s, 218 MB takes 18-31 s and 64 MB takes 5-9 s, which matches their 31.7 s download_archive span against 1.2 s for install_archive. (3) Contents: I extracted both archives. Unpacked, 2071 is 206 MB (t3 binary 155, client 35, node_modules 17). 5508 is 517 MB (t3 167, client 192, node_modules 158). In 5508's client/assets: .wasm 63 MB raw (docx_edit_bg 23.2 MB, docx_parse_bg 9.8 MB, pptx_wasm 6.9 MB and pptx_wasm_lean 6.4 MB, xlsx_wasm 6.7 MB and xlsx_wasm_lean 5.8 MB). .zst 62 MB (Noto CJK otf.zst: SerifSC 8.7, SansSC 6.4, SansTC 4.5, JP 3.6, KR 3.4). heic-to ships twice (two 3.0 MB chunks with different hashes). Device .glb models about 12 MB. In node_modules: @transcribe-cpp 64 MB (linux-x64-cpu-vulkan/libggml-vulkan.so alone is 44 MB), @cursor sdk 38 MB, and @FF-Labs 22 MB with both fff-bin-linux-x64-gnu and fff-bin-linux-x64-musl. Both full and lean pptx/xlsx WASM are referenced: lean from spreadsheet.worker, full from the spreadsheet and presentation workers.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp buildin apps/web: succeeds. Emitted CJK slice files went from 648 to 0, the five whole.otf.zstfaces remain, and the fonts-cjk URL map in the built chunk lists only those fivevp test run --project browser src/components/files/office/fonts.browser.test.ts src/components/files/office/slide-fonts.browser.test.ts src/components/files/office/word-document.browser.test.ts: 8 passed (includes loading Noto Sans JP whole for Yu Gothic, MS Gothic and the Japanese fallback)vp test run scripts/build-desktop-artifact.test.ts scripts/build-cli-archive.test.ts: 60 passed (earlier pass, code unchanged since)vp run check:changed: format, lint, knip, typecheck (2 packages) and tests all passNot in this change
png: falsetoinitWasm; dropping it means rewriting minified library code, which is better done upstream in @betteroffice/xlsx.Who did the work
Run by the t3code factory in T3 Code.