Skip to content

CPLAT-12665 Remove Synthetic Event Wrappers #284

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

Merged

Conversation

joebingham-wk
Copy link
Collaborator

@joebingham-wk joebingham-wk commented Nov 9, 2020

Motivation

In order to make updating to React 17 easy, we need to change the internals of the publicly exposed event helper utils to construct anonymous interop object as opposed to using the wrapper constructors.

NOTE: There was some follow up work discovered while working the ticket. These are:

  • Some fields are missing from our event interop classes. These are described in this ticket
  • SyntheticFormEvent is not a class in React.dart. It still works as a wrapper, but it seems like an opportunity to clean up some dead code since the interface is empty anyway. That discussion can be found here.

Changes

  • change the create{x}Event utilities to create maps cast as the synthetic event type
  • update the SyntheticEventTypeHelpers helpers to use duck typing instead of is.
  • Add a helper for SyntheticMouseEvent.dataTransfer that takes the interoped field and wraps it in a Dart wrapper, running the conversion logic that was used for the original synthetic event Dart classes

QA

  • verify test coverage still properly reflects how the utilities should be used. Tests for the SyntheticEventTypeHelpers helpers were added
  • verify upgrading between the APIs is as seamless as possible. Below are two test cases that showed what the usage looks like with React.dart stable as well as with the React 17 WIP branches.

@joebingham-wk joebingham-wk changed the base branch from master to 6.0.0-wip November 9, 2020 15:53
@joebingham-wk joebingham-wk changed the title CPLAT-12470 Remove Synthetic Event Wrappers CPLAT-12665 Remove Synthetic Event Wrappers Nov 10, 2020
@joebingham-wk joebingham-wk marked this pull request as ready for review November 10, 2020 22:13
external EventTarget get relatedTarget;
}

/// A [SyntheticEvent] wrapper that represents a form event.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't exist in React.js and I feel like it should be removed. I started to remove it, but because it's used in several places it felt like that could be its own ticket. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to its own ticket

Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick pass before I sign off for the day

Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more small comments and then some nits around documentation style that apply to a bunch of the comments.

I'd be happy to lend a hand in updating those doc comments, so just let me know!

Comment on lines 777 to 779
/// __NOTE:__ This getter is here for completeness, but because the interface for form events
/// is the same as that of a [SyntheticEvent] (the base for all other synthetic event types),
/// via Duck Typing every [SyntheticEvent] is considered a [SyntheticFormEvent].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if this is the case, I feel like we should just omit it so that consumers don't use it without reading the full doc comment and assume it does something other than always return true.

Or, another thought, could we use the set of event types to determine what type of event it is?
From https://reactjs.org/docs/events.html#form-events:

onChange onInput onInvalid onReset onSubmit 

But, taking a look on SourceGraph, it's only used in one test, and could be replaced with a not-null-check, so I'd lean toward removing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove it!

With removing it, we'd want to go back and deprecate it in the stable line, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 067e282!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With removing it, we'd want to go back and deprecate it in the stable line, right?

Ooh, nice catch, I didn't think about that. Yup!

@greglittlefield-wf
Copy link
Collaborator

Public API Changes

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

@@ line 301: package:react/src/react_client/event_factory.dart @@
-  SyntheticAnimationEvent syntheticAnimationEventFactory(SyntheticAnimationEvent e)
// Removing a top-level function is a major change.
@@ line 216: package:react/src/react_client/event_factory.dart @@
-  SyntheticMouseEvent syntheticMouseEventFactory(SyntheticMouseEvent e)
// Removing a top-level function is a major change.
@@ line 17: package:react/src/react_client/event_factory.dart @@
-  SyntheticClipboardEvent syntheticClipboardEventFactory(SyntheticClipboardEvent e)
// Removing a top-level function is a major change.
@@ line 346: package:react/src/react_client/event_factory.dart @@
-  SyntheticWheelEvent syntheticWheelEventFactory(SyntheticWheelEvent e)
// Removing a top-level function is a major change.
@@ line 37: package:react/src/react_client/event_factory.dart @@
-  SyntheticCompositionEvent syntheticCompositionEventFactory(SyntheticCompositionEvent e)
// Removing a top-level function is a major change.
Click to see 28 more API Changes


