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

use remoteStorage.js to enable people to save & sync their presentations #8

Closed
jancborchardt opened this issue Jun 16, 2012 · 40 comments
Assignees

Comments

@jancborchardt
Copy link
Contributor

remoteStorage.js is a client-side library to add remoteStorage support to your client-side app. There is a tutorial for example usage and more info in the readme of the repository.

Basically, remoteStorage is an open standard to seperate web apps from per-user data storage – whereas at the moment, most web apps are an app+storage package deal. Check the website of the unhosted movement for more info, and feel free to join our chat room if you have questions.

@tantaman
Copy link
Owner

I was actually planning on looking into this. Is there a list of existing remote storage providers or is it pretty much just limited to 5apps.com at the moment?

@jancborchardt
Copy link
Contributor Author

Oh, nice! The big remoteStorage providers right now are OwnCube (ownCloud hosting), 5apps, and the federation of Dutch universities (meaning all Dutch students can use their uni email as remoteStorage). A comprehensive list of the software & providers is at our state of the movement, further down, at »remoteStorage software & providers«.

I'm very interested in Strut for the new way it handles presenting with Impress.js (as designer I used to be a Prezi hater, but then realized if the presentation is well-designed, it can work really good with that technique). So I’ll do a bit of interface & interaction design recommendations if that’s ok. If time allows I’ll even try to jump in with coding.

@tantaman
Copy link
Owner

thanks for your updates! I've started on implementing remote storage support. Right now I've added a wrapper that'll handle authentication and remote storage client creation:
https://github.com/tantaman/Strut/blob/14aea8855bfbe0762351ddbd23457d04608fa820/client/web/scripts/common/RemoteStorageWrapper.js

@jancborchardt
Copy link
Contributor Author

Nice one! If you have any technical questions on remoteStorage, ideally join our IRC channel / chat room #unhosted on freenode. In there just ask @michielbdejong, he mainly works on the protocol and remoteStorage.js

Or if you don’t use IRC, join our mailing list. Welcome to the Unhosted movement! :)

@tantaman
Copy link
Owner

I'll check out the IRC channel. The remote storage protocol is a great idea. I'm kind of surprised there hasn't been a remote storage effort before now.

@michielbdejong
Copy link

great! remoteStorage wasn't done before 2011 because CORS didn't really exist yet, and people didn't think about the option of writing unhosted web apps until Google Gears went into html5 and went mainstream. for instance, OAuth2 has the implicit grant flow which allows for use from unhosted web apps, but OAuth1 did not. Also, webfinger did not mention CORS a year ago. people were just too engrained into client-server thinking for the decades preceding 2011. luckily that has changed now, and there are loads of client-side javascript frameworks, cloud storage platforms that provide "easily pluggable backends for unhosted web apps", and now in 2012, you see people programming unhosted web apps everywhere. i should probably warn that remoteStorage 0.7 will have a different api than remoteStorage 0.6.9 - if you come to irc we can chat about the implications of that!

@tantaman
Copy link
Owner

@michielbdejong
Yeah, not having CORS would be a big road block.

Also, I didn't see a way to list the keys that have already been stored in a given "directory"... Is there not a way to do that yet or am I missing something obvious?

I guess I would have expected something like: client.get("some/thing") to return the list of keys stored under some/thing or, if a value was associated to some/thing, to return the value at some/thing. Maybe even a list or getKeys method?

@michielbdejong
Copy link

ok, you definitely want to wait for version 0.7 :) then we'll have
client.get('some/') (ending in a /) return a directory listing. should
hopefully be out next week!

On Tue, Jun 19, 2012 at 3:11 AM, Matt Crinklaw-Vogt
reply@reply.github.com
wrote:

@michielbdejong
Yeah, not having CORS would be a big road block.

Also, I didn't see a way to list the keys that have already been stored in a given "directory"...   Is there not a way to do that yet or am I missing something obvious?

I guess I would have expected something like: client.get("some/thing") to return the list of keys stored under some/thing or, if a value was associated to some/thing, to return the value at some/thing.  Maybe even a list or getKeys method?


Reply to this email directly or view it on GitHub:
#8 (comment)

@tantaman
Copy link
Owner

let me know if there is anything I can do to help out now or in the future.

@tantaman
Copy link
Owner

@michielbdejong so how is 0.7 coming? I'm assuming I'd have to wait for remote storage providers to upgrade to 0.7 as well before I can use client.get('some/')

@michielbdejong
Copy link

hi! i put it in developer preview a few hours ago:
https://github.com/unhosted/remoteStorage.js/tree/v0.7

