solid_generator 3.0.0-dev.2
solid_generator: ^3.0.0-dev.2 copied to clipboard
Solid source-to-lib code generator for Flutter reactive state.
3.0.0-dev.2 #
- FIX: Cross-class
.valuerewrite now resolves constructor-injected instance fields (final AuthRepository _authRepository;), not just method/function parameters and@SolidEnvironmentfields. Previously a bare instance field receiver silently kept its unlowered form, producing always-true null checks and compile errors against the unboxedSignalpayload. Also covers athis.-prefixed receiver (this._authRepository.session) —this.<field>parses as a distinct AST shape from the bare_authRepository.sessionform and previously fell through unrewritten. - FIX:
.environment()/Provider(...)dispose auto-injection is now type-aware —dispose: (context, provider) => provider.dispose()is injected per a four-tier decision: (1) the created type provably hasdispose()(own declaration, or inherited — including transitively through a same-file base-class chain); (2) the created type is@Solid*-annotated, same-file OR cross-file (every Solid-lowered class synthesizesdispose()); (3) the type's declaration is visible and shows neither → skip, no injection; (4) the declaration isn't visible anywhere this check looked (typically a cross-file, non-@Solid*type) → inject anyway, preserving the pre-type-aware default so a wrong guess fails loudly at compile time rather than silently leaking a resource, withdispose: nullas the explicit opt-out. Previously the injection was unconditional and made source-layer typechecking fail with a compile-timeundefined_methoderror on.dispose()for any type with nodispose()method; omittingdispose:for such a type now injects nothing (same as an explicitdispose: null) instead of a load-bearingdispose: nullworkaround. This changes generated output for existing call sites that omitdispose:on a dispose-less type — the compile error goes away. - FIX: The dispose auto-injection above now also recognizes a cross-file
@Solid*-annotated type provided via.environment<T>()/Provider<T>(...)even when nothing in the providing file consumesTthrough an@SolidEnvironmentfield. Previously such a controller — the dominant real-world shape, e.g. a top-levelmain()that provides a controller it never itself consumes — got NO dispose injection at all: its synthesizeddispose()only exists after lowering, which was invisible to every check this rewriter had. This was a silent resource leak, not a compile error, because the call site was already valid Dart (dispose:simply absent).
3.0.0-dev.1 #
- BREAKING: Raise the Dart SDK lower bound to
^3.10.0to target the solidart v3 ecosystem. - CHORE: Upgrade
analyzerto^12.0.0and adapt to its reshaped class/enum declaration AST (name and members moved ontonamePart/bodyfor primary constructors). - CHORE: Bump
solid_annotationsto^3.0.0-dev.1,dart_styleto^3.1.8, andbuild/build_runner/build_test.
2.0.0+1 #
- DOCS: Update README installation.
2.0.0 #
- FEAT: SignalBuilder placement,
.valuerewrite, dispose synthesis, StatelessWidget→StatefulWidget split. - FEAT: Computed synthesis from getter form of
@SolidState. - FEAT: Fine-grained reactivity with untracked-read semantics (
.untracked). - FEAT: Support the
untracked(() => …)function form for untracked writes inside reactive bodies (e.g. writing a collection signal in a@SolidEffectwithout a cyclic reaction). The call passes through toflutter_solidart'suntracked; inner reads still receive.valuebut are not tracked. Previously this form was rejected. - FEAT: Effect lowering with
initStatematerialization for State and plain-class targets. - FEAT: Resource lowering for Future/Stream with
.when()/.refresh()call-site preservation. - FEAT: Environment field synthesis with Provider-backed DI and cross-class chain rewrites.
1.0.3 #
- FIX: Missing
flutter_solidartimport in generatedmain.dartfile, if no reactive annotations are used.
1.0.2 #
- FIX: Generator not transpiling code correctly in some cases.
1.0.1 #
- FIX: Remove Flutter SDK.
1.0.0+2 #
- CHORE: Add
fluttersdk to resolve score on pub.dev.
1.0.0 #
- Initial version.