Workiva / react-dart

Dart Bindings for React JS
BSD 2-Clause "Simplified" License
413 stars 67 forks source link

Release react 5.5.0 #265

Closed aaronlademann-wf closed 4 years ago

aaronlademann-wf commented 4 years ago

This release of react includes...

New Features

Fixes / Updates


Changesets committed directly to the WIP branch that need review:

  1. https://github.com/cleandart/react-dart/pull/265/files/cf43b36..066c138
  2. https://github.com/cleandart/react-dart/pull/265/files/9714657..75d6611

(Click on "Changes from X commits..." to see commit messages for more context)

Screen Shot 2020-07-29 at 12 19 04 PM
semveraudit-wf commented 4 years ago

Public API Changes

Recommendation: :bangbang: Major version bump (fyi @Workiva/semver-audit-group )

@@ line 6: package:react/src/prop_validator.dart @@
-  typedef PropValidator<T> = Error Function(T props, PropValidatorInfo info)
+  typedef PropValidator<TProps> = Error Function(TProps props, PropValidatorInfo info)
// `type` of `props` has changed.
// Changing a parameter signature is a major change.
@@ line 104: package:react/src/context.dart @@
-  Context createContext<TValue>([TValue defaultValue, int Function(TValue, TValue) calculateChangedBits])
+  Context<TValue> createContext<TValue>([TValue defaultValue, int Function(TValue, TValue) calculateChangedBits])
// `return_type` of `createContext` has changed from `Context` to `Context<TValue>`.
// Changing a top-level function is a major change.
@@ line 503: package:react/react.dart @@
abstract class Component2 implements Component
-     Context get contextType
+     Context<dynamic> get contextType
//    `type` of `contextType` has changed from `Context` to `Context<dynamic>`.
//    Changing a class field is a major change.
@@ line 839: package:react/react_client.dart @@
class ReactDomComponentFactoryProxy extends ReactComponentFactoryProxy
-     ReactDomComponentFactoryProxy ReactDomComponentFactoryProxy(dynamic name)
+     ReactDomComponentFactoryProxy ReactDomComponentFactoryProxy(String name)
//    `type` of `name` has changed.
//    Changing a parameter signature is a major change.
@@ line 125: package:react/react_client/react_interop.dart @@
-  ReactJsComponentFactoryProxy forwardRef(dynamic Function(Map<dynamic, dynamic>, Ref<dynamic>) wrapperFunction)
+  ReactJsComponentFactoryProxy forwardRef(dynamic Function(Map<dynamic, dynamic>, Ref<dynamic>) wrapperFunction, {String displayName = 'Anonymous'})
// `displayName` was added.
// Adding an optional parameter is a minor change.
Click to see 30 more API Changes

