adobe-photoshop / spaces-design

Adobe Photoshop Design Space
http://adobe-photoshop.github.io/
Other
852 stars 74 forks source link

Two shouldComponentUpdate fixes #3683

Closed iwehrman closed 8 years ago

iwehrman commented 8 years ago
  1. Implement shouldComponentUpdate in Dialog. This is not as easy as it should be because Dialog components render in two passes. To make this possible, I've added a flag to each instance of which makes it possible to track the progress of these two-pass renders.
  2. Fix the shouldComponentUpdate implementations in Fill.jsx. We were passing in a plain objects as the fill prop to the components defined in Fill.jsx, but testing for equality with Immutable.is. (It would be nice if this threw an error?) I worked around the problem by just creating a custom struct to hold the properties in that previously mutable object.

Both of these components were being rendered unnecessarily when calling initializeBackgroundLayers. The former was also causing all dialogs to re-render whenever one dialog was opened.

Addresses: concerns.

baaygun commented 8 years ago

Yuck, but it works!