Upgrade firebase-dataconnect version to 16.0.0-beta03 (was 16.0.0-beta02) #2539
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.
This PR upgrades the
firebase-dataconnect
dependency to version to16.0.0-beta03
(https://firebase.google.com/support/release-notes/android#data-connect_v16-0-0-beta03) from16.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 newcom.google.firebase.dataconnect.LocalDate
class instead ofjava.util.Date
. This new class has functions to convert it tojava.time.LocalDate
andkotlinx.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 aminSdkVersion
less than 26. The options to usejava.time.LocalDate
in such an application are:com.google.firebase.dataconnect.LocalDate
, without converting it tojava.time.LocalDate
.java.time
package inside aif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
block.java.time.LocalDate
class available all the way back to API 21 (theminSdkVersion
defined in thefirebase-dataconnect
module).Also note that using
kotlinx.datetime.LocalDate
requires your application to take a dependency on the "kotlinx-datetime" library by addingimplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
to thedependencies
section of your "app" module'sbuild.gradle
orbuild.gradle.kts
. In addition, thekotlinx-datetime
library usesjava.time
under the hood, so has the same restrictions and requires the same mitigation strategies mentioned above.