Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use final class in acyclic_steps #267

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions acyclic_steps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.11.2
* Remove `@sealed` annotation in favor of `final class` modifier from Dart 3.
* Bump SDK lower-bound constraint to Dart `3.0.0`.

## v0.11.1
* Added `topics` to `pubspec.yaml`.

Expand Down
43 changes: 14 additions & 29 deletions acyclic_steps/lib/src/fluent_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import 'dart:async' show FutureOr;

import 'dart:collection' show UnmodifiableListView;
import 'package:meta/meta.dart' show sealed;

Future<T> _defaultRunStep<T>(Step<T> step, Future<T> Function() fn) => fn();

Expand Down Expand Up @@ -44,8 +43,7 @@ typedef RunStepWrapper = Future<T> Function<T>(
/// value to be used instead. This is useful when injecting initial options
/// into an acyclic graph of steps, or when overriding specific components with
/// mocks/fakes in a testing setup.
@sealed
class Runner {
final class Runner {
final Map<Step<Object?>, dynamic> _cache = {};
final RunStepWrapper _wrapRunStep;

Expand Down Expand Up @@ -212,8 +210,7 @@ class Runner {
/// to create a [StepBuilderN] which takes `N` dependencies. This allows an
/// arbitrary number of dependencies, but consuming the result may require type
/// casting.
@sealed
class Step<T> {
final class Step<T> {
/// Name of the step.
///
/// This is used to identify the step, typically for debugging, logging or
Expand Down Expand Up @@ -294,8 +291,7 @@ class Step<T> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder {
final class StepBuilder {
final String _name;

StepBuilder._(this._name);
Expand Down Expand Up @@ -338,8 +334,7 @@ class StepBuilder {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilderN<S> {
final class StepBuilderN<S> {
final String _name;
final List<Step<S>> _dependencies;

Expand Down Expand Up @@ -368,8 +363,7 @@ class StepBuilderN<S> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder1<A> {
final class StepBuilder1<A> {
final String _name;
final Step<A> _a;

Expand Down Expand Up @@ -409,8 +403,7 @@ class StepBuilder1<A> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder2<A, B> {
final class StepBuilder2<A, B> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -453,8 +446,7 @@ class StepBuilder2<A, B> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder3<A, B, C> {
final class StepBuilder3<A, B, C> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -512,8 +504,7 @@ class StepBuilder3<A, B, C> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder4<A, B, C, D> {
final class StepBuilder4<A, B, C, D> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -576,8 +567,7 @@ class StepBuilder4<A, B, C, D> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder5<A, B, C, D, E> {
final class StepBuilder5<A, B, C, D, E> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -645,8 +635,7 @@ class StepBuilder5<A, B, C, D, E> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder6<A, B, C, D, E, F> {
final class StepBuilder6<A, B, C, D, E, F> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -719,8 +708,7 @@ class StepBuilder6<A, B, C, D, E, F> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder7<A, B, C, D, E, F, G> {
final class StepBuilder7<A, B, C, D, E, F, G> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -798,8 +786,7 @@ class StepBuilder7<A, B, C, D, E, F, G> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder8<A, B, C, D, E, F, G, H> {
final class StepBuilder8<A, B, C, D, E, F, G, H> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -882,8 +869,7 @@ class StepBuilder8<A, B, C, D, E, F, G, H> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder9<A, B, C, D, E, F, G, H, I> {
final class StepBuilder9<A, B, C, D, E, F, G, H, I> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down Expand Up @@ -973,8 +959,7 @@ class StepBuilder9<A, B, C, D, E, F, G, H, I> {
///
/// This type is only intended to be used an intermediate result in an
/// expression defining a step. See [Step.define] for how to define steps.
@sealed
class StepBuilder9N<A, B, C, D, E, F, G, H, I, S> {
final class StepBuilder9N<A, B, C, D, E, F, G, H, I, S> {
final String _name;
final Step<A> _a;
final Step<B> _b;
Expand Down
4 changes: 2 additions & 2 deletions acyclic_steps/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: acyclic_steps
version: 0.11.1
version: 0.11.2
description: >-
An explicit acyclic step dependency framework with concurrent evaluation
and dependency injection.
Expand All @@ -15,4 +15,4 @@ dev_dependencies:
test: ^1.5.1
lints: ^1.0.0
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '^3.0.0'
Loading