--- ```diff @@ line 2742: package:react/react.dart @@ - void setReactConfiguration(dynamic domCreator, dynamic customRegisterComponent, {ReactDartComponentFactoryProxy2 Function(Component2 Function(), {Component2Bridge Function(Component2) bridgeFactory, Iterable skipMethods}) customRegisterComponent2}) + void setReactConfiguration(dynamic domCreator, dynamic customRegisterComponent, {ReactDartComponentFactoryProxy2 Function(Component2 Function(), {Component2Bridge Function(Component2) bridgeFactory, Iterable skipMethods}) customRegisterComponent2, ReactDartFunctionComponentFactoryProxy Function(dynamic Function(JsBackedMap), {String displayName}) customRegisterFunctionComponent}) // `customRegisterFunctionComponent` was added. // Adding an optional parameter is a minor change. ``` ```diff @@ line 125: package:react/react_client/react_interop.dart @@ - ReactJsComponentFactoryProxy forwardRef(dynamic Function(Map, Ref) wrapperFunction) + ReactJsComponentFactoryProxy forwardRef(dynamic Function(Map, Ref) wrapperFunction, {String displayName = 'Anonymous'}) // `displayName` was added. // Adding an optional parameter is a minor change. ``` ```diff @@ line 1968: package:react/react.dart @@ + ReactDartFunctionComponentFactoryProxy Function(dynamic Function(JsBackedMap), {String displayName}) registerFunctionComponent // Adding a top-level variable is a minor change. ``` ```diff @@ line 670: package:react/react_client/react_interop.dart @@ + dynamic get jsNull // Adding a top-level variable is a minor change. ``` ```diff @@ line 395: package:react/hooks.dart @@ + Ref useRef([T initialValue]) // Adding a top-level function is a minor change. ``` ```diff @@ line 293: package:react/react_client/react_interop.dart @@ + ReactJsComponentFactoryProxy memo(ReactDartFunctionComponentFactoryProxy factory, {bool Function(Map, Map) areEqual}) // Adding a top-level function is a minor change. ``` ```diff @@ line 293: package:react/react_client/react_interop.dart @@ + ReactJsComponentFactoryProxy memo(ReactDartFunctionComponentFactoryProxy factory, {bool Function(Map, Map) areEqual}) // Adding a top-level function is a minor change. ``` ```diff @@ line 143: package:react/hooks.dart @@ + void useEffect(dynamic Function() sideEffect, [List dependencies]) // Adding a top-level function is a minor change. ``` ```diff @@ line 330: package:react/hooks.dart @@ + T useCallback(T callback, List dependencies) // Adding a top-level function is a minor change. ``` ```diff @@ line 428: package:react/hooks.dart @@ + T useMemo(T Function() createFunction, [List dependencies]) // Adding a top-level function is a minor change. ``` ```diff @@ line 33: package:react/react.dart @@ + typedef DartFunctionComponent = dynamic Function(JsBackedMap props) // Adding a typedef is a minor change. ``` ```diff @@ line 80: package:react/hooks.dart @@ + StateHook useState(T initialValue) // Adding a top-level function is a minor change. ``` ```diff + react/react_client/zone.dart // Adding an entry point is a minor change. ``` ```diff @@ line 62: package:react/react_client/component_factory.dart @@ + Map unconvertJsProps(dynamic instance) // Adding a top-level function is a minor change. ``` ```diff + react/react_client/component_factory.dart // Adding an entry point is a minor change. ``` ```diff @@ line 47: package:react/react_client/component_factory.dart @@ + Function unconvertJsEventHandler(Function jsConvertedEventHandler) // Adding a top-level function is a minor change. ``` ```diff + react/hooks.dart // Adding an entry point is a minor change. ``` ```diff @@ line 240: package:react/hooks.dart @@ + ReducerHook useReducer(TState Function(TState, TAction) reducer, TState initialState) // Adding a top-level function is a minor change. ``` ```diff @@ line 675: package:react/react_client/react_interop.dart @@ + dynamic get jsUndefined // Adding a top-level variable is a minor change. ``` ```diff @@ line 532: package:react/hooks.dart @@ + void useImperativeHandle(Ref ref, dynamic Function() createHandle, [List dependencies]) // Adding a top-level function is a minor change. ``` ```diff @@ line 294: package:react/hooks.dart @@ + ReducerHook useReducerLazy(TState Function(TState, TAction) reducer, TInit initialArg, TState Function(TInit) init) // Adding a top-level function is a minor change. ``` ```diff @@ line 16: package:react/src/typedefs.dart @@ + typedef JsFunctionComponent = dynamic Function(JsMap props, [JsMap legacyContext]) // Adding a typedef is a minor change. ``` ```diff @@ line 27: package:react/react_client/component_factory.dart @@ + dynamic listifyChildren(dynamic children) // Adding a top-level function is a minor change. ``` ```diff @@ line 46: package:react/react.dart @@ + typedef FunctionComponentRegistrar = ReactDartFunctionComponentFactoryProxy Function(dynamic Function(JsBackedMap) componentFactory, {String displayName}) // Adding a typedef is a minor change. ``` ```diff @@ line 95: package:react/react_client/js_interop_helpers.dart @@ + Expando get isRawJsFunctionFromProps // Adding a top-level variable is a minor change. ``` ```diff @@ line 606: package:react/hooks.dart @@ + dynamic useDebugValue(T value, [dynamic Function(T) format]) // Adding a top-level function is a minor change. ``` ```diff @@ line 103: package:react/hooks.dart @@ + StateHook useStateLazy(T Function() init) // Adding a top-level function is a minor change. ``` ```diff @@ line 359: package:react/hooks.dart @@ + T useContext(Context context) // Adding a top-level function is a minor change. ``` ```diff @@ line 464: package:react/hooks.dart @@ + void useLayoutEffect(dynamic Function() sideEffect, [List dependencies]) // Adding a top-level function is a minor change. ``` ```diff @@ line 90: package:react/react_client/component_factory.dart @@ + mixin JsBackedMapComponentFactoryMixin on ReactComponentFactoryProxy // Adding a class is a minor change. + static JsMap generateExtendedJsProps(Map props) // Adding a method is a minor change. + ReactElement build(Map props, [List childrenArgs = const []]) // Adding a method is a minor change. From package:react/react.dart + dynamic call(Map props, [dynamic c1 = _notSpecified, dynamic c2 = _notSpecified, dynamic c3 = _notSpecified, dynamic c4 = _notSpecified, dynamic c5 = _notSpecified, dynamic c6 = _notSpecified, dynamic c7 = _notSpecified, dynamic c8 = _notSpecified, dynamic c9 = _notSpecified, dynamic c10 = _notSpecified, dynamic c11 = _notSpecified, dynamic c12 = _notSpecified, dynamic c13 = _notSpecified, dynamic c14 = _notSpecified, dynamic c15 = _notSpecified, dynamic c16 = _notSpecified, dynamic c17 = _notSpecified, dynamic c18 = _notSpecified, dynamic c19 = _notSpecified, dynamic c20 = _notSpecified, dynamic c21 = _notSpecified, dynamic c22 = _notSpecified, dynamic c23 = _notSpecified, dynamic c24 = _notSpecified, dynamic c25 = _notSpecified, dynamic c26 = _notSpecified, dynamic c27 = _notSpecified, dynamic c28 = _notSpecified, dynamic c29 = _notSpecified, dynamic c30 = _notSpecified, dynamic c31 = _notSpecified, dynamic c32 = _notSpecified, dynamic c33 = _notSpecified, dynamic c34 = _notSpecified, dynamic c35 = _notSpecified, dynamic c36 = _notSpecified, dynamic c37 = _notSpecified, dynamic c38 = _notSpecified, dynamic c39 = _notSpecified, dynamic c40 = _notSpecified]) // Adding a method is a minor change. + dynamic get type // Adding a field is a minor change. ``` ---

15 more changes could not be displayed on this comment. Click here to view all changes.

Showing results for 066c13863c6b54809a2947696e8746091c26251a

Powered by semver-audit-service. Please report any problems by filing an issue. Reported by the dart semver audit client 2.2.0 Browse public API.

greglittlefield-wf commented 4 years ago

Semver changes look good to me, and should not actually be considered major. Specifically

  • Passing any other type into ReactDomComponentFactoryProxy would have resulted in a runtime error,
  • Previously returning Context<dynamic> from createContext is considered a bug, and changing it shouldn't cause issues