it doesn't do the syncing yet, i'm still working on that, but there
are already experimental 'tasks' and 'documents' modules.

have a look in the 'example' directory, do those make sense?
especially the 'litewrite' example should be a good starting point for
strut, i think? or should we create a new 'presentations' module that
does special presentations-specific things that don't apply to normal
(text) documents?

On Thu, Jun 28, 2012 at 3:04 PM, Matt Crinklaw-Vogt
reply@reply.github.com
wrote:

@michielbdejong so how is 0.7 coming?  I'm assuming I'd have to wait for remote storage providers to upgrade to 0.7 as well before I can use client.get('some/')


Reply to this email directly or view it on GitHub:
#8 (comment)

@michielbdejong
Copy link

btw here's an example of how client.get('some/') works: https://github.com/unhosted/remoteStorage.js/blob/v0.7/src/modules/tasks-0.1.js#L26
you probably want to copy tasks-0.1.js or documents-0.1.js into presentations-0.1.js, and add basic presentations-related functionality to it. the separation between apps and reusable modules is still a bit new, we would love to get some feedback on that as well! :)

@tantaman
Copy link
Owner

tantaman commented Aug 9, 2012

So how goes the much awaited 0.7 release?

@jancborchardt
Copy link
Contributor Author

Yeah! @michielbdejong and I just talked earlier, and a version with working sync (although still a bit alpha) might be ready in the next 2 days! :)
Also cc @nilclass on this

@michielbdejong
Copy link

yep! it will still be very alpha but i'll open it up for experimentation
with a reference implementation of the server-side part tomorrow

On Thu, Aug 9, 2012 at 6:55 PM, Jan-Christoph Borchardt <
notifications@github.com> wrote:

Yeah! @michielbdejong https://github.com/michielbdejong and I just
talked earlier, and a version with working sync (although still a bit
alpha) might be ready in the next 2 days! :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-7619893.

@jancborchardt
Copy link
Contributor Author

I tried to check out the remoteStorage branch and also saw the connect widget in the code at https://github.com/tantaman/Strut/blob/b3c4fab478ba14be58d3c7ec355a20780c316b45/src/ui/editor/res/templates/Editor.bars#L47

But it doesn’t show up for me – I compiled, inspected the page, I don’t know where it is. Am I doing something wrong @tantaman?

@tantaman
Copy link
Owner

tantaman commented Oct 7, 2012

I tried making a new clone and it worked fine over here. Was there any output in the log?

@jancborchardt
Copy link
Contributor Author

Sorry for taking so long, here’s the errors I had:

@tantaman
Copy link
Owner

compiling strut is a bit different now. Make sure you have the latest and
run "rake devbuild." Or you can just run "guard"

On Sat, Oct 20, 2012 at 6:20 AM, Jan-Christoph Borchardt <
notifications@github.com> wrote:

Sorry for taking so long, here’s the errors I had:
https://a248.e.akamai.net/camo.github.com/412c7e319b6d823f80b27fadbdaa9ad3fa40e9cb/687474703a2f2f692e696d6775722e636f6d2f70305459762e706e67


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-9629894.

@jancborchardt
Copy link
Contributor Author

I get this error:

