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

Update to work with latest request under node #16

Merged
merged 2 commits into from
Jan 26, 2015
Merged

Update to work with latest request under node #16

merged 2 commits into from
Jan 26, 2015

Conversation

KrzysztofMadejski
Copy link
Contributor

Commenting on:
// we could just call request but that's a PITA to mock plus request.get = request (if you look at the source code)

This is not anymore true, method=GET is forced when using get(): https://github.com/request/request/blob/master/index.js#L60

Commenting on:
// we could just call request but that's a PITA to mock plus request.get = request (if you look at the source code)

This is not anymore true, method=GET is forced when using get(): https://github.com/request/request/blob/master/index.js#L60
@rufuspollock
Copy link
Contributor

Thanks for the patch. One quick question: do we need to now set an explicit >= version for request in package.json dependencies?

@KrzysztofMadejski
Copy link
Contributor Author

Browsing history it was changed in commit request/request@39396b0#diff-168726dbe96b3ce427e7fedce31bb0bc

Which is v2.35.0, but the code I posted should work with previous versions as well, because request == request.get in old versions.

Coming back to your question: In fact you should set explicitly version in package.json, so the request will not be bumped to v3 (backwards-incompatible probably) in future (see: http://blog.nodejitsu.com/package-dependencies-done-right/)

So: "request": "2.x" or "request": "2.x.x" (not sure which one works and how request is handling backwards compatibility) would be probably the best. If you want to be super safe test it on latest and put 2.51.x as patches are expected not to break functionality.

P.S. Underscore dependency should be treated the same way.

@rufuspollock
Copy link
Contributor

@KrzysztofMadejski I'd welcome you making those suggested changes re explicit dependencies. Then we can merge the patch :-)

@KrzysztofMadejski
Copy link
Contributor Author

Sure, I wanted though to run tests beforehands and I'm not sure how to do it. There's no documention on it.

Opening test/index.html throws a lot of 404 errors ie. http://localhost/src/recline/test/qunit/qunit.css Failed to load resource: the server responded with a status of 404 (Not Found).

@rufuspollock
Copy link
Contributor

Hmmm, good point. I realize now we haven't actually done the port of tests to mocha or similar to allow nodejs tests - see #17

Given straightforward nature of this change we can merge the package.json changes I think - though if you wanted to have a go at #17 that would be amazing!

@KrzysztofMadejski
Copy link
Contributor Author

I'll think about #17 :)

Meanwhile I've set dependencies, "tested" it in my own scenario (updating CKAN via Action API v3) and bumped patch version. It's ready to merge!

rufuspollock added a commit that referenced this pull request Jan 26, 2015
Update to work with latest request under node
@rufuspollock rufuspollock merged commit baab1ac into rufuspollock-okfn:master Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants