remoteStorage

Using remoteStorage.io in an Ext.Js 4 (Sencha Inc) application


#1

hi,

I need to integrate remoteStorage.io into an Ext.JS 4 application. Here are some requirements:

  • single page application (SPA, all functionality written in JavaScript, running in the client’s browser)
  • unhosted / backend-less / self-hosted (no specific back-end needed)
  • all data in JSON format, maintained using remoteStorage.io
  • custom implementation of an Ext.JS data store (ext.data.store) preferred (following Ext.JS best practice, no quick n’ dirty hacks if possible)
  • seamless integration into Ext.JS

is this possible? sample codes?

any help / tips / hints are highly appreciated!

cheers


#2

I’d say it all boils down to your Ext.JS data store implementation. remoteStorage.js will take care of the rest.

I have no knowledge of their data store API, but you’d basically just implement the library’s BaseClient methods for queries and persistence.

A colleague and I implemented an adapter for Ember Data a while ago (which is hopelessly outdated by now). Maybe you can draw some inspiration from that: https://github.com/5apps/ember-data-remotestorage/blob/master/packages/ember-data-remotestorage/lib/main.js

Anyway, just start hacking and then we can answer any questions popping up along the way.


#3

You can also have a look at Grouptabs which uses the Dojo Toolkit with its concept of data stores.

Check out
https://github.com/xMartin/grouptabs/blob/bb3c525bce7eb9df87249e63343055cdd2194d13/js/gka/store/RemoteStorageAdapter.js and https://github.com/xMartin/grouptabs/blob/7bd8355fcfd85a2763dade20c760e2e321522f5c/js/gka/app.js

The implementation is currently very simple though, maybe not following best practices…