Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/twenty-onions-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@youversion/platform-react-hooks': minor
'@youversion/platform-core': minor
'@youversion/platform-react-ui': minor
---

Deprecates hooks and providers that are not used by the UI package or any known consumers. These were inherited from a hackathon project and never adopted. These will be fully removed in the next major version bump.

Deprecated:
- `useInitData` — convenience wrapper over `useVersion`, `useBook`, `useChapter` that loses error granularity, drops `refetch`, and has zero consumers. Use the three hooks directly.
- `useChapterNavigation` — coupled to `ReaderProvider` which nobody uses. The UI package calls `getAdjacentChapter` from core directly.
- `ReaderProvider`, `ReaderContext`, `useReaderContext` — the UI package built its own `BibleReaderContext` instead. Zero consumers.
- `VerseSelectionProvider`, `VerseSelectionContext`, `useVerseSelection` — the UI package handles verse selection via props/callbacks. Zero consumers.
2 changes: 1 addition & 1 deletion greptile.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"rule": "Schema-first: All types defined in schemas/*.ts using Zod"
},
{
"scope": ["packages/**"],
"scope": ["packages/**", ".changeset/**"],
"rule": "Unified versioning: All packages must maintain exact same version - never version packages independently"
},
{
Expand Down
10 changes: 3 additions & 7 deletions packages/hooks/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @youversion/platform-react-hooks

## OVERVIEW
React integration layer providing data fetching hooks with 3 core providers: YouVersionProvider, YouVersionAuthProvider, and ReaderProvider.
React integration layer providing data fetching hooks with 2 core providers: YouVersionProvider and YouVersionAuthProvider.

**Depends on `@youversion/platform-core` for all API calls.** Hooks delegate to core clients; do not implement raw HTTP here.

Expand All @@ -15,12 +15,12 @@ React integration layer providing data fetching hooks with 3 core providers: You
- `utility/` - Helper functions (useDebounce, extractTextFromHTML, extractVersesFromHTML)

## PUBLIC API
- Data fetching hooks: useBook, useChapter, usePassage, useVersion, useVOTD, useVerse, useChapterNavigation, etc.
- Data fetching hooks: useBook, useChapter, usePassage, useVersion, useVOTD, useVerse, etc.
- YouVersionProvider - Core SDK configuration
- YouVersionAuthProvider - Authentication state
- ReaderProvider - Reading session context
- Utility functions exported from utility/index


## PROVIDERS

- **YouVersionProvider**
Expand All @@ -31,10 +31,6 @@ React integration layer providing data fetching hooks with 3 core providers: You
- Manages authentication state (userInfo, tokens, isLoading, error)
- Auth hooks like `useYVAuth` depend on this provider

- **ReaderProvider**
- Manages Bible reading session state (currentVersion, currentChapter, currentBook, currentVerse)
- Hooks like `useChapterNavigation` depend on this provider

## DOs / DON'Ts

✅ Do: Use `YouVersionProvider` for configuration and access that config in hooks
Expand Down
153 changes: 0 additions & 153 deletions packages/hooks/src/context/ReaderContext.test.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions packages/hooks/src/context/ReaderContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ type ReaderContextData = {
setVerse: (verse: BibleVerse | null) => void;
};

/**
* @deprecated No replacement needed. Remove usage. Will be removed in the next major version.
*/
export const ReaderContext = createContext<ReaderContextData | null>(null);

/**
* @deprecated No replacement needed. Remove usage. Will be removed in the next major version.
*/
export function useReaderContext(): ReaderContextData {
const context = useContext(ReaderContext);

Expand Down
Loading