perf(hooks): deep-import context and keep core clients off narrow graphs - #385
Open
cameronapak wants to merge 4 commits into
Open
perf(hooks): deep-import context and keep core clients off narrow graphs#385cameronapak wants to merge 4 commits into
cameronapak wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 421ecdf 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
force-pushed
the
cp/hooks-split
branch
from
September 9, 2026 16:50
4ed875d to
ce029a2
Compare
Stack 2/3 of #382. Hooks-only changes: deep imports of YouVersionContext, client-override fallback shape per hook, and query-key changes.
cameronapak
force-pushed
the
cp/hooks-split
branch
from
September 9, 2026 18:59
ce029a2 to
578d0a6
Compare
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
abharms
reviewed
Sep 10, 2026
Collaborator
Author
|
Ready for re-review @abharms! Thanks for the initial review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
YPE-5528. No public API change.
Bundle result
After a forced build,
hooks / useChapter onlymeasures 11.06 kB Brotli with React, React DOM, TanStack Query, and jsdom externalized. The 12.2 kB gate provides about 10% headroom.The tree-shaking check proves the narrow bundle excludes the Auth granted-permissions storage sentinel while the auth control bundle includes it.
Stack
#384 is merged. #382 remains based on this PR and should merge after it.
Verification
pnpm exec turbo build --forcepnpm lintpnpm typecheckpnpm testpnpm sizepnpm check:tree-shaking— Cursor, an AI agent sent on behalf of Cam
Greptile Summary
The PR narrows individual hook dependency graphs while preserving client overrides and the public package API.
YouVersionContextto avoid evaluating the context barrel and auth code for narrow hook imports.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported lazy-auth identity issue and missing changeset have both been fixed.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Consumer[Consumer imports one hook] --> Hook[Individual React hook] Hook --> Context[YouVersionContext module] Hook --> Override{Client override supplied?} Override -->|Yes| Client[Injected client method] Override -->|No| Function[Core API function] Context -. auth excluded from narrow graph .-> Bundle[Tree-shaken bundle] Client --> API[Platform API] Function --> APIReviews (6): Last reviewed commit: "fix(hooks): address narrow bundle review..." | Re-trigger Greptile