-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #865 from Workiva/gold-file-workflow-improvements
FED-1956 Gold file workflow improvements
- Loading branch information
Showing
14 changed files
with
523 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Updating golds | ||
|
||
To re-generate the gold files in this directory using the over_react builder, run: | ||
```sh | ||
dart tool/update_gold_output_files.dart | ||
``` | ||
|
||
If that deletes other generated files throughout over_react (which usually only happens after it prompts you about conflicting outputs), you can restore them by running a build: | ||
```sh | ||
dart run build_runner build | ||
``` |
78 changes: 78 additions & 0 deletions
78
test_fixtures/gold_output_files/backwards_compatible/props_mixin.over_react.g.dart.goldFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
//@dart=2.11 | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
|
||
// ignore_for_file: deprecated_member_use_from_same_package, unnecessary_null_in_if_null_operators, prefer_null_aware_operators | ||
part of 'props_mixin.dart'; | ||
|
||
// ************************************************************************** | ||
// OverReactBuilder (package:over_react/src/builder.dart) | ||
// ************************************************************************** | ||
|
||
abstract class $ExamplePropsMixinClass implements ExamplePropsMixinClass { | ||
@override | ||
Map get props; | ||
|
||
static const PropsMeta meta = _$metaForExamplePropsMixinClass; | ||
|
||
/// <!-- Generated from [ExamplePropsMixinClass.propMixin1] --> | ||
@override | ||
String get propMixin1 => | ||
(props[_$key__propMixin1__ExamplePropsMixinClass] ?? null) as String; | ||
|
||
/// <!-- Generated from [ExamplePropsMixinClass.propMixin1] --> | ||
@override | ||
set propMixin1(String value) => | ||
props[_$key__propMixin1__ExamplePropsMixinClass] = value; | ||
/* GENERATED CONSTANTS */ | ||
static const PropDescriptor _$prop__propMixin1__ExamplePropsMixinClass = | ||
PropDescriptor(_$key__propMixin1__ExamplePropsMixinClass); | ||
static const String _$key__propMixin1__ExamplePropsMixinClass = | ||
'ExamplePropsMixinClass.propMixin1'; | ||
|
||
static const List<PropDescriptor> $props = [ | ||
_$prop__propMixin1__ExamplePropsMixinClass | ||
]; | ||
static const List<String> $propKeys = [ | ||
_$key__propMixin1__ExamplePropsMixinClass | ||
]; | ||
} | ||
|
||
const PropsMeta _$metaForExamplePropsMixinClass = PropsMeta( | ||
fields: $ExamplePropsMixinClass.$props, | ||
keys: $ExamplePropsMixinClass.$propKeys, | ||
); | ||
|
||
abstract class $MixesInOtherMixinMixin<T extends Iterable, U> | ||
implements MixesInOtherMixinMixin<T, U> { | ||
@override | ||
Map get props; | ||
|
||
static const PropsMeta meta = _$metaForMixesInOtherMixinMixin; | ||
|
||
/// <!-- Generated from [MixesInOtherMixinMixin.otherPropMixin] --> | ||
@override | ||
String get otherPropMixin => | ||
(props[_$key__otherPropMixin__MixesInOtherMixinMixin] ?? null) as String; | ||
|
||
/// <!-- Generated from [MixesInOtherMixinMixin.otherPropMixin] --> | ||
@override | ||
set otherPropMixin(String value) => | ||
props[_$key__otherPropMixin__MixesInOtherMixinMixin] = value; | ||
/* GENERATED CONSTANTS */ | ||
static const PropDescriptor _$prop__otherPropMixin__MixesInOtherMixinMixin = | ||
PropDescriptor(_$key__otherPropMixin__MixesInOtherMixinMixin); | ||
static const String _$key__otherPropMixin__MixesInOtherMixinMixin = | ||
'MixesInOtherMixinMixin.otherPropMixin'; | ||
|
||
static const List<PropDescriptor> $props = [ | ||
_$prop__otherPropMixin__MixesInOtherMixinMixin | ||
]; | ||
static const List<String> $propKeys = [ | ||
_$key__otherPropMixin__MixesInOtherMixinMixin | ||
]; | ||
} | ||
|
||
const PropsMeta _$metaForMixesInOtherMixinMixin = PropsMeta( | ||
fields: $MixesInOtherMixinMixin.$props, | ||
keys: $MixesInOtherMixinMixin.$propKeys, | ||
); |
43 changes: 43 additions & 0 deletions
43
test_fixtures/gold_output_files/backwards_compatible/state_mixin.over_react.g.dart.goldFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//@dart=2.11 | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
|
||
// ignore_for_file: deprecated_member_use_from_same_package, unnecessary_null_in_if_null_operators, prefer_null_aware_operators | ||
part of 'state_mixin.dart'; | ||
|
||
// ************************************************************************** | ||
// OverReactBuilder (package:over_react/src/builder.dart) | ||
// ************************************************************************** | ||
|
||
abstract class $ExampleStateMixinClass implements ExampleStateMixinClass { | ||
@override | ||
Map get state; | ||
|
||
static const StateMeta meta = _$metaForExampleStateMixinClass; | ||
|
||
/// <!-- Generated from [ExampleStateMixinClass.stateMixin1] --> | ||
@override | ||
String get stateMixin1 => | ||
(state[_$key__stateMixin1__ExampleStateMixinClass] ?? null) as String; | ||
|
||
/// <!-- Generated from [ExampleStateMixinClass.stateMixin1] --> | ||
@override | ||
set stateMixin1(String value) => | ||
state[_$key__stateMixin1__ExampleStateMixinClass] = value; | ||
/* GENERATED CONSTANTS */ | ||
static const StateDescriptor _$prop__stateMixin1__ExampleStateMixinClass = | ||
StateDescriptor(_$key__stateMixin1__ExampleStateMixinClass); | ||
static const String _$key__stateMixin1__ExampleStateMixinClass = | ||
'ExampleStateMixinClass.stateMixin1'; | ||
|
||
static const List<StateDescriptor> $state = [ | ||
_$prop__stateMixin1__ExampleStateMixinClass | ||
]; | ||
static const List<String> $stateKeys = [ | ||
_$key__stateMixin1__ExampleStateMixinClass | ||
]; | ||
} | ||
|
||
const StateMeta _$metaForExampleStateMixinClass = StateMeta( | ||
fields: $ExampleStateMixinClass.$state, | ||
keys: $ExampleStateMixinClass.$stateKeys, | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
116 changes: 116 additions & 0 deletions
116
...gold_output_files/dart2_only/missing_over_react_g_part/library.over_react.g.dart.goldFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
//@dart=2.11 | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
|
||
// ignore_for_file: deprecated_member_use_from_same_package, unnecessary_null_in_if_null_operators, prefer_null_aware_operators | ||
part of 'library.dart'; | ||
|
||
// ************************************************************************** | ||
// OverReactBuilder (package:over_react/src/builder.dart) | ||
// ************************************************************************** | ||
|
||
// React component factory implementation. | ||
// | ||
// Registers component implementation and links type meta to builder factory. | ||
final $BasicPartOfLibComponentFactory = registerComponent( | ||
() => _$BasicPartOfLibComponent(), | ||
builderFactory: _$BasicPartOfLib, | ||
componentClass: BasicPartOfLibComponent, | ||
isWrapper: false, | ||
parentType: null, | ||
); | ||
|
||
abstract class _$BasicPartOfLibPropsAccessorsMixin | ||
implements _$BasicPartOfLibProps { | ||
@override | ||
Map get props; | ||
|
||
/// <!-- Generated from [_$BasicPartOfLibProps.basicProp] --> | ||
@override | ||
String get basicProp => | ||
(props[_$key__basicProp___$BasicPartOfLibProps] ?? null) as String; | ||
|
||
/// <!-- Generated from [_$BasicPartOfLibProps.basicProp] --> | ||
@override | ||
set basicProp(String value) => | ||
props[_$key__basicProp___$BasicPartOfLibProps] = value; | ||
/* GENERATED CONSTANTS */ | ||
static const PropDescriptor _$prop__basicProp___$BasicPartOfLibProps = | ||
PropDescriptor(_$key__basicProp___$BasicPartOfLibProps); | ||
static const String _$key__basicProp___$BasicPartOfLibProps = | ||
'BasicPartOfLibProps.basicProp'; | ||
|
||
static const List<PropDescriptor> $props = [ | ||
_$prop__basicProp___$BasicPartOfLibProps | ||
]; | ||
static const List<String> $propKeys = [ | ||
_$key__basicProp___$BasicPartOfLibProps | ||
]; | ||
} | ||
|
||
const PropsMeta _$metaForBasicPartOfLibProps = PropsMeta( | ||
fields: _$BasicPartOfLibPropsAccessorsMixin.$props, | ||
keys: _$BasicPartOfLibPropsAccessorsMixin.$propKeys, | ||
); | ||
|
||
class BasicPartOfLibProps extends _$BasicPartOfLibProps | ||
with _$BasicPartOfLibPropsAccessorsMixin { | ||
static const PropsMeta meta = _$metaForBasicPartOfLibProps; | ||
} | ||
|
||
_$$BasicPartOfLibProps _$BasicPartOfLib([Map backingProps]) => | ||
_$$BasicPartOfLibProps(backingProps); | ||
|
||
// Concrete props implementation. | ||
// | ||
// Implements constructor and backing map, and links up to generated component factory. | ||
class _$$BasicPartOfLibProps extends _$BasicPartOfLibProps | ||
with _$BasicPartOfLibPropsAccessorsMixin | ||
implements BasicPartOfLibProps { | ||
// This initializer of `_props` to an empty map, as well as the reassignment | ||
// of `_props` in the constructor body is necessary to work around a DDC bug: https://github.com/dart-lang/sdk/issues/36217 | ||
_$$BasicPartOfLibProps(Map backingMap) : this._props = {} { | ||
this._props = backingMap ?? {}; | ||
} | ||
|
||
/// The backing props map proxied by this class. | ||
@override | ||
Map get props => _props; | ||
Map _props; | ||
|
||
/// Let `UiProps` internals know that this class has been generated. | ||
@override | ||
bool get $isClassGenerated => true; | ||
|
||
/// The `ReactComponentFactory` associated with the component built by this class. | ||
@override | ||
ReactComponentFactoryProxy get componentFactory => | ||
super.componentFactory ?? $BasicPartOfLibComponentFactory; | ||
|
||
/// The default namespace for the prop getters/setters generated for this class. | ||
@override | ||
String get propKeyNamespace => 'BasicPartOfLibProps.'; | ||
} | ||
|
||
// Concrete component implementation mixin. | ||
// | ||
// Implements typed props/state factories, defaults `consumedPropKeys` to the keys | ||
// generated for the associated props class. | ||
class _$BasicPartOfLibComponent extends BasicPartOfLibComponent { | ||
@override | ||
_$$BasicPartOfLibProps typedPropsFactory(Map backingMap) => | ||
_$$BasicPartOfLibProps(backingMap); | ||
|
||
/// Let `UiComponent` internals know that this class has been generated. | ||
@override | ||
bool get $isClassGenerated => true; | ||
|
||
@override | ||
String get displayName => 'BasicPartOfLib'; | ||
|
||
/// The default consumed props, taken from _$BasicPartOfLibProps. | ||
/// Used in `*ConsumedProps` methods if [consumedProps] is not overridden. | ||
@override | ||
final List<ConsumedProps> $defaultConsumedProps = const [ | ||
_$metaForBasicPartOfLibProps | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.