vcuculo / ghost

Experimental web app using WebRTC and remoteStorage.js
https://ghost.5apps.com/
11 stars 7 forks source link

updating Ghost to remoteStorage release v0.7 #5

Closed michielbdejong closed 11 years ago

michielbdejong commented 11 years ago

Hi @vcuculo,

Good news: @nilclass tagged the release of remoteStorage.js version 0.7.0 yesterday. here is an example of how it works: https://github.com/michielbdejong/remoteStorage.js/blob/master/example/minimal/index.html so because sync is "behind" the modules with remoteStorage.js 0.7, the app architecture is a matter of:

here are reference docs: http://remotestoragejs.com/doc/code/files/remoteStorage-js.html

let me know what you think! it would be nice to update this so we can have Ghost-unhosted-webrtc compatible with the latest lib before we add it on https://unhosted.org/apps/ :)

vcuculo commented 11 years ago

hey @michielbdejong, it's a great news! I've followed the development of 0.7 and an update to the latest lib was already on my plans. I hope I can do it asap, you'll receive my news :)

michielbdejong commented 11 years ago

great! also http://remotestorage.io/ was updated a minute ago, let us know if there is (still) any documentation missing! :)

vcuculo commented 11 years ago

I've a question about the lib. claiming access to the module transfers automatically all the data contained in the related folder to the localstorage?

michielbdejong commented 11 years ago

by default yes, but you can avoid that by doing the following:

    remoteStorage.defineModule('mymodule', function(privateClient, publicClient) {
      return {
        exports: {
          dontSync: function() {
            privateClient.release('');
            publicClient.release('');
          }
        }
      };
    });
    remoteStorage.claimAccess({ mymodule: 'rw' }).then(function() {
      remoteStorage.displayWidget('remotestorage-connect');
      remoteStorage.mymodule.dontSync();
    });

sorry that you still need 14 lines of code like this before you even get started, we are discussing how to simplify that, but for now that is the way to do it.

vcuculo commented 11 years ago

the main problem was the localstorage limit (e.g. 2.5 MB per origin in Google Chrome) but this should avoid the quota exceeded error. thanks!

jancborchardt commented 11 years ago

@vcuculo better support of binary data through using IndexedDB is on the plan, see https://github.com/RemoteStorage/remoteStorage.js/issues/189

vcuculo commented 11 years ago

problem is still there when I try to call getAll method. I guess it would solve using indexdb. btw the code is halved using 0.7, great work! :+1:

vcuculo commented 11 years ago

Done! Old pictures arent accessible because now images resides in public folder, since localstorage cant contain them all