Skip to content

[talker_riverpod_logger] add support for Riverpod 3.0.0(-Dev) #360

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DmitrySboychakov
Copy link

@DmitrySboychakov DmitrySboychakov commented May 2, 2025

There is new Riverpod 3.0.0 release in near future, that contain breaking changes to the Provider Observers.
This PR request update package code to work with 3.0.0-Dev version that currently published (should work with release version once published as well)

Summary by Sourcery

Update talker_riverpod_logger package to support Riverpod 3.0.0-Dev with breaking changes to Provider Observers

New Features:

  • Add compatibility with Riverpod 3.0.0-Dev version

Enhancements:

  • Modify ProviderObserver method signatures to work with new Riverpod context-based observer pattern

Chores:

  • Update package dependencies to accept Riverpod 3.0.0-Dev version

Copy link

sourcery-ai bot commented May 2, 2025

Reviewer's Guide

This pull request updates the TalkerRiverpodObserver to align with the breaking changes introduced in the Riverpod 3.0.0 Provider Observer API. The observer methods now accept a ProviderObserverContext object instead of individual provider and container arguments, and the provider instance is accessed via this context.

File-Level Changes

Change Details Files
Adapt TalkerRiverpodObserver methods to Riverpod 3.0 ProviderObserverContext.
  • Modified didAddProvider, didUpdateProvider, didDisposeProvider, and providerDidFail method signatures to accept ProviderObserverContext.
  • Updated calls to super within observer methods.
  • Accessed provider instance via context.provider instead of the direct provider argument.
packages/talker_riverpod_logger/lib/talker_riverpod_logger_observer.dart
Update Riverpod dependency and imports for version 3.0.0.
  • Updated riverpod dependency constraint to >=3.0.0-Dev <4.0.0 in pubspec.yaml files.
  • Changed imports from package:riverpod/riverpod.dart to package:riverpod/misc.dart for observer-related types.
  • Added package:riverpod/legacy.dart import in test files.
packages/talker_riverpod_logger/pubspec.yaml
packages/talker_riverpod_logger/example/pubspec.yaml
packages/talker_riverpod_logger/lib/riverpod_logs.dart
packages/talker_riverpod_logger/lib/talker_riverpod_logger_settings.dart
packages/talker_riverpod_logger/test/logs_test.dart
packages/talker_riverpod_logger/test/observer_test.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @DmitrySboychakov - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Frezyx Frezyx added talker_riverpod_logger Related to talker_riverpod_logger package beta Early access and features under development labels May 21, 2025
@Frezyx
Copy link
Owner

Frezyx commented May 21, 2025

Hello @DmitrySboychakov !
Thank you for preparing this PR. I suggest to wait until riverpod v3 release before we will merge it

@Frezyx
Copy link
Owner

Frezyx commented May 21, 2025

And could you please help me resolve the merge conflicts, @DmitrySboychakov?

@DmitrySboychakov
Copy link
Author

@Frezyx sounds about right!
Let me update the PR once riverpod is released (and resolve conflicts as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Early access and features under development talker_riverpod_logger Related to talker_riverpod_logger package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants