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

IndexedDb access? #1233

Closed
artem-v-shamsutdinov opened this issue Sep 29, 2018 · 6 comments
Closed

IndexedDb access? #1233

artem-v-shamsutdinov opened this issue Sep 29, 2018 · 6 comments

Comments

@artem-v-shamsutdinov
Copy link

Hi,

Q: I'm a complete wasm newb and am about to start writing a SPA in Rust using yew. My project requires lots of interaction with IndexedDb. My question is can WebAssembly interact with IndexedDb and if so does it have to go though JavaScript first? I've read that I/O heavy applications are actually slower in WebAssembly because of the requirement to go through JavaScript and would like to put my doubts to rest.

Thank you for you time in answering this question!

@xtuc
Copy link

xtuc commented Sep 29, 2018

You can access IndexedDb through the host, you need to import JavaScript functions that interacts with IndexedDb.

@artem-v-shamsutdinov
Copy link
Author

Understood. Thank you! :)

@artem-v-shamsutdinov
Copy link
Author

A small follow up question: Is there a proposal out there to allow direct access between WebAssembly and IndexedDb? If there isn't should there be one?

Thanks, :)

@Pauan
Copy link

Pauan commented Oct 1, 2018

@Russoturisto I believe that is covered by the host-bindings proposal which allows wasm direct access to host APIs (including browser APIs).

You can see an overview of the proposal here.

@artem-v-shamsutdinov
Copy link
Author

Awesome! Thank you so much! :)

@jonathangurwitz
Copy link

@Russoturisto
I would love to know the outcome. I am thinking about using wasm with indexeddb too

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

4 participants