remoteStorage + Ember

44 views
Skip to first unread message

Sébastien Nicouleaud

unread,
Mar 16, 2013, 10:15:21 AM3/16/13
to unho...@googlegroups.com
Hi everybody!

Does anyone know of an existing open-source application using both Ember.js and remoteStorage.js?
I'm having a hard time figuring out how to use them together, and it would help a lot to read some existing code...

Cheers,
Seb

Sebastian Kippe

unread,
Mar 16, 2013, 1:40:04 PM3/16/13
to unho...@googlegroups.com
Hi Seb,

good question! I played around a bit, but I haven't got anything worth sharing so far. I thought about creating an Ember Data adapter, which would probably be the best idea, because that is deeply integrated with the router etc.

You're welcome to join #remotestorage on Freenode if you want to directly discuss, share or work on sth together!

Cheers
Basti


--
 
---
You received this message because you are subscribed to the Google Groups "Unhosted Web Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unhosted+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michiel B. de Jong

unread,
Mar 16, 2013, 10:25:44 PM3/16/13
to unho...@googlegroups.com
hi!

i don't think there is, there is a Dojo one (grouptabs) and a Backbone
one (litewrite) and i heard people talk about Angular.

in general MVC frameworks don't play nicely with remoteStorage, because
the thing they do overlaps.

i'm not a frameworks kind of person, but as i understand it, they tend
to provide two big things: templating and MVC, and sometimes UI
components and/or other things as well.

The core of remoteStorage is the sync, which would be the backbone
"store" or the emberjs "V model". The models are not behind that in
terms of interface layering, they are in front of it. They are mixed in
with the controllers into per-domain modules (gh:remotestorage/modules).
So if you're going to use a framework in combination with remoteStorage,
then you will only benefit from its templating and its components, not
from its MVC.

Out of curiosity, what app are you building? make sure to add it to
https://unhosted.org/apps/ when you launch it! :)

hth!
Michiel

☮ elf Pavlik ☮

unread,
Mar 17, 2013, 8:11:59 AM3/17/13
to unhosted, shy...@gmail.com
Excerpts from Michiel B. de Jong's message of 2013-03-17 02:25:44 +0000:
> On 2013-03-16 22:15, Sébastien Nicouleaud wrote:
> > Hi everybody!
> >
> > Does anyone know of an existing open-source application using both
> > Ember.js and remoteStorage.js?
> > I'm having a hard time figuring out how to use them together, and it
> > would help a lot to read some existing code...
> >
> > Cheers,
> > Seb
> >
>
> hi!
>
> i don't think there is, there is a Dojo one (grouptabs) and a Backbone
> one (litewrite) and i heard people talk about Angular.
http://sharedstuff.org uses angular but to my knowledge not ported to 0.7 ? (author in cc)

Sebastian Kippe

unread,
Mar 17, 2013, 9:11:20 AM3/17/13
to unho...@googlegroups.com, Garret Alfert
Hi,

> in general MVC frameworks don't play nicely with remoteStorage, because the thing they do overlaps.

Uhm, that would mean DOA for remoteStorage if true.

> The core of remoteStorage is the sync, which would be the backbone "store" or the emberjs "V model". The models are not behind that in terms of interface layering, they are in front of it. They are mixed in with the controllers into per-domain modules (gh:remotestorage/modules). So if you're going to use a framework in combination with remoteStorage, then you will only benefit from its templating and its components, not from its MVC.

I don't think that's true. The model of the MVC framework is only an ad-hoc representation of an object. You would load it by asking Ember Data and in turn remoteStorage.js to load the content, or via events emitted by rs.js. Your problem as I see it stems only from too much use of the remoteStorage modules. I personally don't need any module-specific methods – loading, validating and storing objects with a JSON schema is enough, and that should be the same methods for all modules, right?

I will cc @galfert. I think he created a whole app with Ember and remoteStorage, which he stopped working on though.

Cheers,
Basti

Sebastian Kippe

unread,
Mar 17, 2013, 8:16:47 PM3/17/13
to unho...@googlegroups.com
Hi again,

@galfert and I just hacked on an Ember Data adapter, and we have all the basics working. When not using module-specific methods it actually maps quite perfectly, and we can even forward the validation errors and messages to Ember's implementation. All in all, it looks like we can have near-perfect integration between remoteStorage.js and Ember.js with Ember Data.

It's still not really shareable, as we only have our hacked-up chaos lying around now, as well as a half-working example app. But we'll continue this week and let you know when it's on GitHub.

Cheers,
Basti


On Mar 16, 2013, at 2:15 PM, Sébastien Nicouleaud <sebastien....@gmail.com> wrote:

Sébastien Nicouleaud

unread,
Mar 18, 2013, 3:33:45 AM3/18/13
to unho...@googlegroups.com
2013/3/17 Michiel B. de Jong <anyt...@michielbdejong.com>
Out of curiosity, what app are you building?

It's an app to manage the gifts I want to offer to my friends / family : view upcoming events (birthday, christmas...), quickly note a gift idea before I forget it, manage collective gifts, generate a shopping list...
I think it would store birthdays as regular calendar events. It could probably also generate tasks for a todo app.

 
make sure to add it to https://unhosted.org/apps/ when you launch it! :)

Sure, as soon as it has some basic feature working :)

Seb

Sébastien Nicouleaud

unread,
Mar 18, 2013, 4:00:28 AM3/18/13
to unho...@googlegroups.com
Hi Basti,
 
@galfert and I just hacked on an Ember Data adapter, and we have all the basics working. When not using module-specific methods it actually maps quite perfectly, and we can even forward the validation errors and messages to Ember's implementation. All in all, it looks like we can have near-perfect integration between remoteStorage.js and Ember.js with Ember Data.

Wow! You guys are too fast for me :)
I also started working on it, but I was far from having some working solution.
Didn't you have some issue with Ember router, when redirected back to your app after connecting to your remote storage ?
The redirected URL looks like "http://my.app/index.html#access_token=12345", which router complains about, assuming "#access_token" should be an existing route.
(I'm using remoteStorage-modules-debug.js v0.7, with 5apps.com as a backend, maybe it has something to do with one of these ?)


It's still not really shareable, as we only have our hacked-up chaos lying around now, as well as a half-working example app. But we'll continue this week and let you know when it's on GitHub.

I'd be glad to help, even if the code is not production-ready :)


Cheers,
Seb

Sebastian Kippe

unread,
Mar 18, 2013, 7:39:50 AM3/18/13
to unho...@googlegroups.com
Hi Seb,

Didn't you have some issue with Ember router, when redirected back to your app after connecting to your remote storage ?
The redirected URL looks like "http://my.app/index.html#access_token=12345", which router complains about, assuming "#access_token" should be an existing route.

Yes, that problem still exists, but we didn't tackle it yet. We'll have to either fix it hacking Ember or adding a custom-redirect-URL feature to remoteStorage.js. Not sure which is better, but it'll be a problem with any router using URL fragments. It's a fragment instead of a parameter on purpose btw, because the fragment can only seen by your browser, whereas the parameter could be read by the server after the redirect.

I'd be glad to help, even if the code is not production-ready :)

Yes, we'll push before it's production-ready (or maybe it is by then). We'll just have to clean up our mess a bit and add some tests first.

Cheers,
Basti

Sébastien Nicouleaud

unread,
Mar 18, 2013, 8:03:52 AM3/18/13
to unhosted
2013/3/18 Sebastian Kippe <sebasti...@gmail.com>
Yes, that problem still exists, but we didn't tackle it yet. We'll have to either fix it hacking Ember or adding a custom-redirect-URL feature to remoteStorage.js. Not sure which is better, but it'll be a problem with any router using URL fragments. It's a fragment instead of a parameter on purpose btw, because the fragment can only seen by your browser, whereas the parameter could be read by the server after the redirect.

Ok, thanks for the explanation.
It should not be too hard to adapt my router.
I'll give it a try this evening.

Seb

Reply all
Reply to author
Forward
0 new messages