disposito 1.0.1
disposito: ^1.0.1 copied to clipboard
Analyzer plugin for object lifetimes: fields annotated with @Disposable must be cleaned up by the class that declares them, objects that own a lifecycle must not be created during a Flutter build, and [...]
Changelog #
1.0.1 #
Lowers the minimum Dart SDK from 3.13.2 to 3.11.0. Nothing else changed: every dependency already resolved on 3.11, so the old constraint kept consumers off earlier stable SDKs for no reason.
1.0.0 #
This release replaces the package. Up to 0.2.3 disposito was a runtime
disposal library: DisposeHolder, DisposeHolderHostMixin, and cleanup
triggered when the owning object was garbage collected. From 1.0.0 it is an
analyzer plugin instead, which catches a missing dispose at author time
rather than running one for you at runtime.
The two share a subject and nothing else, so 1.0.0 has no API in common with
0.2.3. Nothing is deprecated, because nothing carried over: DisposeHolder,
DisposeHolderHostMixin, Disposable, Closable, Cancelable, the binding
extensions and DisposeRegistry are all gone.
- If you use the runtime library, pin
disposito: ^0.2.3. That code is unchanged on pub.dev and preserved on theruntime-library-v0.2.3branch. - If you want the lints, take
^1.0.0and read the installation section in the README: the package is now listed both as a dependency (for the@Disposableannotation) and as an analyzer plugin (for the rules).
What 1.0.0 contains, moved here from arxdeus_lints:
- The
@Disposableannotation. missing_dispose, which reports an annotated field that the declaring class never cleans up, together with the quick fix that writes the cleanup call into the class's disposal method, creating that method when there is none.stateful_in_build, which reports an object that owns a lifecycle being created during a Flutter build, where it is thrown away and replaced on every rebuild.this_in_dispose, which reports aStatehanding out a reference to itself from its owndispose.late_initialized_in_dispose, which reports alatefield of aStatewhose initializer needs the state object and which nothing reads beforedispose, so it is constructed during teardown.
Changelog #
0.2.3 - 2025-05-18 #
0.2.2 - 2025-03-23 #
Documentation #
- (README) misspelling and styling fixes - (070b570)
- (dispose_holder_mixin) internal comment for
debugNameclarification - (8aa2613)
Miscellaneous Chores #
- (example) oneline dispose in
simple.dart- (0343a30) - (internal) more verbose internal class names - (e41fb98)
Refactoring #
- (dispose_holder) migrate to asynchronous api under the hood - (c5892ec)
- (dispose_registry) execute
functioninpurgeAftersynchronously - (07a965f) - (extensions) asynchronous api without
unawaited- (28a7d31) - (internal)
Callable.callstatic for tear-off callback execution - (15324e6)
Ci #
- (dry_publish) fix double dry-run - (6efd6c7)
0.2.1 - 2025-03-21 #
0.2.0 - 2025-03-21 #
Bug Fixes #
- (dispose_holder) make dispose async - (4489a13)
- (example) update to new syntax - (4f993ff)
- (extensions) update extensions to new syntax - (11f03a4)
- path to wrapper inside
internal.dart- (f443f00) - remove
createDisposableandDisposeWrapper- (a3fe6e4)
Documentation #
- README - (36316e9)
Features #
- (disposable) static
disposeObjectproxiesFutureOr<void>instead ofvoid- (868ce56) - (dispose_holder) rethink of prioritization of dispose queue - (cbb0832)
- (dispose_registry) rethink of prioritization of purge callback - (156dc4c)
- (example) simple example - (ed12719)
- (example) simple now have async callback and disposes - (a34805e)
Miscellaneous Chores #
- (dispose_holder) update naming of methods - (0ae1aec)
- (extensions) change variable input name - (b4c4247)
- (internal) disposable wrapper implements disposable - (5443887)
Tests #
- update to new syntax - (b45039c)
Ci #
- missing PAT + change versions strategy - (7bc5260)
0.1.0 - 2025-03-19 #
Bug Fixes #
- (extensions) change signatures to generics to allow subtypes - (2e2759c)
Features #
- (dispose_tracker) dispose tracker as public global interactor - (2e03b79)
- (dispose_tracker) purge on create/dispose each other holder - (f38e5c9)
- [BREAKING CHANGE] disposito main logic - (ca1db16)
Miscellaneous Chores #
Refactoring #
- code style + lint matching - (bf533bb)
Tests #
Ci #
0.0.1 #
- Initial version.