Repository navigation
feat: dart fix data for the 1.0.0 breaking changes - #33
Merged
Merged
Conversation
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>
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, sodart fix --applyand 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 --applychangesimport 'package:sleuth/validation.dart';for the ten names that 0.38 exported fromsleuth.dartand 1.0.0 moved:EvidenceTier,DetectorMetadata,DetectorMetadataProvider,BracketSpec,ComponentMetadata,ComponentMetadataProvider,ProfileCaptureSchema,kSleuthPackageVersion,PollTimingsandStreamResourcePollResult(replacedBy).SleuthThemeDataarguments from constructor andcopyWithcalls (removeParameter).The other breaks have no direct replacement and stay manual: reads of a removed theme token, the three removed theme helpers, the removed
Sleuthstatics, the 15 names no longer exported, the read-onlyRouteSessionfields and default branches for the enums that can grow.SDK support
Measured with
dart fix test_fixes --compare-to-golden:kSleuthPackageVersionimportreplacedByfor these kindsGoldens
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 othersleuth.dartuse, becausedart fixalso drops an import the change leaves unused. CI runs the goldens on the 3.47.6 lane only.Config
analysis_options.yamlexcludestest_fixes/**, since those files use the old API on purpose.test_fixes/analysis_options.yamlkeeps that exclude from applying whendart fixanalyses the folder..pubignoreleavestest_fixes/out of the archive.lib/fix_data.yamlships (7 KB).flutter analyze lib test, which does not readlib/fix_data.yaml, so it stays clean on 3.32.8.Docs
dart fixnote 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.RepaintDetectorand the six other detector types are new exports invalidation.dart. 0.38 did not export them, so the CHANGELOG, the release notes anddoc/api_1_0_0.mdwere wrong to say they moved. This fixes all three.dart fix --applyafter 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. Flooranalyze --no-pub lib teston 3.32.8: 0 issues.fvm dart fix test_fixes --compare-to-golden: 11 passed.public_api_testandaudit_invariants_test, the tests that read these docs, pass. No Dart code inlib/ortest/changed, so I did not rerun the full suite.lib/fix_data.yamland notest_fixes/.🤖 Generated with Claude Code