unum-cloud / usearch

Fast Open-Source Search & Clustering engine Ɨ for Vectors & šŸ”œ Strings Ɨ in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram šŸ”
https://unum-cloud.github.io/usearch/
Apache License 2.0
1.93k stars 110 forks source link

Bug: JavaScript Browser Documentation #191

Open jlarmstrongiv opened 11 months ago

jlarmstrongiv commented 11 months ago

Describe the bug

No documentation can be found for using usearch in the browser.

Wasmer does not have relevant documentation either.

See Discord discussion

Steps to reproduce

Try to import usearch in the browser

Expected behavior

More details or an example is provided on how to import and setup usearch in the browser

USearch version

v1.1.0

Operating System

Browser

Hardware architecture

x86

Which interface are you using?

Other bindings

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 11 months ago

Thank you for acknowledging this issue, @jlarmstrongiv! We are already working with @syrusakbary and broader @wasmerio team to provide a solution šŸ¤—

jlarmstrongiv commented 10 months ago
ashvardanian commented 10 months ago

@jlarmstrongiv, thank you fir sharing those! I will try to address those, and come back with WASM updates with a week šŸ¤—

jlarmstrongiv commented 9 months ago

@ashvardanian thank you! Iā€™m looking forward to it šŸ˜„

aehlke commented 9 months ago

how has it gone? thanks.

jlarmstrongiv commented 6 months ago

The Wasmer JS SDK has been released this week https://wasmer.io/posts/introducing-the-wasmer-js-sdk

ashvardanian commented 6 months ago

@jlarmstrongiv, nice! Can it help us to run USearch in the browser?

jlarmstrongiv commented 6 months ago

@ashvardanian Yes, I think it would. Especially since usearch already builds a Wasmer package

andrewluetgers commented 5 months ago

not sure if this helps but looking into wasmer filesystem it has an in memory fs abstraction in the browser, but it looks like they will be able to support opfs https://github.com/wasmerio/wasmer-js/issues/393

MentalGear commented 5 months ago

Very excited about usearch in the browser, will open up many more applications! Using OPFS for FS should work in all modern browsers!

MentalGear commented 5 months ago

OPFS has iOS/mac Safari support

Screenshot 2024-01-20 at 22 27 54
aehlke commented 5 months ago

I tried to find confirmation that it also works in WKWebView but couldn't find that explicitly

MentalGear commented 5 months ago

I don't know about WKWebView, but since it's basically safari it should. You can always test it yourself when in doubt. RXDB has quite a great info on OPFS:

From the beginning of 2023, the Origin Private File System API is supported by all modern browsers like Safari, Chrome, Edge and Firefox. It is important to know that the OPFS API is only available inside of a WebWorker. It cannot be used in the main thread, an iFrame or even a SharedWorker.

https://rxdb.info/rx-storage-opfs.html#opfs-limitations