johnwalley / allotment

A React component for resizable split views
https://allotment.mulberryhousesoftware.com/
MIT License
972 stars 55 forks source link

Polyfill `ResizeObserver` for older browsers #483

Open horacioh opened 1 year ago

horacioh commented 1 year ago

First, thanks for this library! is amazing and we are using it at mintter :)

In our app we support browser versions that does not include ResizeObserver, and I saw that the use-resize-observer hook is used internally.

I'm wondering if it's better if ResizeObserver is being polyfilled at the library level or instead at app level? (instead of allotment includes the polypill, we at Mintter should do it)

what is the preferred way here? I'm happy to contribute with a PR if this is needed at library level. There's some documentation on how to polyfill this, but not sure what will be the best approach.

thanks and waiting for any response :)

johnwalley commented 1 year ago

Hi @horacioh. Sorry for the slow reply. Life sometimes gets in the way.

Thanks for the thoughtful submission. I appreciate the detail.

I'm inclined from looking at the browser support to suggest that I'm unlikely to polyfill it at the library level.

Screenshot 2023-01-04 at 23 41 35

And reading the link you provided it seems polyfilling at the app level is recommended.

Do let me know if there are any issues you run into.

johnwalley commented 1 year ago

@horacioh do let me know if there are any other specific issues you run into when integrating allotment into mintter.