lucaong / minisearch

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

loadJSONAsync() Ready or Not? #266

Closed oiver555 closed 4 months ago

oiver555 commented 5 months 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 5 months 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 5 months ago

Great News! Thanks very much 👍

oiver555 commented 5 months 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 4 months ago

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

Solutions:

oiver555 commented 4 months ago

Got it okay, will give it a shot

lucaong commented 4 months ago

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

lucaong commented 4 months ago

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