Are there any plans to add the local datastore to the Javascript SDK just like it happened in the Android/iOS SDK?
While I can save object.toJSON() to the localStorage, the JSON serialization does not recursively save all the other objects that were included in the query but renders out pointers instead.
We're actively exploring methods of local storage, so that apps built on platforms like React Native can perform queries when offline. The biggest questions at this point are around how the storage would be interfaced, and whether it would live in the SDK or an addon. For interfaces, the current frontrunner is a Flux-like store based on the one from Parse+React, which fits well in to the new SDK's internal storage scheme. As for where it lives -- the new Controller-based architecture of the SDK makes it really easy to replace individual pieces, and provide functionality as external libraries that are loaded at runtime.
:+1: We have an iOS app that uses parse and the local datastore. We would like to use parse for a desktop app written with Electron. Ideally, we could use the same methods (pinInBackground, .fromLocalDatastore, etc). Would that work if it was an add-on?
Any update on availability of a local datastore for React Native?
Also, are you working on any strategies to make query subscriptions more React-like? Unless I'm mistaken, the only way to refresh on-screen data is to re-query the datastore periodically, without any knowledge of whether the underlying data has changed. Thanks!
+1 on any update regarding a React Native local datastore. Trying to choose between hacking something together on SQLite or integrating parse with the hope that storage is eventually figured out.
Even a negative timeframe like "Not in the next 3 months" would be super helpful.
+1 I think this is much needed - especially for React Native apps.
Agreed with @carbureted. If local storage is not the priority, please let us know so that we could make a sound decision of what to do.
It's not a priority at the moment, because it would take some significant restructuring to provide any valuable querying over local objects. If we were to implement a LocalDatastore similar to the one seen on Android / iOS, it would probably be a redesign version that avoids some of the less performant aspects of pinning. Any API we would implement would also want to be something that works the same way on both React Native and and offline ServiceWorker web apps, so there's a lot of thinking to do here before any action is taken.
Any progress here? Shall we just need to wrap the native SDKs to achieve this?
Hi @carbureted. If you happen to use Redux for local storage, you can take
advantage of redux-persist for seamless local storage.
On Wed, Jul 27, 2016 at 3:40 AM, fxwan [email protected] wrote:
Any progress here? Shall we just need to wrap the native SDKs to achieve
this?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ParsePlatform/Parse-SDK-JS/issues/77#issuecomment-235510155,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG758JjQH0XBGYsq6OpFrn6b13MNHnB-ks5qZwt0gaJpZM4GaGRU
.
Since my mobile apps will be written in javascript this is the one feature that is pushing me towards Firebase. Offline support for javascript mobile apps is supported with the Firebase js sdk. It would be great if the Parse Platform team would put a higher priority on this feature as I would rather go with Parse.
I guess it will be also an awesome option for IoT projects.
Any news on this?
Thie feature is still missing.
I'll wait for this.
PouchDB can be used on the device for off line storage, one can find a creative way to pull data entered during offline and pass it to the parse SDK to be sent to the server.
Any news on this ?
Bumping.
+1 making offline store for React Native
+1 I'd also welcome this feature
+1 WAY important
As many people request this feature, we can offer guidance on the implementation. We are strapped as the core maintainers have their cup pretty full with all the projects and the ongoing work on other repositories. If anyone / many want to get on it, feel free to reach out!
Is the frist step.. to create PWA! And say "only in Android/iOS", is not a solution.
I'm currently using ionic and it supports sqlite for querying which is similar to iOS SDK. If react-native also supports offline, redux, could we create an adapter / interface to support scaling.
I'm familiar with SQL so I'm willing to create an adapter for it.
I think it should be framework agnostic. Parse-SDK-JS works fine with React, Angular/Ionic, Vue or any framework you like. Local Datastore should not be tied with one framework or something like that.
Agreed with @cleever. Also, what offline features do we want exactly?
@flovilmart I use the iOS local datastore a lot so. But i need something simple like pin an object and query it back is a good start.
Also would we implement it similar to what you did with the react-native async storage issue? I'm trying to see the best way to implement this.
I believe we can leverage the same provided local datastore. JS / web datastore i believe settled on key/value stores no? Pin and queries can live with this, without requiring complex SQL. I you look at the implementation on iOS, you’d see the objects are stored as blobs, indexed in a single table, having the className /id as primary key.
So having a good key value store implementation at first could be good. As object structures are not known, this will come at a perf cost, but, I guess it’s acceptable.
Still curious of what we should implement first ;)
So having a good key value store implementation at first could be good.
Key / Value is more widely used if you are going framework agnostic.
What do you think the Key / Value should be?
I you look at the implementation on iOS, you’d see the objects are stored as blobs, indexed in a single table, having the className /id as primary key.
Just looked at iOS. But iOS uses simple SQL queries.

I can start a PR for pinWithName and fromPinWithName as a start and we can build from there.
Default can use localStorage
Yeah, that makes for simple queries, which are easier to implement in a key/value manner. I haven’t dug very deep in all the mechanics but the iOS SDK also loads the objects from memory / datastore when created by id without data, also keeping the single instance in memory per objectId
I don’t understand it all either lol. I wish localStorage at least was like redis where it you can use * with keys.
Edit: There might be a workaround. You can get all keys from localStorage and do a match or would in memory be better?
I started on a PR https://github.com/parse-community/Parse-SDK-JS/pull/612 if you want to move the discussion there.
Most helpful comment
Hi @carbureted. If you happen to use Redux for local storage, you can take
advantage of redux-persist for seamless local storage.
On Wed, Jul 27, 2016 at 3:40 AM, fxwan [email protected] wrote: