Skip to content

Upgrade firebase-dataconnect version to 16.0.0-beta03 (was 16.0.0-beta02) #2539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Nov 15, 2024

This PR upgrades the firebase-dataconnect dependency to version to 16.0.0-beta03 (https://firebase.google.com/support/release-notes/android#data-connect_v16-0-0-beta03) from 16.0.0-beta02.

This upgrade is a breaking change and requires Data Connect toolkit version 1.7.0 or later, which is available in firebase-tools version 13.25.0 (https://firebase.google.com/support/release-notes/cli#version_13250_-_november_12_2024). The breaking change is that the code generation for Date GraphQL fields and variables uses the new com.google.firebase.dataconnect.LocalDate class instead of java.util.Date. This new class has functions to convert it to java.time.LocalDate and kotlinx.datetime.LocalDate.

Since java.time.LocalDate was added to the Android standard library in API 26, special case must be taken if your application's version has a minSdkVersion less than 26. The options to use java.time.LocalDate in such an application are:

  1. Just use com.google.firebase.dataconnect.LocalDate, without converting it to java.time.LocalDate.
  2. Put code that uses the java.time package inside a if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) block.
  3. Enable desugaring (https://developer.android.com/studio/write/java8-support) to make the java.time.LocalDate class available all the way back to API 21 (the minSdkVersion defined in the firebase-dataconnect module).

Also note that using kotlinx.datetime.LocalDate requires your application to take a dependency on the "kotlinx-datetime" library by adding implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1") to the dependencies section of your "app" module's build.gradle or build.gradle.kts. In addition, the kotlinx-datetime library uses java.time under the hood, so has the same restrictions and requires the same mitigation strategies mentioned above.

@dconeybe dconeybe self-assigned this Nov 15, 2024
@dconeybe dconeybe requested a review from thatfiredev November 15, 2024 20:05
@dconeybe dconeybe requested a review from thatfiredev November 18, 2024 20:58
@dconeybe dconeybe changed the title Upgrade firebase-dataconnect version to 16.0.0-beta03 (was 16.0.0-beta03) Upgrade firebase-dataconnect version to 16.0.0-beta03 (was 16.0.0-beta02) Nov 19, 2024
Copy link
Member

@thatfiredev thatfiredev left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @dconeybe !

@thatfiredev thatfiredev merged commit 04fe0ce into master Nov 19, 2024
6 checks passed
@dconeybe dconeybe deleted the dconeybe/beta03 branch November 19, 2024 18:04
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