Debounce search input
Closed this issue · 4 comments
Hi,
I realized that the app search is triggered after each input, see
EspruinoAppLoaderCore/js/index.js
Line 656 in 7d04c48
While, on desktop browsers, the performance is ok, on my (midrange) smartphone, it takes a noticeable time to enter (or remove) characters. With a constantly growing app list, this will even be more pronounced over time...
My suggestion is to debounce the 'input'-event function, e.g. by using the function from https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086
I could also submit a pull request for this, but before doing so, I wanted to ask if this feature is wanted/accepted.
Is there any documentation how to test the bangle.js app loader with both a forked BangleApps and
EspruinoAppLoaderCore repo?
Cheers,
neshanjo
Interesting - thanks. Yes, that would be great - a PR would definitely be accepted.
I don't have any info on testing handy I'm afraid. Personally, I'd just clone them locally and serve bangleApps off a webserver on your own machine. Web Bluetooth works fine off localhost.
However as long as you ensure the EspruinoAppLoaderCore submodule points to your version the GitHub pages version should work (instructions on setting up your own copy at https://www.espruino.com/Bangle.js+App+Loader+Custom).
It's implemented (see PR).
Good idea with the local test server. I cloned my fork to the core directory and ran npm start in the main directory - and it worked! I could also test the site on my mobile phone in the same network by using my main computer's IP address. Web bluetooth does not seem to work with IP addresses other than localhost (probably due to lacking HTTPS?). However, for testing this change, it's not necessary.
Some other question, not directly related: What are the release cycles? When will the change be linked to the BangleApp repo? And when do you update https://banglejs.com/apps/?
Web bluetooth does not seem to work with IP addresses other than localhost (probably due to lacking HTTPS?)
Yes, that's right. It's just nice they enabled it for localhost though :)
What are the release cycles?
It's pretty much whenever. I'll usually update once a week but I might push it earlier or later depending on whether there's something I want to test first.
You can always test the latest with https://espruino.github.io/BangleApps/ though