-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[FormLayout] Converted to a functional component #2539
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
Conversation
💦 Potential splash zone of changes introduced to
DetailsAll files potentially affected (total: 3)📄
|
Given my talk in #2062 about our cargo-culty usage of PureComponent and how I'd like us to stop doing that I don't think we should bother wrapping this in a React.memo |
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.
This looks good pending the reply to Ben's comment. Was there a benefit here for using Memo?
@BPScott For this pull-request, I think I'm going to keep However I'm not disagreeing that we probably don't need Before we start pulling As a devil's advocate, the render time of |
Excellent points :) I'm happy to say lets do one migration stage at a time, as long as we make sure we make space for doing the PureComponent audit at some point soon. I really like the idea of documenting this in a decision record. Tangentially I've been thinking about decision records for some other stuff too - how we handle imports/exports (i.e. why we avoid defaults), how we structure subcomponent and utility folders, opinions on how we name attributes (prefering positive namings execpt when defaults result in double negatives, like HTML attributes so
Alas I know of no benchmarks - most stuff I've saw is very dependant on how the components are used - the more complex the props you pass in the longer the diff takes I guess. For honest meaningful figures we'd need to look at real world usage. Though my personal bias leans towards "stuff like FormLayout is so dang simple I'd bet on React.memo doing more harm than good" but I've got absolutely nothing to back that up. |
WHY are these changes introduced?
More context here
This open in a tab, will polish and request reviews after hack days.