@@ line 118: package:react/src/react_client/event_factory.dart @@
-  SyntheticDataTransfer syntheticDataTransferFactory(Object dt)
// Removing a top-level function is a major change.
@@ line 107: package:react/src/react_client/event_factory.dart @@
-  SyntheticFormEvent syntheticFormEventFactory(SyntheticFormEvent e)
// Removing a top-level function is a major change.
@@ line 278: package:react/src/react_client/event_factory.dart @@
-  SyntheticTransitionEvent syntheticTransitionEventFactory(SyntheticTransitionEvent e)
// Removing a top-level function is a major change.
@@ line 57: package:react/src/react_client/event_factory.dart @@
-  SyntheticKeyboardEvent syntheticKeyboardEventFactory(SyntheticKeyboardEvent e)
// Removing a top-level function is a major change.
@@ line 254: package:react/src/react_client/event_helpers.dart @@
-  SyntheticMouseEvent createSyntheticMouseEvent({SyntheticMouseEvent baseEvent, bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, void Function() preventDefault, void Function() stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, SyntheticDataTransfer dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey})
+  SyntheticMouseEvent createSyntheticMouseEvent({SyntheticMouseEvent baseEvent, bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, void Function() preventDefault, void Function() stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, dynamic dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey})
// `type` of `dataTransfer` has changed.
// Changing a parameter signature is a major change.
@@ line 9: package:react/src/react_client/event_factory.dart @@
-  SyntheticEvent syntheticEventFactory(SyntheticEvent e)
// Removing a top-level function is a major change.
@@ line 324: package:react/src/react_client/event_factory.dart @@
-  SyntheticUIEvent syntheticUIEventFactory(SyntheticUIEvent e)
// Removing a top-level function is a major change.
@@ line 87: package:react/src/react_client/event_factory.dart @@
-  SyntheticFocusEvent syntheticFocusEventFactory(SyntheticFocusEvent e)
// Removing a top-level function is a major change.
@@ line 186: package:react/src/react_client/event_factory.dart @@
-  SyntheticPointerEvent syntheticPointerEventFactory(SyntheticPointerEvent e)
// Removing a top-level function is a major change.
@@ line 251: package:react/src/react_client/event_factory.dart @@
-  SyntheticTouchEvent syntheticTouchEventFactory(SyntheticTouchEvent e)
// Removing a top-level function is a major change.
@@ line 1884: package:react/react.dart @@
class SyntheticTransitionEvent extends SyntheticEvent
-     SyntheticTransitionEvent SyntheticTransitionEvent(dynamic bubbles, dynamic cancelable, dynamic currentTarget, dynamic _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, dynamic eventPhase, dynamic isTrusted, dynamic nativeEvent, dynamic target, dynamic timeStamp, dynamic type, String propertyName, num elapsedTime, String pseudoElement)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.
@@ line 1756: package:react/react.dart @@
class SyntheticMouseEvent extends SyntheticEvent
-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     dynamic get relatedTarget
+     EventTarget get relatedTarget
//    `type` of `relatedTarget` has changed from `dynamic` to `EventTarget`.
//    Changing a class field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     SyntheticMouseEvent SyntheticMouseEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, SyntheticDataTransfer dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticDataTransfer get dataTransfer
//    Removing a field is a major change.
@@ line 1447: package:react/react.dart @@
class SyntheticEvent
-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticEvent SyntheticEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1806: package:react/react.dart @@
class SyntheticPointerEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticPointerEvent SyntheticPointerEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num pointerId, num width, num height, num pressure, num tangentialPressure, num tiltX, num tiltY, num twist, String pointerType, bool isPrimary)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.
@@ line 1912: package:react/react.dart @@
class SyntheticAnimationEvent extends SyntheticEvent
-     SyntheticAnimationEvent SyntheticAnimationEvent(dynamic bubbles, dynamic cancelable, dynamic currentTarget, dynamic _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, dynamic eventPhase, dynamic isTrusted, dynamic nativeEvent, dynamic target, dynamic timeStamp, dynamic type, String animationName, num elapsedTime, String pseudoElement)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.
@@ line 1610: package:react/react.dart @@
class SyntheticClipboardEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     SyntheticClipboardEvent SyntheticClipboardEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, dynamic clipboardData)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1634: package:react/react.dart @@
class SyntheticKeyboardEvent extends SyntheticEvent
-     SyntheticKeyboardEvent SyntheticKeyboardEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, String char, num charCode, bool ctrlKey, String locale, num location, String key, num keyCode, bool metaKey, bool repeat, bool shiftKey)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1940: package:react/react.dart @@
class SyntheticUIEvent extends SyntheticEvent
-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticUIEvent SyntheticUIEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num detail, dynamic view)
//    Removing a constructor is a major change.
@@ line 1678: package:react/react.dart @@
class SyntheticCompositionEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticCompositionEvent SyntheticCompositionEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, String data)
//    Removing a constructor is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1848: package:react/react.dart @@
class SyntheticTouchEvent extends SyntheticEvent
-     dynamic get touches
+     TouchList get touches
//    `type` of `touches` has changed from `dynamic` to `TouchList`.
//    Changing a class field is a major change.

