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

WRQ-19325: Removed findDOMNode calls #3243

Merged
merged 29 commits into from
Jun 3, 2024
Merged

WRQ-19325: Removed findDOMNode calls #3243

merged 29 commits into from
Jun 3, 2024

Conversation

0x64
Copy link
Member

@0x64 0x64 commented May 30, 2024

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

As findDOMNode will be removed in React 19, replace/remove findDOMNode in Enact.

Resolution

A new private internal HoC WithRef is added to provide an imperative handle to get a node ref based on a ref of a sibling dummy node. With this HoC, spotlight/Spottable, ui/Placeholder.PlaceholderControllerDecorator, and webos/speech.VoiceControlDecorator is updated not to call findDOMNode.
Also, ui/ResolutionDecorator is updated to use CSS classes with querySelector rather than ref.
ui/ViewManager is updated to add a dummy sibling node just like a new internal HoC. Since its implementation, HoC cannot be used directly.

Additional Considerations

Links

WRQ-19325
enactjs/sandstone/pull/1622
enactjs/agate/pull/792

Comments

0x64 added 24 commits May 8, 2024 14:50
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Note that some unit tests are failed so we need to check cases.

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
It is not unclear yet but it looks that Jest environment cannot handle a selector
containing semicolons. For example, :has() makes an error.

Due to this issue, WithRef's code cannot tested with Jest yet.

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Also error occurs if a selector string contains semicolon

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.48%. Comparing base (3cf15c2) to head (8dc71b2).

Files Patch % Lines
packages/core/internal/WithRef/WithRef.js 94.11% 1 Missing ⚠️
packages/ui/resolution/resolution.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3243      +/-   ##
===========================================
+ Coverage    82.42%   82.48%   +0.06%     
===========================================
  Files          156      157       +1     
  Lines         7215     7247      +32     
  Branches      1912     1919       +7     
===========================================
+ Hits          5947     5978      +31     
- Misses         997      998       +1     
  Partials       271      271              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

0x64 added 2 commits May 31, 2024 17:59
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Copy link
Contributor

@juwonjeong juwonjeong left a comment

Choose a reason for hiding this comment

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

LGTM

0x64 added 2 commits June 3, 2024 17:14
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)
Copy link
Contributor

@MikyungKim MikyungKim left a comment

Choose a reason for hiding this comment

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

LGTM

@MikyungKim MikyungKim merged commit 33c27d5 into develop Jun 3, 2024
7 checks passed
@MikyungKim MikyungKim deleted the feature/WRQ-19325 branch June 3, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants