chore(mix): remove deprecated APIs#870
Conversation
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2f99299 to
c8a95c7
Compare
There was a problem hiding this comment.
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.wraputilities). - 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
ColumnBoxdefault-parameters test, locals likevBoxKey/vBoxFinderstill use the oldVBoxterminology. Renaming them (e.g.,columnBoxKey/columnBoxFinder) would keep names consistent withColumnBox.
| /// The style provided to descendant widgets. | ||
| final Style<S> style; | ||
|
|
There was a problem hiding this comment.
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).
| /// The style provided to descendant widgets. | |
| final Style<S> style; |
| 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'); |
There was a problem hiding this comment.
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.
| group('Default parameters for RowBox matches Row', () { | ||
| testWidgets('should have the same default parameters', (tester) async { | ||
| const hBoxKey = Key('hbox'); | ||
| const rowKey = Key('row'); |
There was a problem hiding this comment.
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.
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).
Related issue
N/A
Description
Removes deprecated API surface from Mix and aligns tests/docs with the current v2 patterns.
Changes
packages/mix.variant_util_test.dartandenum_util_test.dart) and updated remaining tests.Review Checklist
Additional Information (optional)
Verified with
melos run ciandmelos run analyze:darton this branch.