Skip to content

feat: dart fix data for the 1.0.0 breaking changes - #33

Merged
Harrys76 merged 5 commits into
mainfrom
feat/data-driven-fixes
Oct 27, 2026
Merged

Harrys76 merged 5 commits into
mainfrom
feat/data-driven-fixes

Conversation

@Harrys76

@Harrys76 Harrys76 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Code written against 0.38 stops compiling on 1.0.0 in two places that have a direct replacement. This adds lib/fix_data.yaml, so dart fix --apply and the IDE quick fix repair both. It also sets up the files and the CI check that later breaking releases can extend.

Based on #32, so merge #32 first. Until then this diff also shows #32's two commits.

What dart fix --apply changes

  • It adds import 'package:sleuth/validation.dart'; for the ten names that 0.38 exported from sleuth.dart and 1.0.0 moved: EvidenceTier, DetectorMetadata, DetectorMetadataProvider, BracketSpec, ComponentMetadata, ComponentMetadataProvider, ProfileCaptureSchema, kSleuthPackageVersion, PollTimings and StreamResourcePollResult (replacedBy).
  • It deletes the 29 removed SleuthThemeData arguments from constructor and copyWith calls (removeParameter).

The other breaks have no direct replacement and stay manual: reads of a removed theme token, the three removed theme helpers, the removed Sleuth statics, the 15 names no longer exported, the read-only RouteSession fields and default branches for the enums that can grow.

SDK support

Measured with dart fix test_fixes --compare-to-golden:

Flutter (Dart) Theme arguments kSleuthPackageVersion import Class, enum and mixin imports
3.47.6 (3.13.5) yes yes yes
3.35.5 (3.9.2) yes yes yes
3.32.8 (3.8.1) yes yes no, the analyzer rejects replacedBy for these kinds

Goldens

test_fixes/ holds one golden for the theme arguments and one per moved name. A single added import resolves every moved name in a file, so a shared file would hide a broken transform. Each import golden keeps one other sleuth.dart use, because dart fix also drops an import the change leaves unused. CI runs the goldens on the 3.47.6 lane only.

Config

  • analysis_options.yaml excludes test_fixes/**, since those files use the old API on purpose. test_fixes/analysis_options.yaml keeps that exclude from applying when dart fix analyses the folder.
  • .pubignore leaves test_fixes/ out of the archive. lib/fix_data.yaml ships (7 KB).
  • The floor lane runs flutter analyze lib test, which does not read lib/fix_data.yaml, so it stays clean on 3.32.8.

Docs

  • The CHANGELOG 1.0.0 section is shorter, 750 words down to 585 including the new dart fix note at the top of Breaking. It keeps every breaking change with its migration step, and the UI detail it dropped is in the release notes.
  • RepaintDetector and the six other detector types are new exports in validation.dart. 0.38 did not export them, so the CHANGELOG, the release notes and doc/api_1_0_0.md were wrong to say they moved. This fixes all three.
  • The README's API stability section says to run dart fix --apply after a major upgrade. CLAUDE.md has the golden command and a rule for future breaking changes. Deprecate with a transform in a minor release, then remove in a major one.

Checks

  • fvm flutter analyze: 0 issues. Floor analyze --no-pub lib test on 3.32.8: 0 issues.
  • fvm dart fix test_fixes --compare-to-golden: 11 passed.
  • public_api_test and audit_invariants_test, the tests that read these docs, pass. No Dart code in lib/ or test/ changed, so I did not rerun the full suite.
  • Publish dry-run: the archive has lib/fix_data.yaml and no test_fixes/.

🤖 Generated with Claude Code

Harrys76 and others added 5 commits October 27, 2026 19:14
Sleuth.track returned early with `if (kReleaseMode) return child;` and
built the overlay after it. The release compiler dropped Sleuth's own
code but kept the Flutter framework code the overlay uses: on the stock
counter app, 590 KB of Dart code on Android arm64 and 677 KB on iOS,
although none of it ran. The overlay path now sits inside
`if (!kReleaseMode)`, a branch the compiler drops whole, and the app's
Dart code is the same size with Sleuth.track as without it.

The other Sleuth statics reach the package only through the controller
that track creates, so their early returns now cost nothing as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep every breaking change with its migration step and move UI detail to
the release notes. The seven detector types in validation.dart are new
exports, not moves; 0.38 did not export them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lib/fix_data.yaml adds the validation.dart import for the ten names 0.38
exported from sleuth.dart, and deletes the 29 removed SleuthThemeData
arguments from constructor and copyWith calls. test_fixes/ holds the
goldens, one file per moved name, because one added import resolves every
moved name in a file. CI runs them on the latest lane: Dart 3.8 rejects
replacedBy for a class, enum or mixin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split dense sentences, turn fragments into sentences, and say what the
Dart 3.8 analyzer does with the class, enum and mixin moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Harrys76
Harrys76 merged commit 3cc4e49 into main Oct 27, 2026
6 checks passed
@Harrys76
Harrys76 deleted the feat/data-driven-fixes branch October 27, 2026 15:24
Harrys76 added a commit that referenced this pull request Oct 27, 2026
docs: 1.0.0 doc edits from #33, on the docs from #32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant