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

UIP-2629 getDartComponent warning for ReactElements #105

Merged

Conversation

greglittlefield-wf
Copy link
Contributor

Ultimate problem:

The soon to be released react-dart 4.0 will no longer support retrieving Dart components via getDartComponent from ReactElements (pre-mounted VDOM instances) in order to avoid memory leaks.

We should have a warning in place for when this occurs so that consumers will:

  • be able to identify problematic usages that need to be updated
  • be able to tell why things are breaking if they don't fix them in time:

How it was fixed:

  • Add error message that prints when a ReactElement is passed into getDartComponent
    screen shot 2017-08-11 at 11 09 13 am
  • Add tests

Boy-scouted:

  • Fixes to selection range tests that were failing in Chrome
  • UIP-2322 Fixes to selection range logic in Firefox

Testing suggestions:

Verify that tests pass in all platforms:

  • Dart VM
    • ddev test -p content-shell
    • ddev test -p dartium
  • dart2js
    • ddev test -p chrome
    • ddev test -p firefox
      • Watch out for unrelated failing getActiveElement test in master
  • DDC
    • ddev test -p chrome --web-compiler=dartdevc test/*_test.dart -x no-ddc
      • Watch out for unrelated intermittently-failing getActiveElement test in master
      • Watch out for unrelated failing ObjectDisposedException test in master

Potential areas of regression:

  • getDartComponent
  • setSelectionRange/getSelectionRange`

FYA: @greglittlefield-wf @aaronlademann-wf @jacehensley-wf @clairesarsam-wf @joelleibow-wf

@aviary-wf
Copy link

aviary-wf commented Aug 11, 2017

Raven

Number of Findings: 0

@rmconsole2-wf rmconsole2-wf changed the title getDartComponent warning for ReactElements UIP-2629 getDartComponent warning for ReactElements Aug 11, 2017
@@ -280,6 +280,43 @@ react.Component getDartComponent(/* [1] */ instance) {
return null;
}

// Split out into a separate function since the DDC doesn't support
Copy link
Contributor

Choose a reason for hiding this comment

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

Booo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually isn't needed now that I understand the issue more. See dart-lang/sdk#30426

@jacehensley-wf
Copy link
Contributor

+1

sharedInputGetSelectionStartTest(type);
}, testOn: 'js && !chrome');
sharedInputGetSelectionStartTest(type, shouldReturnNull: false);
}, testOn: '!(blink || firefox)');
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, it's because coverage doesn't include the platform: Workiva/dart_dev#200. I'll apply a fix for that

@codecov-io
Copy link

codecov-io commented Aug 11, 2017

Codecov Report

Merging #105 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   94.36%   94.37%   +0.02%     
==========================================
  Files          31       31              
  Lines        1540     1543       +3     
==========================================
+ Hits         1453     1456       +3     
  Misses         87       87

@aaronlademann-wf
Copy link
Contributor

+1

@aaronlademann-wf
Copy link
Contributor

QA +10

  • Testing instruction
    • Verified that tests pass in all platforms:
      • Dart VM
        • ddev test -p content-shell
        • ddev test -p dartium
      • dart2js
        • ddev test -p chrome
        • ddev test -p firefox
      • DDC
        • ddev test -p chrome --web-compiler=dartdevc test/*_test.dart -x no-ddc
    • Ran WSD form control tests while pointing to this branch to verify that no setSelectionRange / getSelectionRange regressions have occurred.
  • Dev +1's
  • Dev/QA +10
  • Unit tests created/updated
  • All unit tests pass
  • Rosie ran/Rosie comment displays expected info
  • Dependency Scan Clean

Merging.

@aaronlademann-wf aaronlademann-wf merged commit b96dbf5 into Workiva:master Aug 14, 2017
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.

6 participants