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

Handle storage of data "locally" on a Project better #88

Open
rufuspollock opened this issue Mar 9, 2013 · 4 comments
Open

Handle storage of data "locally" on a Project better #88

rufuspollock opened this issue Mar 9, 2013 · 4 comments
Labels

Comments

@rufuspollock
Copy link
Contributor

Why

Reasons why we need local data ...

  • It means that stuff like the viz screw-up with house prices does not happen (we make a transformation in a script which adds a field, we use this field in a graphy, now reload and it breaks because trying to graph a field that is not there)
  • It means that local file data loading works (i.e. we can load that project again later!)
  • It means stuff does not break if data disappears
  • It means you can work offline ...

Implementation

Alternatives ...

Plan

We will go for just removing localStorage

Notes on Indexed DB Libraries

Indexed DB itself has a fairly painful API. We therefore probably want to use a wrapper.

Two existing JS wrappers. Both do a good job of removing some of the pain of using IndexedDB and of working consistently cross-browser. These are my rough impressions:

  • IDBWrapper by Jens Arp - https://github.com/jensarps/IDBWrapper
    • Comprehensive but somewhat inelegant API (IMO) (this is likely somewhat intentional as has declared purpose to expose full IDB functionality: "show how IDB works. The code is split up into short methods, so that it's easy to see what happens in what method")
    • Tutorials: Part i Part II
  • db.js by Aaron Powell
    • https://github.com/aaronpowell/db.js
    • Promises style API and generally slightly cleaner API compared to IDBWrapper
    • When I checked it the Travis build was failing and it had not been updated for a few months (it may not need it)
@rufuspollock
Copy link
Contributor Author

Added notes about IndexedDB wrapper libraries

@ghost ghost assigned rufuspollock Apr 8, 2013
@ghost ghost assigned djw Apr 15, 2013
@djw
Copy link
Contributor

djw commented Apr 23, 2013

Local storage gone in #99. The plan is to persist data to gists in the short term, later reintroducing an IndexedDB-based local cache.

@djw
Copy link
Contributor

djw commented Apr 24, 2013

There's a work-in-progress pull request here: #101

@djw djw mentioned this issue Apr 24, 2013
3 tasks
@rufuspollock
Copy link
Contributor Author

Wonder if @maxogden's https://github.com/maxogden/level.js + levelup would be useful here ...

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

No branches or pull requests

2 participants