-     dynamic get targetTouches
+     TouchList get targetTouches
//    `type` of `targetTouches` has changed from `dynamic` to `TouchList`.
//    Changing a class field is a major change.

-     SyntheticTouchEvent SyntheticTouchEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, dynamic changedTouches, bool ctrlKey, bool metaKey, bool shiftKey, dynamic targetTouches, dynamic touches)
//    Removing a constructor is a major change.

-     dynamic get changedTouches
+     TouchList get changedTouches
//    `type` of `changedTouches` has changed from `dynamic` to `TouchList`.
//    Changing a class field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 1726: package:react/react.dart @@
class SyntheticFormEvent extends SyntheticEvent
-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     SyntheticFormEvent SyntheticFormEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 1702: package:react/react.dart @@
class SyntheticFocusEvent extends SyntheticEvent
-     dynamic get relatedTarget
+     EventTarget get relatedTarget
//    `type` of `relatedTarget` has changed from `dynamic` to `EventTarget`.
//    Changing a class field is a major change.

-     SyntheticFocusEvent SyntheticFocusEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, dynamic relatedTarget)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 1966: package:react/react.dart @@
class SyntheticWheelEvent extends SyntheticEvent
-     SyntheticWheelEvent SyntheticWheelEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num deltaX, num deltaMode, num deltaY, num deltaZ)
//    Removing a constructor is a major change.

-     bool get isPersistent
+     bool isPersistent()
//    Removed getter for `isPersistent`.
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 91: package:react/src/react_client/event_helpers.dart @@
+  SyntheticFormEvent fakeSyntheticFormEvent(Element element, String type)
// Adding a top-level function is a minor change.
@@ line 50: package:react/src/react_client/event_helpers.dart @@
+  SyntheticMouseEvent wrapNativeMouseEvent(MouseEvent nativeEvent)
// Adding a top-level function is a minor change.
@@ line 14: package:react/src/react_client/event_helpers.dart @@
+  SyntheticKeyboardEvent wrapNativeKeyboardEvent(KeyboardEvent nativeEvent)
// Adding a top-level function is a minor change.
@@ line 804: package:react/src/react_client/event_helpers.dart @@
+  extension DataTransferHelper on SyntheticMouseEvent
// Adding a class is a minor change.

