Add really fast search #422
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This rewrite removes jQuery, and instead relies on modern browser APIs
to implement the same functionality. This makes search fast enough that
it's able to run without the need of debounce.
I followed https://w3bits.com/css-grid-masonry/ to create the masonry
without jQuery. Leaning into the browser like this allows the
re-masonry on search to be really fast (this was one of the slowdown
causes I was noticing before)
I suspect IE11 will need some careful work to get grid working there,
but we could simply disable it when grid is not available via
@supports.I've tried to keep the browser APIs to ones widely supported. For
example
querySelectoris available in IE8 (which has global usage of0.03%). I haven't verified that claim though.
There's a few minor style tweaks here too, but the original style should
be easy enough to get working with grid, I just haven't invested the
time yet.
These changes will also reduce the JS footprint of the size
dramatically.
Marking as draft as this is so experimental, and I'm not sure yet
whether I should invest time into IE support or not.