Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rrousselGit/riverpod into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
rrousselGit committed Jan 8, 2025
2 parents 30b9eb8 + e364cea commit cde2f52
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/riverpod/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
test: ^1.0.0

dev_dependencies:
analyzer: ^6.7.0
analyzer: ^7.0.0
expect_error: ^1.0.0
mockito: ^5.0.0
path: ^1.9.0
Expand Down
2 changes: 1 addition & 1 deletion packages/riverpod/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependency_overrides:
# necessary for mockito
analyzer: ^6.7.0
analyzer: ^7.0.0
4 changes: 4 additions & 0 deletions packages/riverpod_analyzer_utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

- Added `GeneratorProviderDeclarationElement.isFamily`

## 0.5.9 - 2025-01-08

Support latest analyzer

## 0.5.8 - 2024-11-18

- Fixed analyzer to correctly detect nested RefInvocations when used as parameters (e.g., ref.watch(provider(ref.watch(...)))). This improves the accuracy of the analyzer's error detection for complex provider compositions. (thanks to @josh-burton)
Expand Down
2 changes: 1 addition & 1 deletion packages/riverpod_analyzer_utils/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
sdk: ">=3.0.0<4.0.0"

dependencies:
analyzer: ^6.7.0
analyzer: ^7.0.0
collection: ^1.16.0
crypto: ^3.0.2
custom_lint_core: ^0.7.0
Expand Down
2 changes: 1 addition & 1 deletion packages/riverpod_analyzer_utils_tests/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:
sdk: ">=3.0.0<4.0.0"

dependencies:
analyzer: ^6.7.0
analyzer: ^7.0.0
collection: ^1.16.0
freezed_annotation: ^2.2.0
meta: ^1.7.0
Expand Down
4 changes: 4 additions & 0 deletions packages/riverpod_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
- Added support for mutations. See also `@mutation` for further information.
- Added support for `@Riverpod(retry: ...)`

## 2.6.4 - 2025-01-08

Support latest analyzer

## 2.6.3 - 2024-11-18

- `riverpod_analyzer_utils` upgraded to `0.5.8`
Expand Down
4 changes: 2 additions & 2 deletions packages/riverpod_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
analyzer: ^6.7.0
analyzer: ^7.0.0
build: ^2.0.0
build_config: ^1.0.0
collection: ^1.15.0
Expand All @@ -20,7 +20,7 @@ dependencies:
path: ^1.8.0
riverpod_analyzer_utils: 1.0.0-dev.1
riverpod_annotation: 3.0.0-dev.3
source_gen: ^1.4.0
source_gen: ^2.0.0

dev_dependencies:
build_runner: ^2.1.7
Expand Down
5 changes: 1 addition & 4 deletions packages/riverpod_graph/lib/src/analyze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,7 @@ class _ProviderName {
/// Returns the name of the provider.
_ProviderName _displayNameForProvider(VariableElement provider) {
final providerName = provider.name;
final enclosingElementName = provider
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement
?.displayName;
final enclosingElementName = provider.enclosingElement3?.displayName;
return _ProviderName(
providerName: providerName,
enclosingElementName: enclosingElementName ?? '',
Expand Down
2 changes: 1 addition & 1 deletion packages/riverpod_graph/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:
sdk: ">=3.0.0<4.0.0"

dependencies:
analyzer: ^6.7.0
analyzer: ^7.0.0
args: ^2.4.0
collection: ^1.0.0
path: ^1.8.2
Expand Down
4 changes: 4 additions & 0 deletions packages/riverpod_lint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ Various lints had their severity changed:

- `riverpod` upgraded to `3.0.0-dev.0`

## 2.6.4 - 2025-01-08

Support latest analyzer

## 2.6.3 - 2024-11-18

- provider_dependencies now correctly detects nested ref invocations where a dependency is used as a parameter of another dependency (thanks to @josh-burton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor<void> {
}
final element = node.staticElement;
if (element is ExecutableElement &&
element
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement ==
widgetClassElement &&
element.enclosingElement3 == widgetClassElement &&
!elementsToMove.contains(element)) {
final offset = node.offset;
final qualifier =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor<void> {
}
final element = node.staticElement;
if (element is ExecutableElement &&
element
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement ==
widgetClassElement &&
element.enclosingElement3 == widgetClassElement &&
!elementsToMove.contains(element)) {
final parent = node.parent;
if (parent is PrefixedIdentifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AddProviderScope extends DartFix {
List<AnalysisError> others,
) {
context.registry.addMethodInvocation((node) {
// The method is not impact by this analysis error
// The method is not impacted by this analysis error
if (!node.sourceRange.intersects(analysisError.sourceRange)) return;

final changeBuilder = reporter.createChangeBuilder(
Expand Down
6 changes: 2 additions & 4 deletions packages/riverpod_lint/lib/src/lints/provider_parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ class ProviderParameters extends RiverpodLintRule {
final instantiatedObject = value.constructorName.staticElement
?.applyRedirectedConstructors();

final operatorEqual = instantiatedObject
// ignore: deprecated_member_use, necessary to support older versions of analyzer
?.enclosingElement
.recursiveGetMethod('==');
final operatorEqual =
instantiatedObject?.enclosingElement3.recursiveGetMethod('==');

if (operatorEqual == null) {
// Doing `provider(new Class())` is bad if the class does not override ==
Expand Down
4 changes: 2 additions & 2 deletions packages/riverpod_lint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ environment:
sdk: ">=3.0.0<4.0.0"

dependencies:
analyzer: ^6.7.0
analyzer_plugin: ^0.11.2
analyzer: ^7.0.0
analyzer_plugin: ^0.12.0
collection: ^1.16.0
custom_lint_builder: ^0.7.0
meta: ^1.7.0
Expand Down
3 changes: 3 additions & 0 deletions packages/riverpod_lint_flutter_test/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ dependency_overrides:
path: ../riverpod_generator
riverpod_lint:
path: ../riverpod_lint

# Fix flutter_test conflict for now
test_api: ^0.7.4
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Riverpod 때문에 훅(hooks)을 사용해서는 안됩니다. 오히려 훅(hoo
이상적으로 향후에 Flutter를 위해 특별히 설계된 훅(hooks)이 해결하는 문제에 대한 솔루션이 있을 것입니다.

Riverpod의 provider가 "전역(Global)" 애플리케이션 상태(State)를 위한 것이라면, 훅(Hooks)은 로컬 위젯 상태를 위한 것입니다.
훅(Hooks)dms 일반적으로 상태 저장형 UI 객체를 처리하는 데 사용됩니다,
훅(Hooks) 일반적으로 상태 저장형 UI 객체를 처리하는 데 사용됩니다,
[TextEditingController](https://api.flutter.dev/flutter/widgets/TextEditingController-class.html),
[AnimationController](https://api.flutter.dev/flutter/animation/AnimationController-class.html).
또한 "빌더(Builder)" 패턴을 대체하는 역할도 수행할 수 있는데,
Expand Down

0 comments on commit cde2f52

Please sign in to comment.