-
Notifications
You must be signed in to change notification settings - Fork 68
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
CPLAT-12665 Remove Synthetic Event Wrappers #284
Conversation
external EventTarget get relatedTarget; | ||
} | ||
|
||
/// A [SyntheticEvent] wrapper that represents a form event. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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
There was a problem hiding this 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!
/// __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]. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 067e282!
There was a problem hiding this comment.
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!
Public API ChangesRecommendation: @@ 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
|
Some feedback from the semver report:
|
Public API ChangesRecommendation: @@ 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
|
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+10
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:
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
create{x}Event
utilities to create maps cast as the synthetic event typeSyntheticEventTypeHelpers
helpers to use duck typing instead ofis
.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 classesQA
SyntheticEventTypeHelpers
helpers were added