원클릭으로
signals-migration-6-to-7
// Detailed guidelines, patterns, and rules for migrating codebases from signals.dart version 6.x to version 7.x.
// Detailed guidelines, patterns, and rules for migrating codebases from signals.dart version 6.x to version 7.x.
Highly optimized Flutter UI bindings and GPU rendering for reactive signals.
Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks.
Comprehensive reactive state hooks for integration with flutter_hooks.
Standardized compiler diagnostics, static analysis lints, and automated IDE quick-fixes.
Review the current Jaspr docs, audit source code doc comments, edit the source code, and run the generator script to verify docs updates.
Update all the `./examples` dependencies to the latest repository/third-party versions and fix any compiler or analysis issues.
| name | signals-migration-6-to-7 |
| description | Detailed guidelines, patterns, and rules for migrating codebases from signals.dart version 6.x to version 7.x. |
This guide provides comprehensive instructions for migrating applications and packages using signals.dart from version 6.x to 7.0.0.
| Related File | Description |
|---|---|
| signal_options.md | Guide to migrating scattered parameters (e.g. autoDispose, debugLabel) of signal and computed creators to the new unified options classes. |
| async_options.md | Guidelines for migrating asynchronous signal creators (futureSignal, streamSignal) to use AsyncSignalOptions. |
| collection_options.md | Instructions on migrating collection-based signal creators to strongly typed collection options classes. |
| builder_migration.md | Migration path for SignalBuilder constructor to use the required named builder parameter. |
| mixin_migration.md | Safe refactoring guidelines for replacing the deprecated SignalsMixin with SignalWidget or localized builders. |
In v6, signals, computed, effects, and async signals accepted individual parameters like autoDispose, debugLabel, lazy, etc.
In v7, all parameters have been unified under a single, cohesive options class parameter.
final count = signal(0, autoDispose: true, debugLabel: 'counter');
final count = signal(0, options: SignalOptions(autoDispose: true, name: 'counter'));
final double = computed(() => count.value * 2, autoDispose: true, debugLabel: 'double');
final double = computed(() => count.value * 2, options: ComputedOptions(autoDispose: true, name: 'double'));
listSignal, setSignal, mapSignal, etc.)All collections now accept unified options objects corresponding to their types (e.g. ListSignalOptions, SetSignalOptions, MapSignalOptions, IterableSignalOptions, QueueSignalOptions).
final list = listSignal([1, 2], autoDispose: true);
final list = listSignal([1, 2], options: ListSignalOptions(autoDispose: true));
All async creators (futureSignal, streamSignal, asyncSignal, computedFrom, computedAsync) now accept only the primary value/callback parameter followed by a named options parameter (AsyncSignalOptions). All other parameters have been marked @Deprecated.
final s = futureSignal(() => fetch(), lazy: false, initialValue: 0);
final s = futureSignal(() => fetch(), options: AsyncSignalOptions(lazy: false, initialValue: 0));
SignalsMixinSignalsMixin is deprecated to prevent state overhead. Use localized widgets or builders instead.
State with SignalsMixin with a stateless SignalWidget or a stateful SignalStatefulWidget.SignalBuilder widgets to wrap only the widgets that depend on signal updates.SignalBuilder Named builder ParameterThe SignalBuilder widget now uses a required named parameter builder instead of a positional argument.
SignalBuilder(
(context, value) => Text('$value'),
)
SignalBuilder(
builder: (context, value) => Text('$value'),
)
SignalEffect / SignalListenerIf you were executing side effects inside builds or mixins, migrate them to the localized SignalEffect (or alias SignalListener) widget which manages mounting, didUpdateWidget, and unmounting teardown lifecycle hooks safely.
SignalEffect(
callback: (context) {
if (error.value != null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(error.value!)));
}
},
child: MyWidget(),
)
linkedSignal)If you had custom logic synchronizing external updates back to a computed signal, migrate them to the native linkedSignal or LinkedSignalOptions.
final original = signal('Alice');
final display = linkedSignal(() => original.value);
print(display.value); // 'Alice'
display.value = 'Bob'; // Override manual write
original.value = 'Charlie'; // Source changes -> resets display to 'Charlie'
signals_lintTo make migrating from v6 to v7 completely effortless, the signals_lint tool analyzes your code and surfaces instant, automated quick-fixes/assists under your IDE's action menu (Alt+Enter or Cmd+.):
with SignalsMixin and replaces the widget with a high-performance SignalStatefulWidget automatically.Watch and Watch.builder instances into unified SignalBuilder components.StatelessWidget and StatefulWidget widgets to reactive SignalWidget and SignalStatefulWidget widgets on command.SignalBuilder.