perf(core): split clients into tree-shakable modules and cut published bytes - #384
perf(core): split clients into tree-shakable modules and cut published bytes#384cameronapak wants to merge 7 commits into
Conversation
🦋 Changeset detectedLatest commit: 4a4d74e The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cameronapak
left a comment
There was a problem hiding this comment.
Review
No Jira. Spec is the Cam-selected review-comment fixes (Conductor re-review).
Summary
- Standards must-fix: 0
- Spec must-fix: 0
- Worst: none blocking (ZodError wrap covers
instanceof; classic helpers likeformat()/flatten()are still absent)
For Agents
CI: pass (Lint Commit Messages may still be settling)
Greptile: pass / partnered — old ZodError P1 addressed for instanceof; residual method-surface caveat noted below
Event: COMMENT (Cam-authored — no self-APPROVE)
HEAD: 4703196
Cam fixes verified:
uiinPACKAGE_DIRS— passpage_size="*"exactErrortext — passdev.mjsCSS watch →dist/styles— pass- changeset patch +
parsePublicMini wrap — pass
Resolve outdated Austin/Cursor threads for 1–3 when posting.
By Code Reviewer bot, sent on behalf of Cam.
cameronapak
left a comment
There was a problem hiding this comment.
Review
No Jira. Spec is the Cam override (drop parsePublic wrap; document Mini $ZodError).
Summary
- Standards must-fix: 0
- Spec must-fix: 0
- Worst: none blocking (changeset catch snippet should prefer
z.core.$ZodError)
For Agents
CI: pass
Greptile: pass
Event: COMMENT (Cam-authored — no self-APPROVE)
HEAD: 9ff6bbd
Verified: parsePublic gone; .parse(); changeset patch + Mini note; ui stamp; page_size Exact Error; CSS watch.
By Code Reviewer bot, sent on behalf of Cam.
…d bytes Stack 1/3 of #382. Core-only changes: module split into bible-*/languages-* files, zod-mini schemas, minified browser CSS, shared filtered paged-list helper, and the version-stamp check update.
… refine - Move client-module input schemas (version/book/chapter/verse ids, language id, organization id, highlight passage/color) into schemas/ so schemas stay the single source of truth; import schema files directly, not the barrel, to keep tree-shakable entries narrow - Restore the page_size="*" 1-3 fields refine on GetLanguagesOptionsSchema (dropped in the module split, replaced by an unreachable plain-Error check) - Dedupe BCP-47 regex and hex-color schema; type fetchFilteredCollection params - Document zod-mini $ZodError behavior note in the changeset; refresh core AGENTS.md STRUCTURE
… identity Keep the changeset as patch. Restore the UI version-stamp entry so UI prepublishOnly still works, throw the prior page_size="*" Error message, watch core CSS into dist/styles during pnpm dev, and wrap Mini $ZodError at the public client boundary so instanceof ZodError still matches.
Keep zod Mini as the public validation identity. Remove parsePublic and restore direct schema.parse(). Changeset stays patch and notes that schema failures throw $ZodError, not classic ZodError. page_size="*", UI stamp, and CSS watch stay as-is.
9ff6bbd to
4a4d74e
Compare
Stack 1/3 — base of #382.
What
bible-*/languages-*modules so partners importing one symbol stop pulling the whole client graphfetchFilteredCollection)Why
Heart goal of the branch: smaller import size for partners, backwards compatible.
Verification
pnpm build --force,pnpm typecheck,pnpm test(432 core tests),pnpm check:tree-shakingall pass on this branch alone — with main's hooks and ui, which is the back-compat proofMerge first of the stack (then #385, then #382).
— Cursor, an AI agent sent on behalf of Cam
Greptile Summary
The PR splits core clients into narrower tree-shakable modules, migrates validation to Zod Mini, and changes generated package output to reduce published bytes.
dist/stylesartifacts and restores the public theme-token set.Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains from the previous review threads.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Consumer[Consumer import] --> Entry[Core package entry] Entry --> Api[ApiClient module] Entry --> Bible[Bible facade] Entry --> Languages[Languages facade] Bible --> Chapter[bible-chapter] Bible --> Reads[bible-reads] Bible --> Versions[bible-versions] Bible --> Passage[bible-passage] Languages --> Language[languages-language] Languages --> List[languages-list] Versions --> Filter[Shared filtered collection] List --> Filter Build[Core build] --> JS[Tree-shakable JS entries] Build --> CSS[Minified dist/styles] Build --> Types[TypeScript declarations]Reviews (7): Last reviewed commit: "fix(core): drop ZodError wrap and docume..." | Re-trigger Greptile
Context used (4)