Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Mini Search version? #251

Open
oiver555 opened this issue Mar 7, 2024 · 2 comments
Open

Get Mini Search version? #251

oiver555 opened this issue Mar 7, 2024 · 2 comments

Comments

@oiver555
Copy link

oiver555 commented Mar 7, 2024

I'm using Minisearch in my app, which was published about a year or two ago. I just made an update of the app a few days ago, updating Minisearch to version 5.0.0, everything works fine however, I notice users get this error...

Fatal Exception: com.facebook.react.common.JavascriptException: Error: MiniSearch: cannot deserialize an index created with an incompatible version

...when using the old index from the old version of my app, in the updated version of my app. Is there a way I can obtain the version of Minisearch from it's instance, so that I can make a new index when the conditions require it. Or maybe you have a better solution? Thank you for your time and help!

@lucaong
Copy link
Owner

lucaong commented Mar 11, 2024

Hi @oiver555 ,
MiniSearch follows semantic versioning: breaking changes are only introduced with major releases. In other words, as long as the first version number does not change (the x in x.y.z), you can safely upgrade. A common strategy to avoid bad surprises when updating is to pin the major version of the library in your package.json, by specifying your dependency as "minisearch": "^6.3.0". This will update MiniSearch automatically to any new minor or patch version, but not if the major version changes (so you can perform the major updates manually when you are ready, checking the CHANGELOG for breaking changes and how to deal with them).

MiniSearch also tries to avoid breaking changes to the serialization format, even upon major version changes. So far, version 4.0.0 is the only one that introduced a breaking change in the serialization format.

That said, it might be useful to obtain the current version from the MiniSearch instance, as you propose. I will look into it for the next update.

Thanks for opening the issue!

@oiver555
Copy link
Author

Understood, thanks for the response and protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants