lucaong / minisearch

Tiny and powerful JavaScript full-text search engine for browser and Node
https://lucaong.github.io/minisearch/
MIT License
4.64k stars 133 forks source link

Barebones, framework agnostic example #230

Closed BorisAnthony closed 10 months ago

BorisAnthony commented 12 months ago

Hi! It would be amazing to have an example that isn't based in React. There's no way to tease out just what the search needs from the current example because it is bundled together in that app.js file. I have, for example, a PHP-based project in which I could easily provide a JSON file to index, and go the "include from CDN" route. But it's all the other goodies which you made the effort to code into the React example, which the rest of us would need to actually use this seemingly great lib.

I see you're busy as a startup co-founder so I am not going to hold my breath but man it would be cool. 😅 (I could even buy you a beer or coffee sometime as I am in the same city ;)

lucaong commented 12 months ago

Hi @BorisAnthony , I definitely agree that it would be great to add an example that is not based on React. Having a "vanilla" example without any framework would be useful. It can be tricky to implement a reactive UI without any framework though, so it might have to be a simpler example compared to the existing demo, or the reader would get lost in details that are not about MiniSearch itself.

BorisAnthony commented 12 months ago

It doesn't need to be "reactive"... the Web has done fine, and will continue to do fine, without "reactiveness", and besides, folks will figure out how to do what they want/need that fits their context. Just would be nice to have a simple basic example of how to hook up the json file and the API... (maybe that's really easy for someone who actually knows JS... unfortunately that's still not me 😅 I still usually need examples to hack...)

lucaong commented 11 months ago

Yeah, I agree it doesn't have to be fancy, and I am not a fan of overcomplicated frontend architectures, when server side rendering would get the job done just fine and without complexity. The current demo tries to showcase a bit of everything, hence it needs a more complex frontend that benefits from using a framework. I have in mind how a good simple JS-only example could work, I hope I will have time soon to implement it.

BorisAnthony commented 11 months ago

Would be cool 😅 I'm looking for such a solution for my personal ebook library ( https://libra.re/library/ ). Anyways, happy to buy you a coffee and chat if you're ever up for such a thing (mornings/afternoon, PBerg/Mitte) 👍

lucaong commented 10 months ago

Hi @BorisAnthony

I ended up rewriting the demo application in plain JavaScript, with no framework. Not only this is better to illustrate MiniSearch to all audiences, but also it will be much easier for me to maintain, without the hassle of having to maintain the build system, update React, etc.

The new plain-JS demo has all the features of the original React demo :)

Here is the PR, which I will soon merge: https://github.com/lucaong/minisearch/pull/232

lucaong commented 10 months ago

Merged, I will therefore close the issue. Thanks for the great idea, I should have done this long time ago!

lucaong commented 10 months ago

BTW your ebook library looks great! At the moment unfortunately I am not in Berlin, otherwise a coffee in Pberg sounds good

BorisAnthony commented 10 months ago

A-may-zing. Thank you so much! Lemme know if/when you get back and want to cash in that offer. (I'm out for the winter end of Nov though.) Also, I'll let you know when I implement it!