Upgrading petitparser 5 to 6
Breaking5.4.0 → 6.1.0Breaking2Platform1Deprecated2New3Changed3Fixed2Other1
BreakingUpgrade verdict
1 breaking change and a platform requirement change.
In plain terms
- Result is now sealed, so you can use Dart pattern matching on Success and Failure.
- You need Dart 3.0 or newer to use this version.
- The old Sequence-style accessors still work but are deprecated in favor of the new extension methods.
- Use pattern matching checks instead of the old isSuccess and isFailure getters.
Must act 4 items need code or config changes
Dart SDK requirement changed in 6.1.0: >=2.19.0 <3.0.0 → ^3.5.0.
What you must change
Breaking1
Makes Result a sealed class so Success and Failure can be pattern matched.
ResultSuccessFailurePlatform1
Requires Dart 3.0.
Deprecations to plan for
Deprecated2
Adds extension methods emulating the old Sequence classes and deprecates the old accessors.
SequenceDeprecates isSuccess and isFailure in favor of the more efficient is Success and is Failure operators.
isSuccessisFailureSuccessFailure