Skip to content

Commit d7d57fd

Browse files
Merge pull request #418 from Workiva/release-over-react-3.1.2
RM-61377 Release over_react 3.1.2
2 parents 672a3e1 + 3016a78 commit d7d57fd

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

CHANGELOG.md

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

3+
## [3.1.2](https://github.com/Workiva/over_react/compare/3.1.1...3.1.2)
4+
5+
- Restore the public `getPropKey` function that was accidentally made private in the 3.1.0 release.
6+
37
## [3.1.1](https://github.com/Workiva/over_react/compare/3.1.0...3.1.1)
48

59
- Restore the `xmlLang`, `xmlSpace`, `y1`, `y2`, `y` members that were accidentally removed from `SvgProps` in the 3.1.0 release.

lib/over_react.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export 'src/util/key_constants.dart';
7070
export 'src/util/map_util.dart';
7171
export 'src/util/pretty_print.dart';
7272
export 'src/util/prop_errors.dart';
73+
export 'src/util/prop_key_util.dart';
7374
export 'src/util/react_util.dart';
7475
export 'src/util/react_wrappers.dart';
7576
export 'src/util/rem_util.dart';

lib/src/component_declaration/component_base_2.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ abstract class UiComponent2<TProps extends UiProps> extends react.Component2
253253
@override
254254
Map<String, react.PropValidator<TProps>> get propTypes => {};
255255

256+
/// Returns the string key of the [factory] prop accessed in [accessProp], including the namespace if one exists.
257+
///
258+
/// __DEPRECATED__: This method had to be deprecated and replaced with [keyForProp] because of the way
259+
/// that shadowing works in Dart when a top-level function name matches the name of an instance method.
260+
@Deprecated('4.0.0')
261+
String getPropKey(void Function(TProps props) accessProp) => keyForProp(accessProp);
262+
256263
/// Returns the string key of the [factory] prop accessed in [accessProp], including the namespace if one exists.
257264
///
258265
/// Intended for use within [propTypes].
@@ -277,7 +284,7 @@ abstract class UiComponent2<TProps extends UiProps> extends react.Component2
277284
/// }
278285
/// }
279286
/// ```
280-
String getPropKey(void Function(TProps props) accessProp) => prop_key_util.getPropKey(accessProp, typedPropsFactory);
287+
String keyForProp(void Function(TProps props) accessProp) => prop_key_util.getPropKey(accessProp, typedPropsFactory);
281288

282289
// ***************************************************************************
283290
//

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: over_react
2-
version: 3.1.1
2+
version: 3.1.2
33
description: A library for building statically-typed React UI components using Dart.
44
homepage: https://github.com/Workiva/over_react/
55
authors:

test/over_react/component_declaration/builder_integration_tests/component2/constant_required_accessor_integration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class _$ComponentTestProps extends UiProps {
252252
class ComponentTestComponent extends UiComponent2<ComponentTestProps> {
253253
@override
254254
get propTypes => {
255-
getPropKey((p) => p.requiredAndLengthLimited): (props, info) {
255+
this.getPropKey((p) => p.requiredAndLengthLimited): (props, info) {
256256
final length = props.requiredAndLengthLimited?.length;
257257
if (length != 2) {
258258
return PropError.value(length, info.propName, 'must have a length of 2');

test/over_react/component_declaration/builder_integration_tests/component2/required_accessor_integration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class _$ComponentTestProps extends UiProps {
256256
class ComponentTestComponent extends UiComponent2<ComponentTestProps> {
257257
@override
258258
get propTypes => {
259-
getPropKey((p) => p.requiredAndLengthLimited): (props, info) {
259+
keyForProp((p) => p.requiredAndLengthLimited): (props, info) {
260260
final length = props.requiredAndLengthLimited?.length;
261261
if (length != 2) {
262262
return PropError.value(length, info.propName, 'must have a length of 2');

web/component2/src/demo_components/prop_validation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PropTypesTestComponent extends UiComponent2<PropTypesTestProps> {
3333
// This is closer to what it looks like in JS, but might be confusing syntax.
3434
@override
3535
get propTypes => {
36-
getPropKey((p) => p.twoObjects): (props, info) {
36+
keyForProp((p) => p.twoObjects): (props, info) {
3737
final length = props.twoObjects?.length;
3838
if (length != 2) {
3939
return PropError.value(length, info.propName, 'must have a length of 2');

0 commit comments

Comments
 (0)