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

loadJSONAsync() Ready or Not? #266

Closed oiver555 closed 1 month ago

oiver555 commented 1 month ago

Greetings, I notice you have this function in the documentation website loadJSONAsync() but when I try to call it I don't see any code hints for it's existence. I then noticed in the changelog that this function is listed under the title Upcoming (unreleased). So I guess this means that it is not ready yet? If it is ready is there a way I can use it, I can even be a tester if need be.

For A while now I notice a little hiccup in the UI of my app whenever I load my index and it's coming from MiniSearch.loadJS. My index is about 25ish mbs. A async version of loadJSON would be a great addition!

scambier commented 1 month ago

Ha! I was just looking right now if it was released on npm, I'm the one who wrote the pull request 😅

I personally consider it to be ready, as I've been using this method in production for 2 months. You should be able to install it like that in your package.json

{
  "dependencies": {
    "minisearch": "github:lucaong/minisearch#4b231376363918b7fa487cb1735a09efb99fe963",

This should install minisearch straight from the repository, and pinned at the last commit.

oiver555 commented 1 month ago

Great News! Thanks very much 👍

oiver555 commented 1 month ago

Ok so everything is working in the dev build of my react native app. Here is how I am importing it.

import MiniSearch from '../node_modules/minisearch/src/MiniSearch'

However when it comes time for me to do a production build I get this error

image I went ahead and tried to do the solution which was to run npx patch-package minisearch

When I do this, here is what happens image

Do you have any suggestions?

scambier commented 1 month ago

I've never used patch-package, but from what I understand reading the error

Solutions:

oiver555 commented 1 month ago

Got it okay, will give it a shot

lucaong commented 1 month ago

@oiver555 @scambier that's right, the feature is not yet on NPM. I will make a new release, hopefully later today.

lucaong commented 1 month ago

@oiver555 @scambier version v7.0.0 is now released on NPM, and it includes this feature.