diff --git a/packages/riverpod/pubspec.yaml b/packages/riverpod/pubspec.yaml index aa0b421ab..c246419aa 100644 --- a/packages/riverpod/pubspec.yaml +++ b/packages/riverpod/pubspec.yaml @@ -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 diff --git a/packages/riverpod/pubspec_overrides.yaml b/packages/riverpod/pubspec_overrides.yaml index 607c9fadd..ae6e56d7d 100644 --- a/packages/riverpod/pubspec_overrides.yaml +++ b/packages/riverpod/pubspec_overrides.yaml @@ -1,3 +1,3 @@ dependency_overrides: # necessary for mockito - analyzer: ^6.7.0 + analyzer: ^7.0.0 diff --git a/packages/riverpod_analyzer_utils/CHANGELOG.md b/packages/riverpod_analyzer_utils/CHANGELOG.md index 233fb4432..b43a512d0 100644 --- a/packages/riverpod_analyzer_utils/CHANGELOG.md +++ b/packages/riverpod_analyzer_utils/CHANGELOG.md @@ -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) diff --git a/packages/riverpod_analyzer_utils/pubspec.yaml b/packages/riverpod_analyzer_utils/pubspec.yaml index c88856251..f7c80d8d1 100644 --- a/packages/riverpod_analyzer_utils/pubspec.yaml +++ b/packages/riverpod_analyzer_utils/pubspec.yaml @@ -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 diff --git a/packages/riverpod_analyzer_utils_tests/pubspec.yaml b/packages/riverpod_analyzer_utils_tests/pubspec.yaml index aae67e74c..f138cd07e 100644 --- a/packages/riverpod_analyzer_utils_tests/pubspec.yaml +++ b/packages/riverpod_analyzer_utils_tests/pubspec.yaml @@ -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 diff --git a/packages/riverpod_generator/CHANGELOG.md b/packages/riverpod_generator/CHANGELOG.md index 3442ecd8c..9f942e98f 100644 --- a/packages/riverpod_generator/CHANGELOG.md +++ b/packages/riverpod_generator/CHANGELOG.md @@ -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` diff --git a/packages/riverpod_generator/pubspec.yaml b/packages/riverpod_generator/pubspec.yaml index b1298ea90..e15049315 100644 --- a/packages/riverpod_generator/pubspec.yaml +++ b/packages/riverpod_generator/pubspec.yaml @@ -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 @@ -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 diff --git a/packages/riverpod_graph/lib/src/analyze.dart b/packages/riverpod_graph/lib/src/analyze.dart index 85ccd68b2..b65d298e7 100644 --- a/packages/riverpod_graph/lib/src/analyze.dart +++ b/packages/riverpod_graph/lib/src/analyze.dart @@ -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 ?? '', diff --git a/packages/riverpod_graph/pubspec.yaml b/packages/riverpod_graph/pubspec.yaml index 609a75006..228dac230 100644 --- a/packages/riverpod_graph/pubspec.yaml +++ b/packages/riverpod_graph/pubspec.yaml @@ -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 diff --git a/packages/riverpod_lint/CHANGELOG.md b/packages/riverpod_lint/CHANGELOG.md index 362ef3cd8..8d2cf1cfa 100644 --- a/packages/riverpod_lint/CHANGELOG.md +++ b/packages/riverpod_lint/CHANGELOG.md @@ -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) diff --git a/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart b/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart index 54ae9b287..93c81e4bc 100644 --- a/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart +++ b/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart @@ -288,10 +288,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor { } 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 = diff --git a/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart b/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart index fbe82f958..a0aaddc5e 100644 --- a/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart +++ b/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart @@ -333,10 +333,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor { } 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) { diff --git a/packages/riverpod_lint/lib/src/lints/missing_provider_scope.dart b/packages/riverpod_lint/lib/src/lints/missing_provider_scope.dart index 31ece5de2..09eefd6e6 100644 --- a/packages/riverpod_lint/lib/src/lints/missing_provider_scope.dart +++ b/packages/riverpod_lint/lib/src/lints/missing_provider_scope.dart @@ -64,7 +64,7 @@ class AddProviderScope extends DartFix { List 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( diff --git a/packages/riverpod_lint/lib/src/lints/provider_parameters.dart b/packages/riverpod_lint/lib/src/lints/provider_parameters.dart index bd40e6d43..431c12b34 100644 --- a/packages/riverpod_lint/lib/src/lints/provider_parameters.dart +++ b/packages/riverpod_lint/lib/src/lints/provider_parameters.dart @@ -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 == diff --git a/packages/riverpod_lint/pubspec.yaml b/packages/riverpod_lint/pubspec.yaml index c66c1675d..f0905305a 100644 --- a/packages/riverpod_lint/pubspec.yaml +++ b/packages/riverpod_lint/pubspec.yaml @@ -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 diff --git a/packages/riverpod_lint_flutter_test/pubspec_overrides.yaml b/packages/riverpod_lint_flutter_test/pubspec_overrides.yaml index 8afc23687..8aa9357fd 100644 --- a/packages/riverpod_lint_flutter_test/pubspec_overrides.yaml +++ b/packages/riverpod_lint_flutter_test/pubspec_overrides.yaml @@ -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 \ No newline at end of file diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/about_hooks.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/about_hooks.mdx index aab39806d..c8a2bd17c 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/about_hooks.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/concepts/about_hooks.mdx @@ -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)" 패턴을 대체하는 역할도 수행할 수 있는데,