-
Notifications
You must be signed in to change notification settings - Fork 59
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
(fix) O3-3350: Resolve infinite re-rendering of the dropdown component in the tablet viewport #326
Conversation
Size Change: -248 kB (-19.68%) 🎉 Total Size: 1.01 MB
ℹ️ View Unchanged
|
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.
Thanks @samuelmale
Just tested on dev3 and this fix works as intended! Thanks, @samuelmale. |
@@ -29,6 +29,7 @@ | |||
"access": "public" | |||
}, | |||
"dependencies": { | |||
"@carbon/react": ">1.47.0 <1.50.0", |
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.
@samuelmale Is there a specific reason you made this a dependency and not a peerDependency?
I've read the linked issues/pr and the issue with the downshift dependency in carbon which has since been resolved. After pulling the latest changes and linking with the form-builder, i got some errors from carbon because of version conflicts.
- On one end adding this range resolved the issue with the downshift library but it also creates either a conflict or multiple versions of
@carbon/react
running within microfrontends that have dependencies out of that range for example esm-form-builder and other esms are currently running on@carbon/react@npm:1.37.0
which will in turn affect the bundle size. Would this necessitate us updating the frontends that pull the FE directly to at least1.47.0
to have this fix working?
- Doesn't having the same range of versions as a peer dependency yield the same result but with the benefit of not duplicating instances of
@carbon/react
?
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.
IIRC, the overwhelming consensus on the dependency management strategy for Carbon in O3 is having it as a normal dependency as opposed to a singleton (peer).
Requirements
Summary
This PR fixes an issue with the dropdown component re-rendering infinitely on selecting an option in tablet view port. This issue stems from the "downshift" library consumed by Carbon and it seems to be affecting React v18. It was since resolved in downshift
v8.2.4
and carbon.Out of scope
I've also changed Carbon from a peer dependency to a normal dependency.
Screenshots
Related Issue
https://issues.openmrs.org/browse/O3-3350
Other