Skip to content
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-12547 Update SyntheticEvent Usage #639

Merged
merged 15 commits into from
Nov 24, 2020

Conversation

sydneyjodon-wk
Copy link
Contributor

@sydneyjodon-wk sydneyjodon-wk commented Oct 23, 2020

Motivation

React-dart 6.0.0 makes changes to SyntheticEvents that OverReact needed to respond to.

Changes

  • Remove helpers (these were just all moved to react-dart and have been merged in to 6.0.0-wip)
  • Export new helpers from react-dart
  • Update tests that were failing under the new event / logging behaviors

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Client Platform member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@@ -793,7 +742,7 @@ main() {
});

expect(
logs.first,
logs[1],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of the Cannot find native JavaScript type (SyntheticMouseEvent) for type check warning (caused by the removal of the @anonymous annotations from SyntheticEvent js interop classes in react-dart), the expected warning appears second in the logs.

Copy link
Contributor Author

@sydneyjodon-wk sydneyjodon-wk Oct 27, 2020

Choose a reason for hiding this comment

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

Also, this is the only non-formatting change in this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Updating the test in this way makes it depend on that error existing, but that won't always be the case. Can we instead update it to ignore that error, so that it won't start failing again if that error goes away?

      final logs = await recordConsoleLogsAsync(() async {
        click(fluxButton);
        await Future(() {});
      });
      logs.removeWhere((log) => log.contains('Cannot find native JavaScript type');

      expect(
          logs.first,

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh yep, good call. I added that!

@@ -1,161 +0,0 @@
// Copyright 2016 Workiva Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed this because it got moved to react-dart.

/// Helper util that wraps a native [KeyboardEvent] in a [SyntheticKeyboardEvent].
///
/// Used where a native [KeyboardEvent] is given and a [SyntheticKeyboardEvent] is needed.
SyntheticKeyboardEvent wrapNativeKeyboardEvent(KeyboardEvent nativeKeyboardEvent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This was removed because it got moved to react-dart.

@joebingham-wk joebingham-wk marked this pull request as ready for review November 23, 2020 22:14
@sydneyjodon-wk
Copy link
Contributor Author

sydneyjodon-wk commented Nov 23, 2020

+1 (on Joe's changes)

@@ -793,7 +742,7 @@ main() {
});

expect(
logs.first,
logs[1],
Copy link
Contributor

Choose a reason for hiding this comment

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

Updating the test in this way makes it depend on that error existing, but that won't always be the case. Can we instead update it to ignore that error, so that it won't start failing again if that error goes away?

      final logs = await recordConsoleLogsAsync(() async {
        click(fluxButton);
        await Future(() {});
      });
      logs.removeWhere((log) => log.contains('Cannot find native JavaScript type');

      expect(
          logs.first,

);
}
export 'package:react/react.dart'
show wrapNativeKeyboardEvent, wrapNativeMouseEvent, fakeSyntheticFormEvent, SyntheticEventTypeHelpers, DataTransferHelper;
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit SyntheticEventTypeHelpers an DataTransferHelper are being exported unnecessarily

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh yep, good catch. I realized that all of that really should have just been exported with the event stuff from react-dart anyway, so I just move all the exports into over_react.dart. Let me know if I missed something though and it was important to keep this file!

Copy link
Contributor

@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 350c355 into 4.0.0-wip Nov 24, 2020
@joebingham-wk joebingham-wk deleted the react-17-synthetic-event-updates branch November 24, 2020 16:56
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.

5 participants