Skip to content

Deprecate all enum utilities #573

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 7 commits into
base: main
Choose a base branch
from

Conversation

tilucasoli
Copy link
Collaborator

@tilucasoli tilucasoli commented Mar 26, 2025

Related issue

#560

Description

Following the issue we deprecate all EnumUtilities

Changes

  • Add to mix_generator always add a deprecated annotation over a generated utility

Review Checklist

  • Testing: Have you tested your changes, including unit tests and integration tests for affected code?
  • Breaking Changes: Does this change introduce breaking changes affecting existing code or users?
  • Documentation Updates: Are all relevant documentation files (e.g. README, API docs) updated to reflect the changes in this PR?
  • Website Updates: Is the website containing the updates you make on documentation?

Summary by CodeRabbit

  • Chores
    • Upgraded the runtime environment with Flutter now set to version 3.27.0 and Dart SDK constraints raised to ≥3.6.0.
    • Updated several dependencies to enhance overall performance and compatibility.
  • Refactor
    • Streamlined internal APIs by deprecating legacy methods in favor of a more consistent approach.
  • Tests
    • Transitioned to a Flutter-specific testing framework to bolster integration and reliability.

@tilucasoli tilucasoli requested a review from Copilot March 26, 2025 20:58
Copy link

vercel bot commented Mar 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
mix-docs ⬜️ Ignored (Inspect) Mar 26, 2025 8:58pm

Copy link

coderabbitai bot commented Mar 26, 2025

Walkthrough

The pull request standardizes version specifications and updates dependency constraints across various configuration and code files. Flutter’s version is upgraded from 3.19.0 to 3.27.0 and the Dart SDK minimum is raised from 3.3.0 to 3.6.0 in multiple pubspec files. Furthermore, several utility methods now include deprecation annotations advising the use of a common call method. Additional modifications refine error reporting in lint rules and adjust code generation utilities to reference updated element properties and formatting configurations.

Changes

File(s) Change Summary
.fvmrc, .github/workflows/test.yml, .vscode/settings.json, examples/.../pubspec.yaml, melos.yaml, packages/mix/.../pubspec.yaml, packages/mix_annotations/.../pubspec.yaml, packages/mix_generator/.../pubspec.yaml, packages/mix_lint/.../pubspec.yaml, packages/mix_lint_test/.../pubspec.yaml, packages/remix/demo/pubspec.yaml, packages/remix/.../pubspec.yaml Upgraded Flutter version to 3.27.0, updated Dart SDK constraints to ">=3.6.0 <4.0.0", and increased dependency versions across configurations.
packages/mix/.../enum_util.g.dart, packages/remix/.../attributes.g.dart, packages/mix_generator/.../utility_code_generator.dart Added deprecation annotations to multiple utility methods, signaling that the call method should be used instead.
packages/mix_generator/lib/mix_generator.dart, packages/mix_generator/.../field_metadata.dart, packages/mix_generator/.../base_generator.dart, packages/mix_generator/.../helpers.dart, packages/mix_generator/test/.../dart_type_utils_test.dart Revised code generation utilities by updating element access to use enclosingElement3, adding a formatOutput parameter to the PartBuilder, adjusting DartFormatter instantiation, and removing an obsolete formatting helper.
packages/mix_lint/lib/.../extract_attributes.dart, packages/mix_lint/lib/.../attributes_ordering.dart, packages/mix_lint/lib/.../avoid_defining_tokens_within_theme_data.dart, packages/mix_lint/lib/.../avoid_empty_variants.dart, packages/mix_lint/lib/.../avoid_variant_inside_context_variant.dart, packages/mix_lint/lib/.../max_number_of_attributes_per_style.dart, packages/mix_lint/lib/.../lint_rule_node_registry.dart Refactored control flow in lint rules by introducing explicit block statements and standardized error reporting calls (switching from reportErrorForOffset/Node to atOffset/atNode).
packages/mix_lint_test/.../attributes_ordering_test.dart, packages/mix_lint_test/.../golden.dart Updated test files to use Flutter’s testing framework by replacing package:test with package:flutter_test.

Sequence Diagram(s)

sequenceDiagram
    participant CodeNode as Code Node
    participant LintRule as Lint Checker
    participant Reporter as Error Reporter

    CodeNode->>LintRule: Evaluate code node
    LintRule-->>LintRule: Check node conditions
    alt Error Detected
        LintRule->>Reporter: Report error using atOffset/atNode
        Reporter-->>CodeNode: Return error details
    else Valid Node
        LintRule->>CodeNode: Continue processing
    end
Loading

Poem

I'm just a little rabbit in the code-filled glen,
Hopping through updates again and again.
Versions leap high from old to new,
Deprecations whisper "use call," it's true!
With braces and tests all set just right,
I nibble on changes through day and night.
🐇💻 Hip-hip hooray for a code delight!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the package environment and dependency versions while implementing the deprecation of enum utilities by ensuring a deprecated annotation is added in the generated utility.

  • Bump SDK/Flutter version requirements across multiple packages
  • Update dependency versions in packages/mix_generator and other package pubspec files
  • Update the GitHub workflow with a newer Flutter version

Reviewed Changes

Copilot reviewed 18 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/todo_list/pubspec.yaml Updated SDK and Flutter version ranges
melos.yaml Updated environment constraints in the bootstrap configuration
packages/mix_generator/pubspec.yaml Bumped SDK/Flutter requirements and updated dependency versions
.github/workflows/test.yml Updated Flutter version used in CI tests
packages/mix/example/pubspec.yaml Updated SDK version range
packages/mix/pubspec.yaml Updated SDK/Flutter version ranges
packages/mix_annotations/pubspec.yaml Updated SDK version range
Files not reviewed (13)
  • .fvmrc: Language not supported
  • .vscode/settings.json: Language not supported
  • packages/mix/lib/src/attributes/enum/enum_util.g.dart: Language not supported
  • packages/mix/lib/src/attributes/scalars/scalar_util.g.dart: Language not supported
  • packages/mix_generator/lib/mix_generator.dart: Language not supported
  • packages/mix_generator/lib/src/core/metadata/field_metadata.dart: Language not supported
  • packages/mix_generator/lib/src/core/utils/base_generator.dart: Language not supported
  • packages/mix_generator/lib/src/core/utils/helpers.dart: Language not supported
  • packages/mix_generator/lib/src/core/utils/utility_code_generator.dart: Language not supported
  • packages/mix_generator/test/src/core/utils/dart_type_utils_test.dart: Language not supported
  • packages/mix_lint/lib/src/assists/extract_attributes.dart: Language not supported
  • packages/mix_lint/lib/src/lints/attributes_ordering.dart: Language not supported
  • packages/mix_lint/lib/src/lints/avoid_defining_tokens_within_theme_data.dart: Language not supported
Comments suppressed due to low confidence (1)

packages/mix_generator/pubspec.yaml:10

  • Consider adding or updating tests to verify that the generated enum utilities are being deprecated as intended by including the deprecated annotation.
dependencies:

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/mix_lint/lib/src/assists/extract_attributes.dart (1)

121-124: Improved code block structure with braces.

Added curly braces around the return statement in the conditional block, improving code readability and following best practices for control flow statements. This makes the code more maintainable and less prone to errors if additional statements are added later.

Consider applying this style improvement consistently throughout the codebase for all single-line conditionals.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1220c3 and 7cb6c99.

📒 Files selected for processing (31)
  • .fvmrc (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • .vscode/settings.json (1 hunks)
  • examples/todo_list/pubspec.yaml (2 hunks)
  • melos.yaml (1 hunks)
  • packages/mix/example/pubspec.yaml (1 hunks)
  • packages/mix/lib/src/attributes/enum/enum_util.g.dart (25 hunks)
  • packages/mix/lib/src/attributes/scalars/scalar_util.g.dart (1 hunks)
  • packages/mix/pubspec.yaml (1 hunks)
  • packages/mix_annotations/pubspec.yaml (1 hunks)
  • packages/mix_generator/lib/mix_generator.dart (1 hunks)
  • packages/mix_generator/lib/src/core/metadata/field_metadata.dart (1 hunks)
  • packages/mix_generator/lib/src/core/utils/base_generator.dart (1 hunks)
  • packages/mix_generator/lib/src/core/utils/helpers.dart (0 hunks)
  • packages/mix_generator/lib/src/core/utils/utility_code_generator.dart (2 hunks)
  • packages/mix_generator/pubspec.yaml (1 hunks)
  • packages/mix_generator/test/src/core/utils/dart_type_utils_test.dart (1 hunks)
  • packages/mix_lint/lib/src/assists/extract_attributes.dart (2 hunks)
  • packages/mix_lint/lib/src/lints/attributes_ordering.dart (3 hunks)
  • packages/mix_lint/lib/src/lints/avoid_defining_tokens_within_theme_data.dart (2 hunks)
  • packages/mix_lint/lib/src/lints/avoid_empty_variants.dart (1 hunks)
  • packages/mix_lint/lib/src/lints/avoid_variant_inside_context_variant.dart (2 hunks)
  • packages/mix_lint/lib/src/lints/max_number_of_attributes_per_style/max_number_of_attributes_per_style.dart (3 hunks)
  • packages/mix_lint/lib/src/utils/extensions/lint_rule_node_registry.dart (4 hunks)
  • packages/mix_lint/pubspec.yaml (1 hunks)
  • packages/mix_lint_test/pubspec.yaml (2 hunks)
  • packages/mix_lint_test/test/lints/attributes_ordering/fix/attributes_ordering_test.dart (1 hunks)
  • packages/mix_lint_test/test/utils/golden.dart (1 hunks)
  • packages/remix/demo/pubspec.yaml (1 hunks)
  • packages/remix/lib/src/components/textfield/attributes/attributes.g.dart (3 hunks)
  • packages/remix/pubspec.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/mix_generator/lib/src/core/utils/helpers.dart
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Min SDK
  • GitHub Check: Test
🔇 Additional comments (70)
packages/remix/pubspec.yaml (1)

9-9: SDK version constraint update is appropriate

The change increases the minimum Dart SDK version from 3.3.0 to 3.6.0, which aligns with similar updates across other packages in the workspace and matches the updated Flutter dependency requirements.

packages/mix/example/pubspec.yaml (1)

7-7: SDK version constraint update is consistent

The change increases the minimum Dart SDK version from 3.3.0 to 3.6.0, which ensures consistency with the main package and other components in the workspace.

packages/remix/demo/pubspec.yaml (1)

9-9: SDK version constraint update is consistent

The change increases the minimum Dart SDK version from 3.3.0 to 3.6.0, which aligns with similar updates across other packages in the workspace.

melos.yaml (1)

14-15: Version updates are appropriate

Both the Dart SDK (3.3.0 → 3.6.0) and Flutter (3.19.0 → 3.27.0) version constraints have been updated to ensure compatibility across the project. These updates are consistent with the changes in other configuration files.

packages/mix/lib/src/attributes/scalars/scalar_util.g.dart (1)

643-647: Parameter addition for Flutter SDK compatibility

The addition of the borderRadius parameter to the symmetric method with a default value of BorderRadius.zero ensures compatibility with the updated Flutter SDK (3.27.0) while maintaining backward compatibility.

.github/workflows/test.yml (1)

49-49: Flutter Version Update Verified
The flutter-version parameter in the test_min_sdk job is correctly updated to '3.27.0', ensuring that the CI tests run with the new Flutter version.

.vscode/settings.json (1)

7-7: Flutter SDK Path Updated
The "dart.flutterSdkPath" setting is updated to .fvm/versions/3.27.0, which aligns the local development configuration with the new Flutter version.

packages/mix_annotations/pubspec.yaml (1)

6-7: Dart SDK Constraint Updated
The environment SDK constraint is updated to "sdk: ">=3.6.0 <4.0.0", which is consistent with the project's move towards newer Dart versions. Double-check that all dependencies remain compatible with this change.

.fvmrc (1)

2-5: FVM Configuration Updated
Both the Flutter version ("flutter": "3.27.0") and the minimum compatibility ("mincompat": "3.27.0") are updated, ensuring consistency across development and CI environments.

packages/mix/pubspec.yaml (1)

7-8: Environment SDK Constraints Updated
The Dart SDK and Flutter version requirements are updated to "sdk: ">=3.6.0 <4.0.0" and "flutter": ">=3.27.0" respectively. This aligns the package with the project's overall upgrade strategy.

packages/mix_lint/lib/src/lints/avoid_empty_variants.dart (1)

28-31: Improved error reporting method with named parameters

The refactoring from using reportErrorForOffset to atOffset with named parameters makes the code more explicit and readable. This change aligns with modern API practices and the broader standardization of error reporting across the linting framework.

packages/mix_lint_test/test/lints/attributes_ordering/fix/attributes_ordering_test.dart (2)

1-1: Updated import to use Flutter-specific testing framework

Switching from package:test/test.dart to package:flutter_test/flutter_test.dart aligns with the project's update to newer Flutter SDK requirements. This provides access to Flutter-specific testing utilities.


7-24: Consider enabling the commented-out test code

The majority of this test file contains commented-out test code. Is there a plan to enable these tests in the future? If these tests are no longer needed, consider removing them to improve code clarity.

packages/mix_lint/lib/src/lints/avoid_variant_inside_context_variant.dart (2)

6-6: Good practice adding space between import groups

The addition of an empty line between different import groups improves code organization and readability.


52-56: Improved error reporting with named parameters

The refactoring from using reportErrorForOffset to atOffset with named parameters enhances code readability and makes the parameter roles explicit. This change is consistent with the standardization of error reporting across the linting framework.

packages/mix_lint/lib/src/lints/avoid_defining_tokens_within_theme_data.dart (3)

3-3: Good practice adding space after imports

The addition of an empty line after imports improves code organization and readability.


27-29: Improved conditional structure with explicit braces

The refactoring of the conditional check to include braces and an explicit return statement improves code readability and makes the control flow more obvious. This is a good practice, especially for complex conditions.


33-33: Simplified error reporting method

The change from a more verbose error reporting approach to the concise atNode method simplifies the code while maintaining the same functionality. This change is consistent with the standardization efforts across the linting framework.

packages/mix_generator/lib/src/core/metadata/field_metadata.dart (1)

305-305: Updated API usage for element access.

The change from enclosingElement to enclosingElement3 aligns with newer Dart SDK APIs. This update is part of adapting the codebase to the upgraded Dart SDK version (3.6.0+).

Also applies to: 308-308

packages/mix_generator/test/src/core/utils/dart_type_utils_test.dart (1)

366-366: Updated test to use newer API.

Updated from enclosingElement to enclosingElement3 to maintain consistency with the implementation code, ensuring tests work correctly with the updated Dart SDK.

packages/mix_lint_test/test/utils/golden.dart (1)

31-31:

✅ Verification successful

Switched from Dart test to Flutter test package.

Changed from package:test/test.dart to package:flutter_test/flutter_test.dart to leverage Flutter-specific testing utilities. This aligns with the updated Flutter dependency in the project.


🏁 Script executed:

#!/bin/bash
# Check if other test files have been similarly updated to use flutter_test
rg -l "import 'package:test/test.dart';" --type dart | wc -l
rg -l "import 'package:flutter_test/flutter_test.dart';" --type dart | wc -l

Length of output: 160


Verified Update for Flutter Testing Utilities in golden.dart

The changes in packages/mix_lint_test/test/utils/golden.dart correctly replace the outdated import from package:test/test.dart with package:flutter_test/flutter_test.dart, in line with the updated Flutter dependency.

  • Verification shows that the repository now contains 148 occurrences of the Flutter test import versus 17 files that still use the legacy Dart test import.
  • Please review the remaining 17 instances of package:test/test.dart to ensure they are intentional or update them for consistency if needed.
packages/mix_generator/lib/mix_generator.dart (2)

4-4: Added import for dart_style package.

This import is correctly added to support the DartFormatter used in the formatOutput parameter below.


10-16: Enhanced code generation with proper formatting.

The implementation now includes a formatOutput parameter that properly formats the generated code using DartFormatter with the specified language version. This change aligns with the upgrade of the dart_style dependency (from ^2.3.6 to ^3.0.1) and ensures consistently formatted output.

examples/todo_list/pubspec.yaml (2)

9-10: Increased minimum SDK and Flutter versions.

The SDK and Flutter version requirements have been increased:

  • Dart SDK: 3.3.0 → 3.6.0
  • Flutter: 3.19.0 → 3.27.0

This change represents a significant version jump that might introduce breaking changes.

Please ensure that all existing functionality works correctly with these new minimum version requirements, especially if any deprecated APIs are being used elsewhere in the codebase.


19-19: Updated custom_lint dependency.

The custom_lint package has been updated from ^0.6.4 to ^0.7.5, which may include API changes. This aligns with the changes to the error reporting methodology seen in other files.

packages/mix_generator/lib/src/core/utils/base_generator.dart (1)

14-17: Updated DartFormatter configuration.

The DartFormatter initialization now includes the languageVersion parameter set to latestShortStyleLanguageVersion. This change is necessary due to the upgrade of the dart_style package and ensures that all generated code will be formatted using the latest Dart language features.

packages/mix_lint/lib/src/lints/attributes_ordering.dart (3)

7-7: Added blank line after imports.

This improves code readability by clearly separating imports from the rest of the code.


32-34: Improved control flow structure.

The code now uses explicit braces and return statements instead of implicit returns, which improves readability and makes the code less error-prone for future modifications.


39-39: Updated error reporting API usage.

Changed from reportErrorForNode to atNode, which is consistent with the newer APIs provided by the updated custom_lint package (^0.7.5).

Also applies to: 49-49

packages/mix_lint/lib/src/lints/max_number_of_attributes_per_style/max_number_of_attributes_per_style.dart (2)

5-8: Import organization updated

The imports have been reorganized for better readability, with type-specific imports now placed at the top of the import list. This doesn't affect functionality but improves the file's organization.


41-41:

✅ Verification successful

API update for error reporting

Changed from reporter.reportErrorForNode(code, node) to reporter.atNode(node, code) to align with newer versions of the analyzer API. This maintains the same functionality while using the updated method signature.

Also applies to: 50-50


🏁 Script executed:

#!/bin/bash
# Check if the custom_lint_builder package has updated its API
# This will help confirm that the new method is part of the current API

rg -A 3 "class ErrorReporter" --type dart
rg "atNode" --type dart

Length of output: 670


API Update for Error Reporting Verified

The updated change from reporter.reportErrorForNode(code, node) to reporter.atNode(node, code) is correctly applied. A code search confirms its consistent usage across multiple files (including in the attributes_ordering.dart and avoid_defining_tokens_within_theme_data.dart lints), verifying that this updated method signature aligns with the current analyzer API.

  • Verified usage in:
    • packages/mix_lint/lib/src/lints/attributes_ordering.dart
    • packages/mix_lint/lib/src/lints/avoid_defining_tokens_within_theme_data.dart
    • packages/mix_lint/lib/src/lints/max_number_of_attributes_per_style/max_number_of_attributes_per_style.dart
packages/mix_generator/lib/src/core/utils/utility_code_generator.dart (2)

56-56: Enum utility methods marked as deprecated

Added a deprecation annotation to guide users toward using the call method instead of individual enum value methods. This aligns with the PR objective to deprecate all enum utilities as mentioned in the PR summary.


285-285:

✅ Verification successful

Updated element reference to enclosingElement3

Changed from enclosingElement to enclosingElement3 to adapt to the latest analyzer package API (v7.3.0). This ensures compatibility with the updated dependency.


🏁 Script executed:

#!/bin/bash
# Verify the existence of enclosingElement3 in the analyzer package API
rg -A 2 "enclosingElement3" --type dart

Length of output: 1299


Enclosing Element Update Verified

The switch from enclosingElement to enclosingElement3 has been confirmed across the codebase (e.g., in both utility_code_generator.dart and field_metadata.dart). The updated reference aligns with the analyzer package API (v7.3.0) as intended. No further changes are needed.

  • Verified usage in multiple files including packages/mix_generator/lib/src/core/utils/utility_code_generator.dart.
packages/mix_lint/pubspec.yaml (2)

7-7: Updated Dart SDK constraint

The minimum Dart SDK version has been increased from 3.3.0 to 3.6.0, which may require users to update their Dart SDK. This change appears to be part of a broader update across the codebase to support newer Dart features and APIs.


10-12: Updated analyzer dependencies

Dependencies have been updated to newer versions:

  • analyzer: ^6.0.0 → ^7.3.0 (major version bump)
  • analyzer_plugin: ^0.11.2 → ^0.13.0
  • custom_lint_builder: ^0.6.0 → ^0.7.5

These updates likely include breaking changes that required the code modifications seen in the other files (e.g., the change from reportErrorForNode to atNode).

packages/mix_generator/pubspec.yaml (2)

7-8: Updated Dart SDK and Flutter constraints

The minimum required versions have been increased:

  • Dart SDK: 3.3.0 → 3.6.0
  • Flutter: 3.19.0 → 3.27.0

These updates align with the changes in other package files and ensure consistency across the project.


13-15:

✅ Verification successful

Updated code generation dependencies

Major version bumps for several dependencies:

  • source_gen: ^1.5.0 → ^2.0.0
  • analyzer: ^6.1.0 → ^7.3.0
  • dart_style: ^2.3.6 → ^3.0.1

These updates are significant and could introduce breaking changes. The code adjustments in utility_code_generator.dart (e.g., enclosingElement3) are likely in response to these dependency updates.


🏁 Script executed:

#!/bin/bash
# Check if there are any breaking changes in the changelog of these packages
# that might need additional code changes
curl -s https://pub.dev/packages/analyzer/changelog | grep -A 10 "7.0.0"
curl -s https://pub.dev/packages/source_gen/changelog | grep -A 10 "2.0.0"
curl -s https://pub.dev/packages/dart_style/changelog | grep -A 10 "3.0.0"

Length of output: 33708


Dependency Update Verified: Breaking changes are accounted for
The updated dependencies in packages/mix_generator/pubspec.yaml correspond with documented breaking changes:

  • analyzer (7.0.0): Removal of deprecated APIs (e.g., DartType.element2 and others) necessitates code adjustments.
  • source_gen (2.0.0): Notable change in the formatOutput function signature and behavior, which justifies modifications in the code.
  • dart_style (3.0.0 → 3.0.1): Extensive rewrite affecting formatting style based on SDK version, aligning with adjustments in the formatter utility.

The changes in utility_code_generator.dart (e.g., use of enclosingElement3) appear to be the intended response to these upgrades. Please verify that all edge cases are covered through testing, but no additional modifications are anticipated based on the current changelog insights.

packages/mix_lint_test/pubspec.yaml (2)

6-7: SDK constraint updates align with the Flutter upgrade

The changes to Dart SDK (>=3.6.0) and Flutter SDK (>=3.27.0) are consistent with the project-wide upgrade referenced in the PR summary. These updates ensure the package remains compatible with the latest frameworks.


21-23: Dependencies updated to compatible versions

The updates to custom_lint, analyzer, and analyzer_plugin are appropriate given the SDK upgrades. These versions are compatible with the new Dart SDK constraints and provide access to the latest APIs needed for proper lint rule functionality.

packages/mix_lint/lib/src/utils/extensions/lint_rule_node_registry.dart (3)

16-18: Improved code structure with explicit block formatting

The change to use an explicit block with curly braces for the conditional return improves readability and consistency. This makes the code more maintainable and less prone to errors when adding additional statements in the future.


31-33: Consistent formatting with explicit block

Similar to the previous comment, this change maintains consistency in the codebase by using explicit blocks for conditional returns.


50-54: Updated error reporting API usage

The change from reportErrorForOffset to the newer atOffset method with named parameters improves code clarity and follows the updated API patterns in the analyzer package. The named parameters make the error reporting more explicit and easier to understand.

packages/remix/lib/src/components/textfield/attributes/attributes.g.dart (3)

23-24: Deprecated BoxHeightStyleUtility methods in favor of call method

The deprecation of these utility methods is consistent with the PR objective to deprecate all enum utilities. Users are now guided to use the more generic call method instead, which promotes a more unified API approach.

Also applies to: 27-28, 31-32, 36-37, 40-41, 45-46


61-62: Deprecated BoxWidthStyleUtility methods in favor of call method

Similar to the BoxHeightStyleUtility, these methods are deprecated to encourage the use of the call method. This maintains consistency across the API.

Also applies to: 65-66


80-81: Deprecated BrightnessUtility methods in favor of call method

These method deprecations align with the overall strategy to standardize the API by using the call method for attribute creation. The deprecation message clearly guides users toward the preferred alternative.

Also applies to: 84-85

packages/mix/lib/src/attributes/enum/enum_util.g.dart (25)

23-24: Deprecated VerticalDirectionUtility methods in favor of call method

The deprecation of up() and down() methods is in line with the PR objective to deprecate all enum utilities. The deprecation message clearly guides users to use the call method instead.

Also applies to: 27-28


42-43: Deprecated BorderStyleUtility methods in favor of call method

Consistent with other utility classes, the none() and solid() methods are being deprecated to encourage using the call method for better API consistency.

Also applies to: 46-47


61-62: Deprecated ClipUtility methods in favor of call method

All ClipUtility methods are being deprecated with consistent messaging, guiding users toward the more flexible call method approach.

Also applies to: 65-66, 69-70, 73-74


88-89: Deprecated AxisUtility methods in favor of call method

The horizontal() and vertical() methods are deprecated with clear migration guidance, consistent with the PR objective.

Also applies to: 92-93


107-108: Deprecated FlexFitUtility methods in favor of call method

These deprecations maintain consistency with the project-wide effort to standardize the API around the call method.

Also applies to: 111-112


126-127: Deprecated StackFitUtility methods in favor of call method

All StackFitUtility methods are being deprecated consistently, aligning with the overall API standardization approach.

Also applies to: 130-131, 134-135


146-147: Deprecated ImageRepeatUtility methods in favor of call method

The deprecation annotations are consistently applied to all ImageRepeatUtility methods, guiding users toward the preferred call method.

Also applies to: 150-151, 154-155, 158-159


174-175: Deprecated TextDirectionUtility methods in favor of call method

The rtl() and ltr() methods are being deprecated with clear messaging about using the call method instead.

Also applies to: 178-179


194-195: Deprecated TextLeadingDistributionUtility methods in favor of call method

Consistent with other utility classes, the proportional() and even() methods are deprecated with clear migration guidance.

Also applies to: 198-199


213-214: Deprecated TileModeUtility methods in favor of call method

All TileModeUtility methods are being deprecated consistently, providing a clear migration path to the call method.

Also applies to: 217-218, 221-222, 225-226


241-242: Deprecated MainAxisAlignmentUtility methods in favor of call method

The deprecation annotations are consistently applied to all MainAxisAlignmentUtility methods, maintaining API consistency.

Also applies to: 245-246, 249-250, 253-254, 257-258, 261-262


277-278: Deprecated CrossAxisAlignmentUtility methods in favor of call method

All CrossAxisAlignmentUtility methods are deprecated with clear guidance to use the call method instead.

Also applies to: 281-282, 285-286, 289-290, 293-294


309-310: Deprecated MainAxisSizeUtility methods in favor of call method

The min() and max() methods are deprecated consistently with other utility classes, guiding users toward the call method.

Also applies to: 313-314


328-329: Deprecated BoxFitUtility methods in favor of call method

All BoxFitUtility methods are being deprecated with consistent messaging, aligning with the PR objective.

Also applies to: 332-333, 336-337, 340-341, 344-345, 348-349, 352-353


367-368: Deprecated BlendModeUtility methods in favor of call method

The extensive list of BlendModeUtility methods are all consistently deprecated, providing a clear migration path to the call method. This standardization improves API consistency.

Also applies to: 371-372, 375-376, 379-380, 383-384, 387-388, 391-392, 395-396, 399-400, 403-404, 407-408, 411-412, 415-416, 419-420, 423-424, 427-428, 431-432, 435-436, 439-440, 443-444, 447-448, 451-452, 455-456, 459-460, 463-464, 467-468, 471-472, 475-476, 479-480


494-495: Deprecated BoxShapeUtility methods in favor of call method

The rectangle() and circle() methods are deprecated with clear guidance to use the call method instead.

Also applies to: 498-499


513-514: Deprecated FontStyleUtility methods in favor of call method

Consistent with other utility classes, the FontStyleUtility methods are deprecated to encourage using the call method.

Also applies to: 517-518


533-534: Deprecated TextDecorationStyleUtility methods in favor of call method

All TextDecorationStyleUtility methods are deprecated with consistent messaging, aligning with the PR objective.

Also applies to: 537-538, 541-542, 545-546, 549-550


565-566: Deprecated TextBaselineUtility methods in favor of call method

The alphabetic() and ideographic() methods are deprecated with clear guidance to use the call method.

Also applies to: 569-570


585-586: Deprecated TextOverflowUtility methods in favor of call method

All TextOverflowUtility methods are consistently deprecated, providing users with a clear migration path.

Also applies to: 589-590, 593-594, 597-598


613-614: Deprecated TextWidthBasisUtility methods in favor of call method

The parent() and longestLine() methods are deprecated consistently with other utility classes.

Also applies to: 617-618


632-633: Deprecated TextAlignUtility methods in favor of call method

All TextAlignUtility methods are deprecated with consistent messaging, guiding users toward the call method.

Also applies to: 636-637, 640-641, 644-645, 648-649, 652-653


668-669: Deprecated FilterQualityUtility methods in favor of call method

The FilterQualityUtility methods are deprecated consistently, maintaining API standardization.

Also applies to: 672-673, 676-677, 680-681


696-697: Deprecated WrapAlignmentUtility methods in favor of call method

All WrapAlignmentUtility methods are deprecated with consistent messaging, aligning with the PR objective.

Also applies to: 700-701, 704-705, 708-709, 712-713, 716-717


732-733: Deprecated TableCellVerticalAlignmentUtility methods in favor of call method

The TableCellVerticalAlignmentUtility methods are all consistently deprecated, guiding users toward using the call method instead.

Also applies to: 736-737, 740-741, 744-745, 748-749, 752-753

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