Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Localstorage package with async api for better mobile support #1860

Closed
raix opened this Issue · 3 comments

3 participants

Morten N.O. Nørgaard Henriksen alan blount Nick Martin
Morten N.O. Nørgaard Henriksen

Could we please use something like https://github.com/mozilla/localForage instead of the localstorage package - and have accounts use the async api?

I've made a couple of packages making Meteor run on chrome mobile packaged apps / phonegap / cordova / Firefox OS / node webkit etc. Most of these break when it comes to accounts - since accounts relies on the sync version of localstorage.

Why: localstorage blocks

Morten N.O. Nørgaard Henriksen raix referenced this issue in SpaceCapsule/Meteor-cordova
Open

Does this work with meteor 0.7.0.1 + cordova v3.3.x ? #15

alan blount

i'm interested in this as well... be careful with this, "meteor+mobile=awesome"

Nick Martin
Owner

This is interesting. Sounds like a cool feature to add someday.

A start might be a localforage package on atmosphere.

Closing as a feature request. https://github.com/meteor/meteor/wiki/Contributing-to-Meteor#wiki-making-changes-to-meteor-core

Nick Martin n1mmy closed this
alan blount

crossposting for reference, see issue #2643


In more research on this, I've heard that localStorage may be un-reliable on cordova (the OS can clear localStorage) and it looks like many people complain about localStorage in general.

But it's certainly the only way (currently) that Meteor stores the login token... see here:
https://github.com/meteor/meteor/blob/611298fb50554b81a1889314ce8745b0b12b2f9d/packages/accounts-base/localstorage_token.js#L66-68

I'm now looking at localForage
Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.
Already packaged by good ole' @raix here:
https://github.com/raix/Meteor-localforage

Now, I wonder if I can override Meteor._localStorage...

and then from: Morten

@zeroasterisk look at ground:store instead, its tailored meteor, localforage is the inspiration, but the groud:store is more meteor like. (Im using this in ground:db since neither meteor.localstorage nor localforage felt/worked ) it allows local async storage adapters. At the moment ive only written the localstorage adapter, but an adapter for cordova filesystem is to come (we also need this stuff on the CollectionFS project for client side storage)

https://github.com/GroundMeteor/store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.