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
44 changes: 44 additions & 0 deletions .changeset/remove-deprecated-apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
"@youversion/platform-core": major
"@youversion/platform-react-hooks": major
"@youversion/platform-react-ui": major
---

Remove deprecated APIs and tighten `BibleIndex` types (breaking changes).

This major release removes APIs that were previously marked `@deprecated`, plus one type-only tightening. Migration steps below.

**1. `YouVersionAuthButton` — removed the `redirectUrl` prop**

Set the OAuth callback URL once on the provider instead. The per-call `signIn({ redirectUrl })` escape hatch in `useYVAuth` is unchanged.

```diff
- <YouVersionProvider appKey="...">
- <YouVersionAuthButton redirectUrl="https://myapp.com/callback" />
+ <YouVersionProvider appKey="..." authRedirectUrl="https://myapp.com/callback">
+ <YouVersionAuthButton />
</YouVersionProvider>
```

**2. `BibleWidgetView` — removed**

The deprecated alias is gone. Use `BibleCard` / `BibleCardProps` (same component, renamed).

```diff
- import { BibleWidgetView, type BibleWidgetViewProps } from '@youversion/platform-react-ui';
+ import { BibleCard, type BibleCardProps } from '@youversion/platform-react-ui';
```

**3. Unused hooks and contexts — removed**

These had zero consumers. Removed from `@youversion/platform-react-hooks`:

- `useInitData` — use `useVersion`, `useBook`, and `useChapter` directly.
- `useChapterNavigation` — use `getAdjacentChapter` from `@youversion/platform-core`.
- `useVerseSelection`, `VerseSelectionProvider`, `VerseSelectionContext` — no replacement; handle verse selection via your own props/callbacks.
- `ReaderProvider`, `ReaderContext`, `useReaderContext` — no replacement.
- `DEFAULT` (the `{ VERSION, BOOK, CHAPTER }` constant exported alongside `useInitData`) was removed with it. If you relied on it, inline the values or use `DEFAULT_LICENSE_FREE_BIBLE_VERSION` from `@youversion/platform-core` for the version.

**4. `BibleIndex` — `passage_id` is now required**

`passage_id` on `BibleIndexChapter` and `BibleIndexVerse` is no longer optional. The API has always returned it; the Zod schema now enforces this at runtime as well, so consumers who relied on the optional field in mock/fixture objects must add `passage_id` to any such literals. `BibleIndexBook.intro` remains optional.
20 changes: 4 additions & 16 deletions packages/core/src/schemas/bible-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ import { BookUsfmSchema, CanonSchema } from './book';
const BibleIndexVerseSchema = z.object({
/** Verse identifier */
id: z.string(),
/**
* Passage identifier (e.g., "GEN.1.1").
*
* The API always returns this, but it's typed as optional to avoid a breaking
* change for consumers who construct these objects (e.g. test fixtures/mocks).
* TODO(next-major): make this required.
*/
passage_id: z.string().optional(),
/** Passage identifier (e.g., "GEN.1.1"). */
passage_id: z.string(),
/** Verse title */
title: z.string(),
});
Expand All @@ -21,14 +15,8 @@ export type BibleIndexVerse = Readonly<z.infer<typeof BibleIndexVerseSchema>>;
const BibleIndexChapterSchema = z.object({
/** Chapter identifier */
id: z.string(),
/**
* Passage identifier (e.g., "GEN.1").
*
* The API always returns this, but it's typed as optional to avoid a breaking
* change for consumers who construct these objects (e.g. test fixtures/mocks).
* TODO(next-major): make this required.
*/
passage_id: z.string().optional(),
/** Passage identifier (e.g., "GEN.1"). */
passage_id: z.string(),
/** Chapter title */
title: z.string(),
/** Array of verses in this chapter */
Expand Down
33 changes: 0 additions & 33 deletions packages/hooks/src/context/ReaderContext.tsx

This file was deleted.

39 changes: 0 additions & 39 deletions packages/hooks/src/context/ReaderProvider.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions packages/hooks/src/context/VerseSelectionContext.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions packages/hooks/src/context/VerseSelectionProvider.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions packages/hooks/src/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
export * from './YouVersionContext';
export * from './YouVersionProvider';
export * from './ReaderContext';
export * from './ReaderProvider';
export * from './VerseSelectionProvider';
export * from './VerseSelectionContext';
3 changes: 0 additions & 3 deletions packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export * from './useFilteredVersions';
export * from './context';
export * from './utility';
export * from './useBibleClient';
export * from './useVerseSelection';
export * from './useChapterNavigation';
export * from './useInitData';
export * from './usePassage';
export * from './useVOTD';
export * from './useHighlights';
Expand Down
77 changes: 0 additions & 77 deletions packages/hooks/src/useChapterNavigation.ts

This file was deleted.

59 changes: 0 additions & 59 deletions packages/hooks/src/useInitData.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/hooks/src/useVerseSelection.ts

This file was deleted.

Loading
Loading