reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.34k stars 2.17k forks source link

Upgrade `react-measure` to version 2.x #2792

Closed brent-hoover closed 7 years ago

brent-hoover commented 7 years ago

Bithound is showing this as an outdated dependency and I tested just straight upgrading it and it does break the MediaGallery (the one file it's currently used in).

It's probably not a big task to adapt to the new API but it should probably be done soon.

kieckhafer commented 7 years ago

It's a little more complicated than just following their docs. @jshimko pointed out the issue in #2592 , we can't just wrap their new ref prop, like they mention in their docs... we'd actually have to rewrite the way our MediaGallery works. We currently use a react component, MediaItem, inside the gallery, and react-measure doesn't allow a nested react component, it only works on straight DOM elements.

@janus-reith mentioned a replacement for MediaGallery in the above mentioned issue... replacing MediaGallery is something we've discussed before, if we are moving forward with looking into a replacement, its probably best to hold off on updating react-measure until then, I don't know if it's worth rewriting the current media gallery just to work with react-measure 2.0

brent-hoover commented 7 years ago

Whoops. Should have searched before creating this issue. It's a dupe. Closing.

janus-reith commented 7 years ago

@kieckhafer I answered in https://github.com/reactioncommerce/reaction/issues/2592