@@ line 292: package:react/src/react_client/synthetic_event_wrappers.dart @@
+  class NonNativeDataTransfer
// Adding a class is a minor change.


Showing results for 8063199

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
Copy link
Collaborator

Some feedback from the semver report:

  • NonNativeDataTransfer is publicly exported; I think we should keep that private for now since it's an implementation detail and there's not currently a use-case for exposing it.

  • isPersistant

    -     bool get isPersistent
    +     bool isPersistent()

    Unfortunately the old API differed from the React version, so we'll want to keep this as a getter (we should be able to just do one that always returns true, either via a non-external getter or an extension).

  • Changing relatedTarget from dynamic to EventTarget: while this is the correct typing, changing it would result in breakages in consumer code where they're currently performing dynamic calls to methods that exist on EventTarget subclasses (which seems to be pretty common). For example:

    if (event.relatedTarget is Element) {
      event.relatedTarget.focus();
    }

    This currently only works because the call to .focus() is on a dynamic object; event.relatedTarget doesn't get type-promoted inside the if-check, so after these changes you'd get an error: "The method 'focus' isn't defined for the type 'EventTarget'"

    While we should probably update the typing eventually, I think we should keep it as dynamic for now to make the upgrade easier.

  • TouchEvent updates: I'm a little worried about the TouchList types being incompatible with simulated events that pass in Lists (e.g., this case) because TouchList can't easily be instantiated in Dart; what about List<Touch> instead?

@greglittlefield-wf
Copy link
Collaborator

Public API Changes

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

@@ line 301: package:react/src/react_client/event_factory.dart @@
-  SyntheticAnimationEvent syntheticAnimationEventFactory(SyntheticAnimationEvent e)
// Removing a top-level function is a major change.
@@ line 216: package:react/src/react_client/event_factory.dart @@
-  SyntheticMouseEvent syntheticMouseEventFactory(SyntheticMouseEvent e)
// Removing a top-level function is a major change.
@@ line 17: package:react/src/react_client/event_factory.dart @@
-  SyntheticClipboardEvent syntheticClipboardEventFactory(SyntheticClipboardEvent e)
// Removing a top-level function is a major change.
@@ line 346: package:react/src/react_client/event_factory.dart @@
-  SyntheticWheelEvent syntheticWheelEventFactory(SyntheticWheelEvent e)
// Removing a top-level function is a major change.
@@ line 37: package:react/src/react_client/event_factory.dart @@
-  SyntheticCompositionEvent syntheticCompositionEventFactory(SyntheticCompositionEvent e)
// Removing a top-level function is a major change.
Click to see 28 more API Changes