rake devbuild --trace
rake aborted!
no such file to load -- listen
/home/user/strut/Rakefile:9:in `require'
/home/user/strut/Rakefile:9
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run'
/usr/bin/rake:27

@nilclass
Copy link

try gem install listen

@jancborchardt
Copy link
Contributor Author

Gem installed, although with some errors:
Successfully installed listen-0.5.3
1 gem installed
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"

But still get the same error.

Regardless of my compilation problems: Does it work with syncing the presentations?

@tantaman
Copy link
Owner

I'd have to look at it again but there are probably one or two more things
left to do to get it syncing.

I'll remove the listen dependency (it is actually removed in master) and
let you know when it is syncing presentation.

On Mon, Oct 22, 2012 at 11:51 AM, Jan-Christoph Borchardt <
notifications@github.com> wrote:

Gem installed, although with some errors:
Successfully installed listen-0.5.3
1 gem installed
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]:
invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]:
invalid date format in specification: "2011-08-25 00:00:00.000000000Z"

But still get the same error.

Regardless of my compilation problems: Does it work with syncing the
presentations?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-9669099.

@michielbdejong
Copy link

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:

  • putting domain code into the module (notes.js in the example)
  • send controller actions to the module
  • update the DOM only when the module gives you a change event

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 Strut compatible with the latest lib before we add it on https://unhosted.org/apps/ :)

@tantaman
Copy link
Owner

tantaman commented Feb 5, 2013

@michielbdejong I like the new API. Seems much more straightforward and I'm not having as many issues with it as I was having a few months ago.

I'm thinking through the best way to start Strut now since the users last save could be local or remote.

@tantaman tantaman closed this as completed Feb 5, 2013
@tantaman tantaman reopened this Feb 5, 2013
@michielbdejong
Copy link

that question is entirely dealt with by the library, as long as you make sure your module implements the baseClient.on('change') events, and also has a way of pro-actively passing incoming changes to the app.

if you look at how https://github.com/RemoteStorage/remoteStorage.js/blob/master/example/minimal/notes.js does it, you see it allows the app to set something, and get it back. This will work even if the user is not connected (!). it will just use localStorage or IndexedDB in that case, and this is entirely transparent (!) to the app.

when the page loads, the app simply asks the module for the user's data, whether that is local or remote does not matter at this point. Then, if/when the user connects, at a random moment during the use of the app, any data that is fetched from remote then is passed on to the app for display using the on('change') handler:
https://github.com/RemoteStorage/remoteStorage.js/blob/master/example/minimal/index.html#L42

HTH

tantaman added a commit that referenced this issue Feb 17, 2013
Allows usage of different storage backends such as
RemoteStorage, LocalStorage, Filesystem, etc.

GH-8
tantaman added a commit that referenced this issue Mar 14, 2013
Open/Save As dialog allows selection of remote storage

Upon selection of remoteStorage the user may authenticate to their
remoteStorage account.

Selection of remoteStorage in the save/open modals displays the remoteStorage widget.

Includes a presentations remoteStorage module that may or may not conform to the current remoteStorage interface.

GH-8
@tantaman
Copy link
Owner

@jancborchardt @michielbdejong It has been quite a long time coming but remoteStorage support has finally landed in the https://github.com/tantaman/Strut/tree/rewrite branch.

Chrome & Firefox loading & saving the same presentation via remoteStorage
remotestorage1

@michielbdejong
Copy link

that's great!! i'll go try it out :) thanks for this!!

@tantaman
Copy link
Owner

The rewrite branch isn't feature complete but you can test out saving/loading and the basics.

@tantaman
Copy link
Owner

tantaman commented Apr 7, 2013

@michielbdejong I published a built version of the rewrite branch to gh-pages so you can try out the remote-storage integration: http://tantaman.github.io/Strut/dist-rewrite/index.html

@gotwig
Copy link

gotwig commented Apr 7, 2013

@tantaman wow, that is great.

How can I use remote-storage? It wants some sort of an email address? I used my gMail address but it doesnt work, it says error.

@tantaman
Copy link
Owner

tantaman commented Apr 7, 2013

@gotwig oops, it looks like the remoteStorage widget is getting cut off. It should have a link to http://remotestorage.io that explains how RemoteStorage works.

@gotwig
Copy link

gotwig commented Apr 7, 2013

@tantaman I already got it working...

but why does no *** provider really explain how to setup it... no one said its like YOURUSERNAME@5apps.com, e.g at 5apps.com.... It runs pretty nice, I get the idea, thx!

But how to integrate it into google drive?

@tantaman
Copy link
Owner

tantaman commented Apr 7, 2013

@gotwig Yeah, I seem to remember remoteStorage being more user friendly a few months back.

I also remember coming across google drive integration that some guy on github did. I'd have to find it again.

@michielbdejong
Copy link

yes, the reason it's not very clear now is that the instructions about how the user address works and the link to remotestorage.io were in the part of the widget that is being cut off in the ui... this is not a problem for returning users, but i can see how it will be confusing for new users.

great stuff! i have added Strut to https://unhosted.org/apps/ :)

@tantaman
Copy link
Owner

closing. Making separate issues for minor problem (e.g., widget being cut off).

@tantaman
Copy link
Owner

and the fact that RemoteStorage caches to LocalStorage which poses problems when things are over 5mb......

@ghost
Copy link

ghost commented May 30, 2014

Hey!
I was trying to get this remote storage working in Strut. My basic need is to save this Strut presentation and then use it in some website. I am new to this. I followed https://github.com/tantaman/Strut to build the app and then when i launch it with 5apps there is no option to link it to remote storage. Is that what you meant by widget being cut-off? I can't save the file anymore as local storage also.Please let me know where I am wrong or what to refer. I am new to this. Thanx in advance!

@michielbdejong
Copy link

Just for completeness -

RemoteStorage caches to LocalStorage

This was true at the time of writing, but remotestorage.js now used IndexedDB when it's available.

@ghost
Copy link

ghost commented May 30, 2014

So I can't use remote storage for Strut? Is that so? Sorry I am really new to this.

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

No branches or pull requests

5 participants