-
Notifications
You must be signed in to change notification settings - Fork 219
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
Router agnostification - POC #253
base: master
Are you sure you want to change the base?
Conversation
@nickw, let me know what you think of this idea and whether I should keep going at it when you have the time 😄 |
Thanks for the feedback guys. |
|
||
api.use(["templating", "underscore", "fastclick", "tracker", "session"], "client"); | ||
api.use('iron:[email protected]', 'client', { weak: true }); | ||
api.use('meteorhacks:[email protected] || 2.0.0', 'client', { weak: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no meteorhacks:[email protected]
.
It should be kadira:[email protected]
.
I think we can drop meteorhacks:flow-router
at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is going to change, thanks.
How about moving all router specific logic into a separate file. Then if we need to work on a new router, then it's just changing that file. |
@arunoda, that sounds like a great idea, but I can't envision how to do that since there is router logic in different components. Can you show me a small example? |
I mean we can create a set of methods like |
Ah okay, sounds good. I'll give that a try. |
We'd also need to figure out how to handle rendering into regions: https://github.com/meteoric/meteor-ionic/blob/master/components/ionNavBar/ionNavBar.html#L3-L5 |
Apologies if this is not the proper place to mention, but... |
@nickw for that we can simply use Meteor's dynamic templates. I think that works for both routers. Otherwise we can simply use BlazeLayout in both flow and IR. |
I started a router-layer project |
Oh wow, router-layer might just be the answer. I'll check it out later. |
@nicolaslopezj, are we able to use the Layout template to render things into regions to tackle the issue that @nickw mentioned for this? Given that it is |
|
This is an untested effort (should still work with Iron Router though) to make this package router agnostic by first making the router dependencies weak, then creating an API
Platform.withRouter()
that lets you handle router-dependent logic in the components.I haven't quite parsed the data context to allow for dev-friendly data-context-passing into
FlowRouter.path()
when creating URLs in certain components but will do this later so that it's easier.Let me know if anyone actually likes this before I start testing that it works on Flow Router and doing more stuff to it.
Or if anyone wants to try it out, you can always clone the fork branch.