@@ line 118: package:react/src/react_client/event_factory.dart @@
-  SyntheticDataTransfer syntheticDataTransferFactory(Object dt)
// Removing a top-level function is a major change.
@@ line 107: package:react/src/react_client/event_factory.dart @@
-  SyntheticFormEvent syntheticFormEventFactory(SyntheticFormEvent e)
// Removing a top-level function is a major change.
@@ line 278: package:react/src/react_client/event_factory.dart @@
-  SyntheticTransitionEvent syntheticTransitionEventFactory(SyntheticTransitionEvent e)
// Removing a top-level function is a major change.
@@ line 57: package:react/src/react_client/event_factory.dart @@
-  SyntheticKeyboardEvent syntheticKeyboardEventFactory(SyntheticKeyboardEvent e)
// Removing a top-level function is a major change.
@@ line 254: package:react/src/react_client/event_helpers.dart @@
-  SyntheticMouseEvent createSyntheticMouseEvent({SyntheticMouseEvent baseEvent, bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, void Function() preventDefault, void Function() stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, SyntheticDataTransfer dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey})
+  SyntheticMouseEvent createSyntheticMouseEvent({SyntheticMouseEvent baseEvent, bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, void Function() preventDefault, void Function() stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, dynamic dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey})
// `type` of `dataTransfer` has changed.
// Changing a parameter signature is a major change.
@@ line 9: package:react/src/react_client/event_factory.dart @@
-  SyntheticEvent syntheticEventFactory(SyntheticEvent e)
// Removing a top-level function is a major change.
@@ line 324: package:react/src/react_client/event_factory.dart @@
-  SyntheticUIEvent syntheticUIEventFactory(SyntheticUIEvent e)
// Removing a top-level function is a major change.
@@ line 87: package:react/src/react_client/event_factory.dart @@
-  SyntheticFocusEvent syntheticFocusEventFactory(SyntheticFocusEvent e)
// Removing a top-level function is a major change.
@@ line 186: package:react/src/react_client/event_factory.dart @@
-  SyntheticPointerEvent syntheticPointerEventFactory(SyntheticPointerEvent e)
// Removing a top-level function is a major change.
@@ line 251: package:react/src/react_client/event_factory.dart @@
-  SyntheticTouchEvent syntheticTouchEventFactory(SyntheticTouchEvent e)
// Removing a top-level function is a major change.
@@ line 1884: package:react/react.dart @@
class SyntheticTransitionEvent extends SyntheticEvent
-     SyntheticTransitionEvent SyntheticTransitionEvent(dynamic bubbles, dynamic cancelable, dynamic currentTarget, dynamic _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, dynamic eventPhase, dynamic isTrusted, dynamic nativeEvent, dynamic target, dynamic timeStamp, dynamic type, String propertyName, num elapsedTime, String pseudoElement)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.
@@ line 1756: package:react/react.dart @@
class SyntheticMouseEvent extends SyntheticEvent
-     bool get isPersistent
//    Removing a field is a major change.

-     dynamic get relatedTarget
+     EventTarget get relatedTarget
//    `type` of `relatedTarget` has changed from `dynamic` to `EventTarget`.
//    Changing a class field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     SyntheticMouseEvent SyntheticMouseEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, num button, num buttons, num clientX, num clientY, bool ctrlKey, SyntheticDataTransfer dataTransfer, bool metaKey, num pageX, num pageY, dynamic relatedTarget, num screenX, num screenY, bool shiftKey)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticDataTransfer get dataTransfer
//    Removing a field is a major change.
@@ line 1447: package:react/react.dart @@
class SyntheticEvent
-     bool get isPersistent
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticEvent SyntheticEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1806: package:react/react.dart @@
class SyntheticPointerEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticPointerEvent SyntheticPointerEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num pointerId, num width, num height, num pressure, num tangentialPressure, num tiltX, num tiltY, num twist, String pointerType, bool isPrimary)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.
@@ line 1912: package:react/react.dart @@
class SyntheticAnimationEvent extends SyntheticEvent
-     SyntheticAnimationEvent SyntheticAnimationEvent(dynamic bubbles, dynamic cancelable, dynamic currentTarget, dynamic _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, dynamic eventPhase, dynamic isTrusted, dynamic nativeEvent, dynamic target, dynamic timeStamp, dynamic type, String animationName, num elapsedTime, String pseudoElement)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.
@@ line 1610: package:react/react.dart @@
class SyntheticClipboardEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     SyntheticClipboardEvent SyntheticClipboardEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, dynamic clipboardData)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1634: package:react/react.dart @@
class SyntheticKeyboardEvent extends SyntheticEvent
-     SyntheticKeyboardEvent SyntheticKeyboardEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, String char, num charCode, bool ctrlKey, String locale, num location, String key, num keyCode, bool metaKey, bool repeat, bool shiftKey)
//    Removing a constructor is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1940: package:react/react.dart @@
class SyntheticUIEvent extends SyntheticEvent
-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticUIEvent SyntheticUIEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool _defaultPrevented, dynamic _preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num detail, dynamic view)
//    Removing a constructor is a major change.
@@ line 1678: package:react/react.dart @@
class SyntheticCompositionEvent extends SyntheticEvent
-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.

