Conversation
"handlebars" : "1.x" | ||
"handlebars" : "1.x", | ||
"async" : "0.2.x", | ||
"request" : "2.x" |
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.
Do you need me to do a npm shrinkwrap
?
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.
So this looks good! I would recommend removing "Api" from the github module and file names. I would also only export the two functions. You can creating them as named functions, and hang them off the I also think the pending request stuff should be handled in the github module, this alleviates the extras route handler from caring. |
Thanks for the feedback! What's wrong with using |
These utility methods will be called with function invocation, and are likely to have a context Here's an example of how someone might want to use this GitHub service: var getRepos = require('../github').getRepos;
module.exports = function (req, res) {
// Calling `getRepos()` like this will mean it's invoked
// within the global context.
getRepos({
username: 'ericf',
reponame: 'yui3'
}, function (err, repos) {
res.render('view', {repos: repos});
});
}; The above is actually what I think we'll end up ( |
My only concern with this is that it feels a little "over engineered" by making the web page query the Github api for a repo list. Couldn't this just be a startup task? When the process is started, fetch the repo info and write it to the config (if it hadn't changed, could also Seems like it would be more stable to only do that on process start than to keep a long lived timeout that has a potential for throwing (if data is bad, etc). |
Before we decide whether we're going to switch implementation approaches (periodic and cached, or on startup), is this feature still applicable? |
Yeah, it is. It's just lower priority than the rest of the stuff, but still applicable. |
I don't want to see it launched with this extra overhead in the processes on my server. A long lived timeout is not a good thing. |
Ok, I'll re-implement it. No problemo. |
@davglass this would be making something on the order of 10 APIs calls per hour, and act like a cron job. |
But why? It's just pulling new menu items. Technically, if we launch a new Dav Glass
On Thu, Mar 14, 2013 at 3:08 PM, Eric Ferraiuolo
|
We probably won't use this anymore. We'll probably go with Bower instead. |
+1 |
Minor copy edits to new Grids docs
This pull request adds the necessary backend infrastructure for the Extras view. Notably it adds:
githubApi
module responsible for querying with Github. The module only queries for new repos if a certain time threshold has been crossed. It stores the results in memory.extras
route handler that has aninProgress
flag which checks to see if an API call is in progress, and serves the older out-of-date result set while the new set completes.extras.handlebars
view that loops through the returned Github repo information and creates the necessary DOM.