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

AF-2994 Rem sensor async mount #197

Merged
merged 2 commits into from
Oct 30, 2018
Merged

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Oct 30, 2018

Ultimate problem:

Initializing the rem-change-detecting ResizeSensor synchronously can cause React warnings and get React into a bad state if this happens inside a component's render.

This can happen when toRem is used for the first time inside a component render method, as is case in w_context_menu's tests in master with the latest over_react.

How it was fixed:

  • Initialize the sensor asynchronously so it doesn't happen within React lifecycle
    • Update tests to support this
  • Add tests

Testing suggestions:

  • Verify tests pass
  • Pull into w_context_menu and verify that all tests pass when running ddev test

Potential areas of regression:

Rem sensor


FYA: @greglittlefield-wf @aaronlademann-wf @kealjones-wk @evanweible-wf @maxwellpeterson-wf

@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 HipChat: InfoSec Forum.

Element _changeSensorMountNode;
@visibleForTesting
Element get changeSensorMountNode => _changeSensorMountNode;

void _initRemChangeSensor() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes in this PR are best viewed with whitespace-agnostic diffs: https://github.com/Workiva/over_react/pull/197/files?w=1

@rmconsole4-wk rmconsole4-wk changed the title Rem sensor async mount AF-2994 Rem sensor async mount Oct 30, 2018
@codecov-io
Copy link

Codecov Report

Merging #197 into master will increase coverage by 0.06%.
The diff coverage is 95.66%.

@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
+ Coverage   94.53%   94.59%   +0.06%     
==========================================
  Files          34       34              
  Lines        1645     1661      +16     
==========================================
+ Hits         1555     1571      +16     
  Misses         90       90

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

QA +10

@aaronlademann-wf aaronlademann-wf merged commit a5c3add into master Oct 30, 2018
@aaronlademann-wf aaronlademann-wf deleted the rem_sensor_async_mount branch October 30, 2018 21:46
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