-     SyntheticCompositionEvent SyntheticCompositionEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, String data)
//    Removing a constructor is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.
@@ line 1848: package:react/react.dart @@
class SyntheticTouchEvent extends SyntheticEvent
-     dynamic get touches
+     List<Touch> get touches
//    `type` of `touches` has changed from `dynamic` to `List<Touch>`.
//    Changing a class field is a major change.

-     dynamic get targetTouches
+     List<Touch> get targetTouches
//    `type` of `targetTouches` has changed from `dynamic` to `List<Touch>`.
//    Changing a class field is a major change.

-     SyntheticTouchEvent SyntheticTouchEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, bool altKey, dynamic changedTouches, bool ctrlKey, bool metaKey, bool shiftKey, dynamic targetTouches, dynamic touches)
//    Removing a constructor is a major change.

-     dynamic get changedTouches
+     List<Touch> get changedTouches
//    `type` of `changedTouches` has changed from `dynamic` to `List<Touch>`.
//    Changing a class field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 1726: package:react/react.dart @@
class SyntheticFormEvent extends SyntheticEvent
-     bool get isPersistent
//    Removing a field is a major change.

-     SyntheticFormEvent SyntheticFormEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 1702: package:react/react.dart @@
class SyntheticFocusEvent extends SyntheticEvent
-     SyntheticFocusEvent SyntheticFocusEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, dynamic relatedTarget)
//    Removing a constructor is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 587: package:react/src/react_client/event_helpers.dart @@
extension SyntheticEventTypeHelpers on SyntheticEvent
-     bool get isFormEvent
//    Removing a field is a major change.

+     bool get isPersistent
//    Adding a field is a minor change.
@@ line 1966: package:react/react.dart @@
class SyntheticWheelEvent extends SyntheticEvent
-     SyntheticWheelEvent SyntheticWheelEvent(bool bubbles, bool cancelable, dynamic currentTarget, bool defaultPrevented, dynamic preventDefault, dynamic stopPropagation, num eventPhase, bool isTrusted, dynamic nativeEvent, dynamic target, num timeStamp, String type, num deltaX, num deltaMode, num deltaY, num deltaZ)
//    Removing a constructor is a major change.

-     bool get isPersistent
//    Removing a field is a major change.

-     void Function() $$jsPersistDoNotSetThisOrYouWillBeFired
//    Removing a field is a major change.

-     dynamic get stopPropagation
+     void stopPropagation()
//    Removed getter for `stopPropagation`.
//    Removing a field is a major change.
@@ line 91: package:react/src/react_client/event_helpers.dart @@
+  SyntheticFormEvent fakeSyntheticFormEvent(Element element, String type)
// Adding a top-level function is a minor change.
@@ line 50: package:react/src/react_client/event_helpers.dart @@
+  SyntheticMouseEvent wrapNativeMouseEvent(MouseEvent nativeEvent)
// Adding a top-level function is a minor change.
@@ line 14: package:react/src/react_client/event_helpers.dart @@
+  SyntheticKeyboardEvent wrapNativeKeyboardEvent(KeyboardEvent nativeEvent)
// Adding a top-level function is a minor change.
@@ line 803: package:react/src/react_client/event_helpers.dart @@
+  extension DataTransferHelper on SyntheticMouseEvent
// Adding a class is a minor change.


Showing results for 9aa536f

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.

Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10

We just need to make sure to re-export these new extensions from over_react so that people don't have to import react-dart: https://github.com/Workiva/graph_ui/pull/1811/files#diff-24bb7e81736e0c04f430abab63b23e46d779cefd80f10a76d1ee7be3d3b7a5a5R17

Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10

@greglittlefield-wf greglittlefield-wf merged commit 052c5b6 into 6.0.0-wip Nov 18, 2020
@joebingham-wk joebingham-wk deleted the CPLAT-12470-remove-synthetic-event-wrappers branch November 19, 2020 00:28
@joebingham-wk joebingham-wk added this to the 6.0.0 milestone Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants