Skip to content

chore: Upgrade Kotlin side to match YouVersion Kotlin SDK 1.0.1#41

Open
sidorchukandrew wants to merge 6 commits intomainfrom
as/new-kotlin-version
Open

chore: Upgrade Kotlin side to match YouVersion Kotlin SDK 1.0.1#41
sidorchukandrew wants to merge 6 commits intomainfrom
as/new-kotlin-version

Conversation

@sidorchukandrew
Copy link
Copy Markdown
Collaborator

@sidorchukandrew sidorchukandrew commented Mar 17, 2026

Description

This PR does 2 things:

  1. It updates the YouVersion Kotlin SDK to 1.0.1 and fixes any changes because of that
  2. It fixes any changes required due to the Expo 55 upgrade

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation update
  • refactor: Code refactoring (no functional changes)
  • perf: Performance improvement
  • test: Test additions or updates
  • build: Build system or dependency changes
  • ci: CI configuration changes
  • chore: Other changes (maintenance, etc.)

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • All commit messages follow conventional commits format
  • I have updated the appropriate section in documentation (if needed)

Open with Devin

@sidorchukandrew sidorchukandrew marked this pull request as draft March 17, 2026 11:45
@sidorchukandrew sidorchukandrew marked this pull request as ready for review March 19, 2026 15:14
@sidorchukandrew sidorchukandrew self-assigned this Mar 19, 2026
Copy link
Copy Markdown
Collaborator

@cameronapak cameronapak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

@cameronapak
Copy link
Copy Markdown
Collaborator

@greptileai, can you please review this PR?

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 20, 2026

Greptile Summary

This PR upgrades the YouVersion Kotlin SDK from 0.6.0 to 1.0.1 and adapts the React Native wrapper layer to Expo 55's updated Compose view API. The changes are well-scoped and the adaptations follow the new SDK contracts correctly.

Key changes:

  • Bumps all three YouVersion platform dependencies (platform-core, platform-ui, platform-reader) to 1.0.1 in build.gradle.
  • Adapts API calls to the SDK's new paginated response shape: versions() and languages() now use do-while loops to fetch all pages before returning, preserving the existing "return all results" contract.
  • Migrates chapter() from the deprecated BibleVersionRepository to the new YouVersionApi.bible.passage() API.
  • Updates all Compose view Content signatures from Content(modifier: Modifier) to ComposableScope.Content(), as required by Expo 55.
  • Replaces AutoSizingComposable (removed in SDK 1.0.1) with direct rendering in ComposableScope.
  • Adds AndroidHost from @expo/ui/jetpack-compose to BibleReaderView and SignInWithYouVersionButton so they use the correct host wrapper on Android.
  • Adds kotlinVersion: "2.3.0" to the example app's Android plugin config for Expo 55 compatibility.
  • Widens several LanguageRecord fields to nullable to match the updated Language model in SDK 1.0.1.

Minor items to clean up:

  • import android.content.Context in YVPBibleApi.kt is now unused and should be removed.
  • The unbounded pagination loops in YVPBibleApi and YVPLanguagesApi have no safety guard against a misbehaving nextPageToken; a comment or max-pages check would improve resilience.

Confidence Score: 4/5

  • Safe to merge after removing the leftover unused Context import; all core SDK and Expo 55 adaptations are correct.
  • The SDK and Expo 55 adaptations are accurate and complete. Prior review concerns have been addressed (domain imports removed, AutoSizingComposable replaced). The only remaining items are a stale import android.content.Context and a lack of a safety guard on the new pagination loops — both are minor cleanup items that don't affect correctness for typical usage.
  • android/src/main/java/com/youversion/reactnativesdk/api/YVPBibleApi.kt — stale Context import and unbounded pagination loop.

Important Files Changed

Filename Overview
android/src/main/java/com/youversion/reactnativesdk/api/YVPBibleApi.kt Migrated versions() to paginated fetch-all loop and chapter() to the new YouVersionApi.bible.passage() API; stale import android.content.Context remains, and the unbounded do-while loop warrants a comment/guard.
android/src/main/java/com/youversion/reactnativesdk/api/YVPLanguagesApi.kt Same paginated fetch-all pattern as YVPBibleApi; same unbounded-loop concern applies.
android/src/main/java/com/youversion/reactnativesdk/views/YVPSignInWithYouVersionButton.kt Replaced AutoSizingComposable wrapper (removed in SDK 1.0.1) with direct rendering inside ComposableScope.Content(); imports and unused Modifier/Direction/EnumSet cleaned up.
src/components/BibleReaderView.tsx Adds AndroidHost from @expo/ui/jetpack-compose and selects the right host at runtime via Platform.OS, replacing the iOS-only Host.
src/components/SignInWithYouVersionButton.tsx Switches to PlatformHost selecting between iOS and Android hosts; matchContents simplified from object to boolean shorthand; fixedSize() SwiftUI modifier remains (acknowledged in prior review thread as deferred work).

Sequence Diagram

sequenceDiagram
    participant RN as React Native (JS)
    participant Module as RNYouVersionPlatformModule
    participant BibleApi as YVPBibleApi
    participant LangApi as YVPLanguagesApi
    participant SDK as YouVersionApi (SDK 1.0.1)

    RN->>Module: chapter(bibleReference)
    Module->>BibleApi: chapter(bibleReference)
    BibleApi->>SDK: bible.passage(versionId, passageId)
    SDK-->>BibleApi: PassageResponse { content }
    BibleApi-->>Module: response.content (String)
    Module-->>RN: String

    RN->>Module: versions(languageTag)
    Module->>BibleApi: versions(languageTag)
    loop Paginate until nextPageToken == null
        BibleApi->>SDK: bible.versions(languageTag, pageToken)
        SDK-->>BibleApi: PagedResponse { data, nextPageToken }
    end
    BibleApi-->>Module: List<BibleVersionRecord>
    Module-->>RN: List

    RN->>Module: languages(country)
    Module->>LangApi: languages(country)
    loop Paginate until nextPageToken == null
        LangApi->>SDK: languages.languages(country, pageToken)
        SDK-->>LangApi: PagedResponse { data, nextPageToken }
    end
    LangApi-->>Module: List<LanguageRecord>
    Module-->>RN: List
Loading

Reviews (3): Last reviewed commit: "chore: clean up unused imports and argum..." | Re-trigger Greptile

Base automatically changed from as/expo-55-upgrade to main March 24, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants