rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
6.17k stars 943 forks source link

Incorrect consumer documentation (probably outdated) #647

Closed PSanJuanS closed 2 years ago

PSanJuanS commented 3 years ago

I think the consumer description in the starting docs is outdated. In https://riverpod.dev/docs/concepts/reading when explaining consumerwidget and consumer it uses WidgetRef instead of ScopeReader. So the examples use ref.watch(provider) instead of watch(provider) and that no longer works.

wujek-srujek commented 3 years ago

Actually WidgetRef.read etc. is the API in Riverpod 1.0.0-dev.x, and ScopeReader doesn't exist any more. You are probably using 0.14.x. But yeah, the documentation is in a poor state right now and unreliable (e.g. the page you linked uses WidgetRef.read but mentions context.read in the diagram, which doesn't exist in the 1.0.0 line any more either), same can be said about the inline documentation in code (e.g. it says that select can only be used for hooks or ProviderContainer.listen, which is no longer true either - it is now supported everywhere). I guess the author(s) want to polish and release the code first and then they will take care of the docs, we need to be patient.

PSanJuanS commented 3 years ago

Thank you for your answer. I know that in the current project state the code evolves faster than the docs can follow, I only wanted to note the inconsistency between code and docs in case the error was not acknowledged. And yes, I am using 0.14.x as it is the latest stable.

rrousselGit commented 2 years ago

Closing since this is expected.

The documentation is showing version 1.0.0-dev on purpose since that is the latest version. I prefer this over maintaining two versions for the documentation.