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

db, browser: Add support for persistence in the browser #533

Merged
merged 4 commits into from Nov 18, 2019

Conversation

@albrow
Copy link
Member

albrow commented Nov 15, 2019

Fixes #532.

This PR adds support for persistence in browser environments. This is accomplished by using BrowserFS backed by IndexedDB. The bulk of the work is actually in our fork of goleveldb, where we have an open PR.

This solves the limitations of using localStorage as the backing for BrowserFS (limited to 10MB). This PR also includes code which will fallback to using an in-memory database if BrowserFS is not available. This is important because it allows us to continue to use wasm-browser-test for testing (wasm-browser-test does not offer any way to sideload JavaScript dependencies).

BrowserFS+IndexedDB support is included in the integration tests and I have also manually tested that it works with the browser example.

@albrow

This comment has been minimized.

Copy link
Member Author

albrow commented Nov 15, 2019

Looking into issues with the integration tests. Hopefully it's an easy fix.

@albrow albrow changed the title Add support for persistence in the browser WIP: Add support for persistence in the browser Nov 15, 2019
albrow added 2 commits Nov 15, 2019
@albrow albrow changed the title WIP: Add support for persistence in the browser Add support for persistence in the browser Nov 15, 2019
@albrow albrow requested a review from fabioberger Nov 15, 2019
@albrow

This comment has been minimized.

Copy link
Member Author

albrow commented Nov 15, 2019

CI issues resolved. Removing WIP tag.

@albrow albrow changed the title Add support for persistence in the browser db, browser: Add support for persistence in the browser Nov 15, 2019
db/open_js.go Show resolved Hide resolved
db/open_js.go Outdated Show resolved Hide resolved
Co-Authored-By: Fabio B <me@fabioberger.com>
@albrow albrow merged commit cd1d6c0 into development Nov 18, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@albrow albrow deleted the feature/browser-persistence branch Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.