Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Suggestion: Use react-measure instead of custom window resize handler #49

Closed
tf opened this issue Jun 21, 2017 · 2 comments
Closed

Suggestion: Use react-measure instead of custom window resize handler #49

tf opened this issue Jun 21, 2017 · 2 comments

Comments

@tf
Copy link
Contributor

tf commented Jun 21, 2017

I understand that adding another dependency to the package might not be a popular move. Still I wanted to post a link to a branch that I'm using which replaces a bunch of code in this project with a rather straightforward usage of react-measure.

Since react-measure relies on resize and mutation observers, responsive resizing also works if one of the parent elements changes its size while window remains unchanged. This was a requirement in my case.

The branch is an extension of the changes proposed in #48.

@mspae
Copy link
Owner

mspae commented Aug 10, 2017

Actually I have been working on wavesurfer.js version 2 which supports resizing (if the waveform is setup to be the width of the container – e.g. there is no scrollbar (See https://github.com/katspaugh/wavesurfer.js/blob/master/src/wavesurfer.js#L340)) – Unfortunately I don't have any free time to push that project forward. Ideally v2 (which also includes lots of other features) should be finalised (although it is already pretty bug free as far as I know.) – See status of that here: katspaugh/wavesurfer.js#1092 – Ideally react-wavesurfer should be updated to include support for wavesurfer 2 (The refactor of wavesurfer was mainly motivated by the requirements of react-wavesurfer: the new version is architected to work better with module bundlers, this will allow this lib to be "batteries included" – so no dependencies to wavesurfer) – So if you or anyone sees fit to work on this I would extremely happy to coordinate and/or make them maintainer of this repo.

@tf
Copy link
Contributor Author

tf commented Nov 3, 2017

Sorry for taking forever to respond here. But as you said free time is a limited resource. 😉

I agree that with Wavesurfer providing a responsiveness feature itself, this question becomes out of scope for react-wavesurfer.

Since my changes to Wavesurfer will go into v2, I'll be living on a fork anyway for now until that is released and react-wavesurfer is updated.

Once I start working in this area again, I'll be happy to help making v2 compatibility happen.

@tf tf closed this as completed Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants