Skip to content

Commit 8eeb5cd

Browse files
Merge pull request #856 from Workiva/null-safety
FED-1713 Null safety: perform migration, set up base for 5.0.0 integration branch
2 parents d6b302e + a15bd8f commit 8eeb5cd

File tree

544 files changed

+8522
-9200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+8522
-9200
lines changed

.github/workflows/dart_ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ jobs:
5252
name: Build generated files / precompile DDC assets
5353
run: |
5454
dart run build_runner build --delete-conflicting-outputs -o ddc_precompiled
55+
if: always() && steps.install.outcome == 'success'
56+
57+
- name: Verify that generated files are up-to-date
58+
run: |
5559
if [ ${{ matrix.sdk }} = '2.18.7' ]; then
5660
git diff --exit-code
5761
else
5862
# Don't check these generated files for other SDKs, since they may generate differently
5963
# due to different resolved dependencies.
6064
git diff --exit-code -- ":(exclude)test/mockito.mocks.dart" ":(exclude)test/over_react/component_declaration/redux_component_test/test_reducer.g.dart"
6165
fi
62-
if: always() && steps.install.outcome == 'success'
66+
if: always() && steps.install.outcome == 'success' && steps.install.build == 'success'
6367

6468
# Analyze again after generated files are created to verify that those generated classes don't cause analysis errors
6569
- name: Analyze project source (post-build)

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# OverReact Changelog
22

3+
## 5.0.0 (unreleased, work in progress)
4+
- Migrate to null safety
5+
- Support generating code for null-safe libraries (while retaining support for non-null-safe libraries)
6+
- Add ability to declare required, optionally-non-nullable props and state fields via `late`
7+
8+
#### Analyzer plugin
9+
- Add new lint, `over_react_required_prop`
10+
- Warns for missing `late` required props
11+
- Hints for missing `@requiredProp` required props (these are deprecated in favor of `late`)
12+
- Reinstate functionality disabled in over_react 4.8.3. Since newer Dart SDKs require sound null safety in analyzer plugins, this code couldn't be run since it depended on over_react code, which was not itself null safe.
13+
- Diagnostics (AKA lints)
14+
- `over_react_boilerplate_error`, `over_react_boilerplate_warning`
15+
- `over_react_incorrect_doc_comment_location`
16+
- Assist for toggling class component statefulness
17+
18+
### Breaking changes
19+
- API removals:
20+
- BuiltReduxUiComponent
21+
- forwardRef (not to be confused with `uiForwardRef`)
22+
- registerComponent and registerComponent2 `displayName` argument
23+
- The following props classes can no longer be extended or instantiated directly (like most components). To instantiate them, use the factory instead.
24+
- FragmentProps
25+
- StrictModeProps
26+
- ReduxProviderProps (for extension, mix in ReduxProviderPropsMixin instead)
27+
- `PropsMeta`/`StateMeta` constructor arguments `fields` and `keys` are now required
28+
329
## [4.10.3](https://github.com/Workiva/over_react/compare/4.10.2...4.10.3)
430
- [#846] Update internals to prepare for react-dart 7.0.0
531

analysis_options.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ analyzer:
1919
# Workaround for https://github.com/dart-lang/sdk/issues/51087
2020
# TODO remove once we can run on Dart 2.19 (blocked by https://github.com/dart-lang/sdk/issues/51128 or working around it by upgrading to analyzer ^5.1.0)
2121
part_of_different_library: ignore
22+
cast_nullable_to_non_nullable: warning
2223
linter:
2324
rules:
25+
cast_nullable_to_non_nullable: true
2426
# -------------------
2527
# Pedantic
2628
# -------------------

app/over_react_redux/todo_client/test/unit/browser/components/connected_todo_list_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ main() {
7373
for (var todo in component.props.todos) {
7474
final listItemComponent = getComponentByTestId(displayListInstance, 'todo_client.TodoListItem.${todo.id}');
7575
expect(listItemComponent, isA<TodoListItemComponent>());
76-
TodoListItemProps props = listItemComponent.props;
76+
var props = listItemComponent.props;
7777
expect(props.model, todo);
7878
}
7979
});

app/over_react_redux/todo_client/test/unit/browser/components/connected_user_list_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ main() {
7373
for (var user in component.props.users) {
7474
final listItemComponent = getComponentByTestId(displayListInstance, 'todo_client.UserListItem.${user.id}');
7575
expect(listItemComponent, isA<UserListItemComponent>());
76-
UserListItemProps props = listItemComponent.props;
76+
var props = listItemComponent.props;
7777
expect(props.model, user);
7878
}
7979
});

app/over_react_redux/todo_client/test/unit/browser/components/display_list_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ main() {
2929
expect(emptyListInstance, isNotNull);
3030
expect(getDartComponent(emptyListInstance), isA<EmptyViewComponent>());
3131

32-
EmptyViewProps emptyViewProps = getDartComponent(emptyListInstance).props;
32+
var emptyViewProps = getDartComponent(emptyListInstance).props;
3333
expect(emptyViewProps.type, EmptyViewType.VBLOCK);
3434
expect(emptyViewProps.header, 'No ${jacket.getDartInstance().props.listItemTypeDescription} to show');
3535
expect(emptyViewProps.glyph, isNotNull);

build.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ targets:
5555
# checked in.
5656
- "example/boilerplate_versions/dart2_only/**"
5757

58-
built_value_generator|built_value:
59-
generate_for:
60-
include:
61-
- test/over_react/component_declaration/redux_component_test/test_reducer.dart
62-
63-
built_redux|built_redux:
64-
generate_for:
65-
include:
66-
- test/over_react/component_declaration/redux_component_test/test_reducer.dart
67-
6858
# build_vm_compilers|entrypoint:
6959
# generate_for:
7060
# include:

dart_dependency_validator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
exclude:
2+
- app/**
3+
- tools/**
4+
ignore:
5+
- mockito
6+
allow_pins: true

dart_test.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,15 @@ presets:
3434

3535
travis:
3636
reporter: expanded
37+
38+
tags:
39+
# Tests that should only run in DDC (Dart Dev Compiler, AKA dartdevc).
40+
ddc: {}
41+
# Tests that should only run in dart2js.
42+
no-ddc: {}
43+
# Tests that can pass in DDC even if something goes wrong;
44+
# these tests must be run in dart2js in order to properly validate behavior.
45+
ddc-false-positive: {}
46+
# Tests that represent a case of undesirable JS interop behavior that's
47+
# either unavoidable or exists as a tradeoff for improved behavior in other cases.
48+
js-interop-tradeoff: {}

example/boilerplate_versions/backwards_compatible/basic.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class BasicProps extends _$BasicProps with _$BasicPropsAccessorsMixin {
3333
class _$BasicProps extends UiProps {
3434
@Deprecated('This is deprecated')
3535
@requiredProp
36-
String basicProp;
36+
String? basicProp;
3737

38-
String basic1;
39-
String basic2;
40-
String basic3;
41-
String basic4;
42-
String basic5;
38+
String? basic1;
39+
String? basic2;
40+
String? basic3;
41+
String? basic4;
42+
String? basic5;
4343
}
4444

4545
@Component()

0 commit comments

Comments
 (0)