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

AF-3738 AF-3737 Release over_react 1.30.2 #223

Merged
merged 3 commits into from
Jan 10, 2019
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
22 changes: 11 additions & 11 deletions doc/dart2_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ the builder will generate.
```diff
@Factory()
- UiFactory<FooProps> Foo;
+ UiFactory<FooProps> Foo = $Foo;
+ UiFactory<FooProps> 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
Expand Down Expand Up @@ -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: ...,
);
Expand Down Expand Up @@ -348,18 +348,18 @@ the caveat that the file does not actually exist by default.
- UiFactory<FooProps> Foo;
+ UiFactory<FooProps> 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
Expand All @@ -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;
+ }
```

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down