These are chat archives for ractivejs/ractive

2nd
Oct 2014
Romain Dardour
@unity
Oct 02 2014 16:19
Hey Martin!
Martin Kolárik
@MartinKolarik
Oct 02 2014 16:59
Hi!
Romain Dardour
@unity
Oct 02 2014 17:01
Just posted an issue on ractive-router for you :) We-re building a largeish dashboard, and Ractive has grown on me so much I really want to make it work
Really like that Ractive is designer-oriented. It feels pragmatic to a designer like me
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:05
Yep, I've seen the issue. I'm going to respond to the first two points on GitHub, but I'm not sure about the third one. How is react-router diffrent?
Romain Dardour
@unity
Oct 02 2014 17:06
Well it's more of a personal taste, and it's due to JSX and it's fake html
but I always have a personal preference to declare application strutcture in HTML, and Components in Ractive make this a bliss
Not sure how it can translate to routing though, but React-router + JSX makes the paradigm stick
What I mean is : Do you envision a way to not have to declare routes in code as you're doing, but rather by writing some sort of HTML? - What React gets right is the mapping between app structure and markup
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:12
Ah I see. We'd have to come up with some kind of markup.
Romain Dardour
@unity
Oct 02 2014 17:12
Well the hard part is coming up with something that feels natural, not contrived, otherwise it's still better to stick with code.
I couldn't envision a way personally.
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:13
I prefer to do this in JS so that I can use the same HTML for server-side rendering.
Romain Dardour
@unity
Oct 02 2014 17:13
Right. good point
As for the Link helper, I feel it's really a biggie. I've had long thoughts about reusability of components and building URLs and they clash quite a bit. Passing all the data the component needs to build the entire URL, obviously sucks and is not reusable. Component needs to know about app structure as is.
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:16
yeah, about that.. I think it would help if relative urls were interpreted correctly.
Romain Dardour
@unity
Oct 02 2014 17:17
Except in the example I gave you it wouldn't work
from /org/abc/messages/1234 to /org/abc/users/1234 -> no go
you need to be aware of /org/abc
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:19
You wrote only /org/abc/messages on GitHub. In that case you could use a relative link (users/1234)
But it's a good point that it wouldn't work in other situations.
This message was deleted
Romain Dardour
@unity
Oct 02 2014 17:20
sorry about that, Point is, relative urls don't work in every situation, only at the same level of nesting or more. no way to "back up"
Martin Kolárik
@MartinKolarik
Oct 02 2014 17:38
so how would the link helper work? If you want to link from one component to the other, you still need to know something about the URL structure.
what about having a function that parses location.pathname and returns the part you need?
Romain Dardour
@unity
Oct 02 2014 20:33
I agree. but I think it'd be better if the router had the knowledge of the structure instead of the component. That way a component can link differently when shown on different pages
Martin Kolárik
@MartinKolarik
Oct 02 2014 20:45
The component doesn't need to know the exact url, but it needs to know what should the link point to, so you could create a function that returns the url for the given page, e.g. f('messages') would return "/org/abc/messages/". Is that what you want?