diff --git a/CHANGELOG.md b/CHANGELOG.md index 48fe69775..f7d63ad73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # OverReact Changelog +## 1.30.2 + +> [Complete `1.30.2` Changeset](https://github.com/Workiva/over_react/compare/1.30.1...1.30.2) + +__Bug Fixes__ + +* [#222] Fix the initializer validation for component factories and the static + `meta` field on props and state classes. + ## 1.30.1 > [Complete `1.30.1` Changeset](https://github.com/Workiva/over_react/compare/1.30.0...1.30.1) diff --git a/doc/dart2_migration.md b/doc/dart2_migration.md index ea97dd905..5bde134dd 100644 --- a/doc/dart2_migration.md +++ b/doc/dart2_migration.md @@ -66,10 +66,10 @@ the builder will generate. ```diff @Factory() - UiFactory Foo; -+ UiFactory Foo = $Foo; ++ UiFactory Foo = _$Foo; ``` -In this example, the implementation for `$Foo` is generated by the over_react +In this example, the implementation for `_$Foo` is generated by the over_react builder. ### Props, State, AbstractProps, AbstractState @@ -204,10 +204,10 @@ Props and State classes and mixins, it can include a static `meta` field: ```dart // generated by builder class FooProps extends _$FooProps with _$FooPropsAccessorsMixin { - static PropsMeta meta = $metaForFooProps; + static PropsMeta meta = _$metaForFooProps; } -const PropsMeta $metaForFooProps = const PropsMeta( +const PropsMeta _$metaForFooProps = const PropsMeta( fields: ..., keys: ..., ); @@ -348,18 +348,18 @@ the caveat that the file does not actually exist by default. - UiFactory Foo; + UiFactory Foo = + // ignore: undefined_identifier -+ $Foo; ++ _$Foo; ``` -In this example, the implementation for `$Foo` is generated by either the +In this example, the implementation for `_$Foo` is generated by either the over_react builder or transformer, but in both cases it does not exist by default. -- **Dart 1** - the transformer inserts an implementation of `$Foo`, but it is +- **Dart 1** - the transformer inserts an implementation of `_$Foo`, but it is only available at runtime. Consequently, the `// ignore: undefined_identifier` comment is needed for a passing static analysis. - **Dart 2** - the generated `foo.over_react.g.dart` file will contain the - implementation of `$Foo`. Again, once Dart 1 support is dropped completely + implementation of `_$Foo`. Again, once Dart 1 support is dropped completely in over_react 2.0.0, the `// ignore: ...` comment can be dropped. ### Accompanying Classes for Props, State, AbstractProps, AbstractState @@ -375,7 +375,7 @@ default. + // ignore: mixin_of_non_class, undefined_class + _$FooPropsAccessorsMixin { + // ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value -+ static const PropsMeta meta = $metaForFooProps; ++ static const PropsMeta meta = _$metaForFooProps; + } ``` @@ -397,12 +397,12 @@ class while still supporting Dart 1, we have to temporarily add the static @PropsMixin() abstract class FooPropsMixin implements UiProps { + // ignore: undefined_identifier, undefined_class, const_initialized_with_non_constant_value -+ static const PropsMeta meta = $metaForFooPropsMixin; ++ static const PropsMeta meta = _$metaForFooPropsMixin; } ``` Again, an `// ignore: ...` comment is required for the analyzer because the -`$metaForFooPropsMixin` implementation will only be provided by the transformer +`_$metaForFooPropsMixin` implementation will only be provided by the transformer or the builder. Once Dart 1 support is completely dropped, this consumer-defined props mixin will be renamed to `_$FooPropsMixin` and the builder will handle generating `FooPropsMixin` along with its static `meta` field. diff --git a/pubspec.yaml b/pubspec.yaml index 7ce346f55..1addb6404 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: over_react -version: 1.30.1 +version: 1.30.2 description: A library for building statically-typed React UI components using Dart. homepage: https://github.com/Workiva/over_react/ authors: