Skip to content

CPLAT-4031: Make builder compatible with Dart 2 only boilerplate #227

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

Merged
merged 16 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 0 additions & 16 deletions example/builder/abstract_inheritance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@ import 'package:over_react/over_react.dart';

part 'abstract_inheritance.over_react.g.dart';

abstract class SuperProps extends _$SuperProps with _$SuperPropsAccessorsMixin {
static const PropsMeta meta = _$metaForSuperProps;
}

@AbstractProps()
abstract class _$SuperProps extends UiProps {
String superProp;
}

abstract class SuperState extends _$SuperState with _$SuperStateAccessorsMixin {
static const StateMeta meta = _$metaForSuperState;
}

@AbstractState()
abstract class _$SuperState extends UiState {
String superState;
Expand All @@ -37,19 +29,11 @@ abstract class SuperComponent<T extends SuperProps, V extends SuperState> extend
@Factory()
UiFactory<SubProps> Sub = _$Sub;

class SubProps extends _$SubProps with _$SubPropsAccessorsMixin {
static const PropsMeta meta = _$metaForSubProps;
}

@Props()
class _$SubProps extends SuperProps {
String subProp;
}

abstract class SubState extends _$SubState with _$SubStateAccessorsMixin {
static const StateMeta meta = _$metaForSubState;
}

@State()
class _$SubState extends SuperState {
String subState;
Expand Down
4 changes: 0 additions & 4 deletions example/builder/basic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ part 'basic.over_react.g.dart';
@Factory()
UiFactory<BasicProps> Basic = _$Basic;

class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin {
static const PropsMeta meta = _$metaForBasicProps;
}

@Props()
class _$BasicProps extends UiProps {
@deprecated
Expand Down
13 changes: 2 additions & 11 deletions example/builder/basic_with_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ import 'package:over_react/over_react.dart';
import 'props_mixin.dart' as pm;
import 'state_mixin.dart';


part 'basic_with_state.over_react.g.dart';

@Factory()
UiFactory<BasicProps> Basic = _$Basic;

class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin {
static const PropsMeta meta = _$metaForBasicProps;
}

@Props()
class _$BasicProps extends UiProps with pm.ExamplePropsMixinClass, pm.$ExamplePropsMixinClass {
class _$BasicProps extends UiProps with pm.ExamplePropsMixinClass {
String basicProp;
String basic1;
String basic2;
Expand All @@ -22,12 +17,8 @@ class _$BasicProps extends UiProps with pm.ExamplePropsMixinClass, pm.$ExamplePr
String basic5;
}

abstract class BasicState extends _$BasicState with _$BasicStateAccessorsMixin {
static const StateMeta meta = _$metaForBasicState;
}

@State()
class _$BasicState extends UiState with ExampleStateMixinClass, $ExampleStateMixinClass {
class _$BasicState extends UiState with ExampleStateMixinClass {
String basicState;
}

Expand Down
4 changes: 0 additions & 4 deletions example/builder/basic_with_type_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ part 'basic_with_type_params.over_react.g.dart';
@Factory()
UiFactory<BasicProps> Basic = _$Basic;

class BasicProps<T, U extends UiProps> extends _$BasicProps<T, U> with _$BasicPropsAccessorsMixin<T, U> {
static const PropsMeta meta = _$metaForBasicProps;
}

@Props()
class _$BasicProps<T, U extends UiProps> extends UiProps {
List<T> someGenericListProp;
Expand Down
9 changes: 0 additions & 9 deletions example/builder/generic_inheritance_sub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@ part 'generic_inheritance_sub.over_react.g.dart';
@Factory()
UiFactory<GenericSubProps> GenericSub = _$GenericSub;

class GenericSubProps extends _$GenericSubProps with _$GenericSubPropsAccessorsMixin {
static const PropsMeta meta = _$metaForGenericSubProps;
}

@Props()
class _$GenericSubProps extends GenericSuperProps {
String subProp;
}

// ignore: mixin_of_non_class,undefined_class
abstract class GenericSubState extends _$GenericSubState with _$GenericSubStateAccessorsMixin {
static const StateMeta meta = _$metaForGenericSubState;
}

@State()
class _$GenericSubState extends GenericSuperState {
String subState;
Expand Down
11 changes: 0 additions & 11 deletions example/builder/generic_inheritance_super.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ part 'generic_inheritance_super.over_react.g.dart';
@Factory()
UiFactory<GenericSuperProps> GenericSuper = _$GenericSuper;

// ignore: mixin_of_non_class,undefined_class
class GenericSuperProps extends _$GenericSuperProps with _$GenericSuperPropsAccessorsMixin {
static const PropsMeta meta = _$metaForGenericSuperProps;
}

@Props()
class _$GenericSuperProps extends UiProps {
String otherSuperProp;
String superProp;
String superProp1;
}


// ignore: mixin_of_non_class,undefined_class
abstract class GenericSuperState extends _$GenericSuperState with _$GenericSuperStateAccessorsMixin {
static const StateMeta meta = _$metaForGenericSuperState;
}

@State()
class _$GenericSuperState extends UiState {
String superState;
Expand Down
17 changes: 2 additions & 15 deletions example/builder/part_of_basic_library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ part of basic.library;
@Factory()
UiFactory<BasicPartOfLibProps> BasicPartOfLib = _$BasicPartOfLib;

// ignore: mixin_of_non_class,undefined_class
class BasicPartOfLibProps extends _$BasicPartOfLibProps with _$BasicPartOfLibPropsAccessorsMixin {
static const PropsMeta meta = _$metaForBasicPartOfLibProps;
}

@Props()
class _$BasicPartOfLibProps extends UiProps
// ignore: mixin_of_non_class,undefined_class
with ExamplePropsMixinClass, $ExamplePropsMixinClass {
with ExamplePropsMixinClass {
String basicProp;
String basic1;
String basic2;
Expand All @@ -20,16 +14,9 @@ class _$BasicPartOfLibProps extends UiProps
String basic5;
}

// ignore: mixin_of_non_class,undefined_class
abstract class BasicPartOfLibState extends _$BasicPartOfLibState with _$BasicPartOfLibStateAccessorsMixin {
static const StateMeta meta = _$metaForBasicPartOfLibState;
}

@State()
class _$BasicPartOfLibState extends UiState
// ignore: mixin_of_non_class,undefined_class
with ExampleStateMixinClass, $ExampleStateMixinClass {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
with ExampleStateMixinClass {
String basicState;
}

Expand Down
10 changes: 0 additions & 10 deletions example/builder/part_of_basic_library_2.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
part of basic.library;

// ignore: mixin_of_non_class,undefined_class
class SuperPartOfLibProps extends _$SuperPartOfLibProps with _$SuperPartOfLibPropsAccessorsMixin {
static const PropsMeta meta = _$metaForSuperPartOfLibProps;
}

@AbstractProps()
class _$SuperPartOfLibProps extends UiProps {
String superProp;
Expand All @@ -26,11 +21,6 @@ abstract class SuperPartOfLibComponent<T extends SuperPartOfLibProps> extends Ui
@Factory()
UiFactory<SubPartOfLibProps> SubPartOfLib = _$SubPartOfLib;

// ignore: mixin_of_non_class,undefined_class
class SubPartOfLibProps extends _$SubPartOfLibProps with _$SubPartOfLibPropsAccessorsMixin {
static const PropsMeta meta = _$metaForSubPartOfLibProps;
}

@Props()
class _$SubPartOfLibProps extends SuperPartOfLibProps {
String subProp;
Expand Down
12 changes: 0 additions & 12 deletions example/builder/private_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,3 @@ class PrivateComponent extends UiStatefulComponent<_PrivateProps, _PrivateState>
}.toString());
}
}

// ignore: mixin_of_non_class, undefined_class
class _PrivateProps extends _$_PrivateProps with _$_PrivatePropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaFor_PrivateProps;
}

// ignore: mixin_of_non_class, undefined_class
class _PrivateState extends _$_PrivateState with _$_PrivateStateAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const StateMeta meta = _$metaFor_PrivateState;
}
7 changes: 0 additions & 7 deletions example/builder/private_factory_public_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,3 @@ class FormActionInputComponent extends UiComponent<FormActionInputProps> {
return Dom.div()(props.children);
}
}

// AF-#### This will be removed once the transition to Dart 2 is complete.
// ignore: mixin_of_non_class, undefined_class
class FormActionInputProps extends _$FormActionInputProps with _$FormActionInputPropsAccessorsMixin {
// ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value
static const PropsMeta meta = _$metaForFormActionInputProps;
}
8 changes: 2 additions & 6 deletions example/builder/props_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@ import 'package:over_react/over_react.dart';
part 'props_mixin.over_react.g.dart';

@PropsMixin()
abstract class ExamplePropsMixinClass implements UiProps {
abstract class _$ExamplePropsMixinClass implements UiProps {
@override
Map get props;

static const PropsMeta meta = _$metaForExamplePropsMixinClass;

String propMixin1;
}

@PropsMixin()
abstract class MixesInOtherMixinMixin<T extends Iterable, U>
abstract class _$MixesInOtherMixinMixin<T extends Iterable, U>
implements ExamplePropsMixinClass {
@override
Map get props;

static const PropsMeta meta = _$metaForMixesInOtherMixinMixin;

String otherPropMixin;
}

5 changes: 1 addition & 4 deletions example/builder/state_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ import 'package:over_react/over_react.dart';
part 'state_mixin.over_react.g.dart';

@StateMixin()
abstract class ExampleStateMixinClass implements UiState {
abstract class _$ExampleStateMixinClass implements UiState {
@override
Map get state;

static const StateMeta meta = _$metaForExampleStateMixinClass;

String stateMixin1;
}

Loading