chore(app): drop the preact scaffolding left by the native diff renderer - #1760
chore(app): drop the preact scaffolding left by the native diff renderer#1760chphch wants to merge 1 commit into
Conversation
c1dda88 replaced the Pierre-based diff renderer and dropped @pierre/diffs. Six things that existed only to serve it stayed: three patches/ scripts, their require() lines in scripts/postinstall.cjs, metro.config.js's preact single-instance resolveRequest hook, and happy-app's preact dependency. force-preact-cjs.cjs and the Metro hook both name @pierre/trees in their own comments as the reason two preact module instances existed at all. With it gone there is no second importer, so there is nothing left to pin. Dead three ways: zero @pierre/* in any manifest or in pnpm-lock.yaml; zero packages declaring preact as a resolved dependency (only happy-app declared it directly); zero installed packages importing preact -- the same search finds 45 files inside node_modules/preact itself, so that zero is real. They are coupled: metro.config.js calls require.resolve('preact') at module load, so dropping the dependency without the hook makes Metro throw before it bundles anything. pnpm-lock.yaml is hand-edited rather than regenerated -- `pnpm install --lockfile-only` re-resolves every caret range and would have carried six unrelated package upgrades into a cleanup. The 8 removed lines are all preact. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Proof — the app boots and renders diffs with the scaffolding goneThe reasonable worry about this PR is not whether it compiles — it is whether removing a Metro Captured locally: throwaway standalone Every path the removed scaffolding used to sit next to is visibly working:
Instrumented run, not just eyeballed:
No CI on this PR is green across all four checks ( |

The native diff renderer left its scaffolding behind
c1dda880replaced the Pierre-based diff renderer and dropped@pierre/diffsfrompackages/happy-app/package.json. Six things that existed only to serve it stayed:patches/expose-pierre-diffs-style.cjs./style.jsto@pierre/diffs'sexportsmappatches/fix-pierre-trees-preact-hooks.cjs@pierre/treesloadpreact/hookseagerlypatches/force-preact-cjs.cjspreactsubpath to the CJS bundlerequire(...)lines inscripts/postinstall.cjsresolveRequesthook inpackages/happy-app/metro.config.jspreact/preact/hooksto one instance"preact": "^10.29.1"inpackages/happy-app/package.jsonThe last three are all one problem.
force-preact-cjs.cjsand the Metro hook say so in their own comments — both name@pierre/treesas the reason two preact module instances existed at all:With
@pierre/treesgone there is no second importer, so there are no two instances, so there is nothing to pin.Is it actually dead? Three independent checks
@pierre/*in any manifest or inpnpm-lock.yamlpreactas a resolved dependency inpnpm-lock.yamlpackages/happy-appdeclares it directlyimport/requirepreactThe third check was run over the whole installed tree and is easy to get a false zero from, so the same command was pointed at
node_modules/preactitself first: it returns 45 files. The harness works; the 0 is a real 0.@preact/signals-coreis unrelated — it is a@lexical/extensiondependency and is untouched.The pieces are coupled
metro.config.jscallsrequire.resolve('preact')at module load. Dropping the dependency without dropping that hook makes Metro throw before it bundles anything, so these land together or not at all.Proof
Every check below ran on this branch, in a clean worktree branched from
main.pnpm install --frozen-lockfilepnpm-lock.yamlbyte-identical (same SHA-256 before and after)ERR_PNPM_BROKEN_LOCKFILE— so the check above can actually fail, and passing it means somethingpostinstallafter removing the threerequire()linestsc --noEmit(happy-app)vitest run(happy-app)expo exportviabundle-webapp.cjs)resolveRequesthook would breakpnpm-lock.yamlis hand-edited, not regenerated.pnpm install --lockfile-onlyre-resolves every caret range against the registry, so a one-line dependency removal came back as a 190-line diff that also bumped@anthropic-ai/claude-agent-sdk0.3.179→0.3.246,marked18.0.2→18.0.5 and four others. Deleting only the three blockspreactowns — the importer'sspecifier:/version:pair, itspackages:entry, itssnapshots:entry — gives 8 deleted lines and nothing else.Scope note
Pure deletion: 181 lines removed, 0 added, across 7 files. The
Pierrementions that remain are unrelated —packages/codium's "Pierre Dark"/"Pierre Light" theme presets, and two comments inCodeEditor.web.tsxrecording where its colours came from.@preact/signals-coreis also unrelated; it is a@lexical/extensiondependency and is untouched.