Skip to content
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

fix(deps): update dependency dev.zacsweers.moshix:moshi-metadata-reflect to v0.20.0 #89

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 13, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
dev.zacsweers.moshix:moshi-metadata-reflect 0.19.0 -> 0.20.0 age adoption passing confidence

Release Notes

ZacSweers/MoshiX

v0.20.0

Compare Source

2022-12-04

New: @FallbackJsonAdapter

moshi-sealed now supports a new @FallbackJsonAdapter. This is a proxy to Moshi's PolymorphicJsonAdapter.withFallbackJsonAdapter(). This allows you to specify a custom JsonAdapter to handle cases of unrecognized type labels in decoding. It's advanced usage and not recommended for regular cases.

The specified JsonAdapter must have a public constructor with no parameters or a single Moshi parameter.

@​FallbackJsonAdapter(FrogFallbackJsonAdapter::class)
@​JsonClass(generateAdapter = true, generator = "sealed:type")
sealed class Frog {

  @​JsonClass(generateAdapter = true)
  @​TypeLabel("original", null)
  data class OriginalFrog(...)

  @​JsonClass(generateAdapter = true)
  @​TypeLabel("poisonous")
  data class PoisonousFrog(...)

  class FrogFallbackJsonAdapter(moshi: Moshi) : JsonAdapter<Frog>() {
    private val delegate = moshi.adapter<OriginalFrog>()
    override fun fromJson(reader: JsonReader): Frog? {
      // Default to original frog
      return delegate.fromJson(reader)
    }

    //...
  }
}
New: Experimental support for the new K2 compiler in moshi-ir.

Edit: this isn't usable in this release, don't try to use it!

Misc
  • Enhancement: Generate extra proguard rules for @NestedSealed types to prevent R8 from inlining the parent sealed type into the subtype in some cases.
  • Enhancement: Proguard generation in moshi-ir now uses Anvil's more optimized compiler util APIs.
  • Enhancement: Check and report more error cases in moshi-ir and moshi-sealed code gen.
  • Fix: moshi-ir now properly generates proguard rules for moshi-sealed types.
  • Fix: track @NestedSealed types as originating files in moshi-sealed KSP.
  • Enhancement: Substantially improved KSP and IR test coverage of error cases.
  • Update to Kotlin 1.7.22.
  • Update to KSP 1.7.22-1.0.8.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@Yash-Garg Yash-Garg merged commit 03a2676 into develop Dec 13, 2022
@Yash-Garg Yash-Garg deleted the renovate/dev.zacsweers.moshix branch December 13, 2022 18:09
@pr-triage pr-triage bot added the PR: merged label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant