Skip to content

chore(mix): remove deprecated APIs#870

Merged
tilucasoli merged 3 commits intomainfrom
chore/remove-deprecated
Mar 25, 2026
Merged

chore(mix): remove deprecated APIs#870
tilucasoli merged 3 commits intomainfrom
chore/remove-deprecated

Conversation

@leoafarias
Copy link
Copy Markdown
Collaborator

Related issue

N/A

Description

Removes deprecated API surface from Mix and aligns tests/docs with the current v2 patterns.

Changes

  • Removed deprecated utilities, variant helpers, and old API entry points across packages/mix.
  • Updated spec/style/widget files and exports to reflect the simplified API footprint.
  • Removed legacy tests tied to removed APIs (including variant_util_test.dart and enum_util_test.dart) and updated remaining tests.
  • Updated migration/overview docs and README content to guide users to the current APIs.

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?

Additional Information (optional)

Verified with melos run ci and melos run analyze:dart on this branch.

@docs-page
Copy link
Copy Markdown

docs-page Bot commented Feb 27, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/mix~870

Documentation is deployed and generated using docs.page.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mix-docs Ready Ready Preview, Comment Mar 25, 2026 2:32am

Copilot AI review requested due to automatic review settings March 25, 2026 01:02
@tilucasoli tilucasoli force-pushed the chore/remove-deprecated branch from 2f99299 to c8a95c7 Compare March 25, 2026 01:02
@github-actions github-actions Bot removed the examples label Mar 25, 2026
Copy link
Copy Markdown
Contributor

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 removes deprecated Mix v1/v2-transition APIs across the mix and related packages, and updates tests and documentation to reflect the current v2 patterns (direct styler usage, direct variant methods, and token ref call syntax).

Changes:

  • Removed deprecated variant utilities, widget typedef aliases, StyleSpec widget-call extensions, and assorted deprecated helpers.
  • Updated stylers/mutable stylers and property utilities to drop legacy entry points (e.g., gap, enum helper methods, .ref, deprecated .builder, deprecated .wrap utilities).
  • Updated/removed tests and refreshed docs/migration guides to match the simplified API surface.

Reviewed changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/src/content/documentation/overview/migration.mdx Removes links/mentions to deprecated-source files and fixes formatting in migration docs.
packages/mix_tailwinds/lib/src/tw_config.dart Removes deprecated TwGradientStrategy.adaptive enum value.
packages/mix/test/src/variants/variant_util_test.dart Removes tests for deleted legacy variant utility API.
packages/mix/test/src/variants/variant_mixin_test.dart Removes test coverage for deleted deprecated builder() variant API.
packages/mix/test/src/specs/text/text_util_test.dart Drops tests for removed wrap utility on text util.
packages/mix/test/src/specs/stack/stack_widget_test.dart Renames ZBox terminology to StackBox in tests (some locals still use old naming).
packages/mix/test/src/specs/stack/stack_util_test.dart Drops tests for removed wrap utility on stack util.
packages/mix/test/src/specs/spec_util_test.dart Updates tests from global $box-style getters to *.chain getters.
packages/mix/test/src/specs/image/image_util_test.dart Drops tests for removed wrap utility on image util.
packages/mix/test/src/specs/icon/icon_util_test.dart Drops tests for removed wrap utility on icon util.
packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart Updates test descriptions to RowBox/ColumnBox terminology (some locals still use old naming).
packages/mix/test/src/specs/flexbox/flexbox_util_test.dart Drops tests for removed wrap utility on flexbox util.
packages/mix/test/src/specs/flex/flex_util_test.dart Drops tests for removed wrap utility on flex util.
packages/mix/test/src/specs/box/box_util_test.dart Updates test naming from BoxMix to BoxStyler and removes wrap-related tests.
packages/mix/test/src/specs/box/box_style_test.dart Updates test naming to BoxStyler.
packages/mix/test/src/properties/painting/color_util_test.dart Removes tests for deprecated ref() color token API.
packages/mix/test/src/properties/layout/enum_util_test.dart Removes tests for deleted enum helper extension methods.
packages/mix/test/src/core/style_merge_parameters_test.dart Updates group name to BoxStyler terminology.
packages/mix/test/helpers/testing_utils.dart Renames ZBox spec access extension to StackBox naming.
packages/mix/lib/src/variants/variant_util.dart Replaces removed legacy variant utility APIs with an empty legacy library placeholder.
packages/mix/lib/src/theme/tokens/token_refs.dart Updates token reference error messaging/examples to v2 styler usage.
packages/mix/lib/src/theme/mix_theme.dart Removes deprecated MixTheme typedef alias.
packages/mix/lib/src/theme/mix_colors.dart Updates documentation examples to v2 styler usage.
packages/mix/lib/src/style/mixins/variant_style_mixin.dart Removes deprecated builder() alias method.
packages/mix/lib/src/specs/text/text_widget.dart Removes deprecated StyleSpec widget-call extensions for text.
packages/mix/lib/src/specs/text/text_style.dart Removes deprecated TextMix typedef alias.
packages/mix/lib/src/specs/text/text_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/stackbox/stackbox_widget.dart Removes deprecated ZBox typedef and StyleSpec widget-call extensions.
packages/mix/lib/src/specs/stackbox/stackbox_style.dart Removes deprecated StackBoxMix typedef and updates comments.
packages/mix/lib/src/specs/stackbox/stackbox_spec.dart Removes deprecated ZBoxSpec typedef alias.
packages/mix/lib/src/specs/stackbox/stackbox_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/stack/stack_style.dart Removes deprecated StackMix typedef alias.
packages/mix/lib/src/specs/stack/stack_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/mutable_stylers.dart Removes legacy global mutable styler accessors; leaves placeholder library.
packages/mix/lib/src/specs/image/image_widget.dart Removes deprecated StyleSpec widget-call extensions and updates error hint text.
packages/mix/lib/src/specs/image/image_style.dart Removes deprecated ImageMix typedef alias.
packages/mix/lib/src/specs/image/image_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/icon/icon_widget.dart Removes deprecated StyleSpec widget-call extensions for icon.
packages/mix/lib/src/specs/icon/icon_style.dart Removes deprecated IconMix typedef alias.
packages/mix/lib/src/specs/icon/icon_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/flexbox/flexbox_widget.dart Removes deprecated VBox/HBox typedefs and StyleSpec widget-call extensions.
packages/mix/lib/src/specs/flexbox/flexbox_style.dart Removes deprecated FlexBoxMix typedef and deprecated gap() method.
packages/mix/lib/src/specs/flexbox/flexbox_mutable_style.dart Removes deprecated on/wrap utilities and deprecated gap() method.
packages/mix/lib/src/specs/flex/flex_style.dart Removes deprecated FlexMix typedef and deprecated gap parameter fallback.
packages/mix/lib/src/specs/flex/flex_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/specs/box/box_widget.dart Removes deprecated StyledContainer typedef and StyleSpec widget-call extensions.
packages/mix/lib/src/specs/box/box_style.dart Removes deprecated BoxMix typedef alias.
packages/mix/lib/src/specs/box/box_mutable_style.dart Removes deprecated on and wrap utilities and updates examples.
packages/mix/lib/src/properties/painting/material_colors_util.dart Removes deprecated .shadeXXX() methods and updates docs/comments accordingly.
packages/mix/lib/src/properties/painting/color_util.dart Removes deprecated ref() alias for token usage.
packages/mix/lib/src/properties/painting/border_radius_util.dart Removes deprecated call() shorthands in border radius utilities.
packages/mix/lib/src/properties/layout/enum_util.dart Removes deprecated enum helper methods, leaving only call(value) usage.
packages/mix/lib/src/properties/layout/edge_insets_geometry_util.dart Updates comment to reflect removed legacy typedef.
packages/mix/lib/src/properties/layout/edge_insets_geometry_mix.dart Updates comment to reflect removed legacy typedef.
packages/mix/lib/src/core/utility_widget_state_variant_mixin.dart Updates documentation examples to v2 styler usage.
packages/mix/lib/src/core/utility_variant_mixin.dart Updates docs and removes deprecated builder() alias.
packages/mix/lib/src/core/providers/style_provider.dart Removes deprecated StyleProvider.maybeOf (but currently introduces a duplicate style field).
packages/mix/lib/src/core/helpers.dart Removes deprecated prop-list resolver helper.
packages/mix/lib/mix.dart Updates exports to stop hiding now-removed typedef aliases.
packages/mix/doc/token-migration-guide.md Updates token migration guide examples to v2 token ref + styler patterns.
Comments suppressed due to low confidence (1)

packages/mix/test/src/specs/flexbox/flexbox_widget_test.dart:118

  • In the ColumnBox default-parameters test, locals like vBoxKey/vBoxFinder still use the old VBox terminology. Renaming them (e.g., columnBoxKey/columnBoxFinder) would keep names consistent with ColumnBox.

Comment on lines 19 to 21
/// The style provided to descendant widgets.
final Style<S> style;

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

StyleProvider declares the style field twice (duplicate final Style<S> style;). This will cause a compile-time error due to duplicate members. Remove one of the declarations (keep a single style field).

Suggested change
/// The style provided to descendant widgets.
final Style<S> style;

Copilot uses AI. Check for mistakes.
Comment on lines +6 to 10
group('Default parameters for StackBox matches Container+Stack', () {
testWidgets('should have the same default parameters', (tester) async {
const zBoxKey = Key('zbox');
const zBoxKey = Key('stackbox');
const containerKey = Key('container');
const stackKey = Key('stack');
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The test still uses zBoxKey/zBoxFinder identifiers even though the widget/key are now StackBox/stackbox. Renaming these locals would keep the test terminology consistent and avoid confusion when reading failures.

Copilot uses AI. Check for mistakes.
Comment on lines +74 to 77
group('Default parameters for RowBox matches Row', () {
testWidgets('should have the same default parameters', (tester) async {
const hBoxKey = Key('hbox');
const rowKey = Key('row');
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

In the RowBox default-parameters test, locals like hBoxKey/hBoxFinder still use the old HBox terminology. Renaming them (e.g., rowBoxKey/rowBoxFinder) would keep names aligned with the widget under test.

Copilot uses AI. Check for mistakes.
Refactor tests to use clearer keys: hBox → rowBoxKey, vBox → columnBoxKey, and zBox → stackBoxKey, and update all corresponding finders and descendant lookups in flexbox and stack widget tests. Also removed the StyleProvider.style field and its doc comment in style_provider.dart (note: the constructor and updateShouldNotify still reference `style`, so a follow-up fix may be required).
@tilucasoli tilucasoli merged commit a419383 into main Mar 25, 2026
8 checks passed
@tilucasoli tilucasoli deleted the chore/remove-deprecated branch March 25, 2026 02:39
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.

3 participants