Regarding https://github.com/metabrainz/bookbrainz-site/p..., I think I can't use it here unless there is a way to update the alert message directly from the external service page. This is because when a user disconnects CB, the state of alert is updated without refreshing the page.
monkey
Hm, I see. Let me think about this for a minute
MRiddickW has quit
I think this is a problem best solve with a React context, but that would need to be for another PR
I'd say maybe use the existing system for any alert that is created on the server route, and use your alert setup for the dynamic alerts
(that way once we get to refactoring them we should only have to refactor the dynamic alerts)
It's `handleTextInputChange` itself that you'll want a debounced version of
i.e. create a `debouncedHandleTextInputChange` and use that as the handler
ansh
But the state textContent should be updated immediately otherwise the user won't see what he types
For example the case you mentioned there, we are updating the text state immediately but delaying the search trigger
monkey
Are you certain the textarea does not update as the user types, regardless of react state? If indeed it does seem slow then as you say we should update the state value and debounce other operations
I tried to delay the state updation by using setTimeout, and then I can notice that typing is slow.
monkey
OK, then that confirms it, thanks for checking
So update the state normally but debounce other operations
Shubh
monkey: whenever you get time, please review the frontend PR.
I know it's going to be ton of work to review that PR so please let me know if there's anything i can do to help.
monkey
OK, ready to review, exciting ! :)
Definitely a lot of changes to review, but a lot of them are fairly simple.
And I've been reading the PR as you went, so I'm not expecting a lot of surprises
ansh
monkey: other than updating the state, I am just using text to process one specific error that too inside `handleTextInputChange`, So I don't think i need to debounce anything.
I was also thinking of this text processing, but perhaps you're right and debouncing is excessive: https://github.com/metabrainz/bookbrainz-site/b... you want to be sure, you can try throttling your CPU in devtools > performance tab and see if there is any noticeable slowdown: