Skip to content

Conversation

@pedrobranco
Copy link

@pedrobranco pedrobranco commented Sep 23, 2016

Description

This PR has an intent of preventing changing the module request by reference, and to do it we create a wrapper around an instance of request to be able to define a debug function like we have already, but, instead of changing request prototype function init, we are listening to the events of request call.

This PR is a major refactor (breaking change) of request-debug, the requirements are changed:

  • node: from 0.8.x to 4.0.x

This PR has a new test suite with the scope of testing only the logic present in request-debug.

Issues

@pedrobranco pedrobranco force-pushed the enhancement/refactor-request-debug branch 2 times, most recently from d8456da to 2513965 Compare September 28, 2016 09:22
@pedrobranco
Copy link
Author

WDYT @nylen?

@ruimarinho
Copy link

@simov any chance of a quick +1/-1 on the concept?

package.json Outdated
"main": "index.js",
"dependencies": {
"clone": "^1.0.2",
"request": "^2.75.0"
Copy link
Member

@nylen nylen Sep 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library is probably due for a refactoring and update. Still, my concern with this approach is that you depend on a specific version of request, so you lose the ability to debug the version of request you're actually running in your application.

Copy link
Author

@pedrobranco pedrobranco Sep 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I will put the minimum as it was before (2.30.0).
About the concept do you agree?

Edit: actually, we can support 2.19.0+.

Copy link
Member

@nylen nylen Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't really solve the problem, because it is still a hard dependency through npm and you can no longer pass a specific version of request to request-debug. Also, for example, you may have customized some settings via request.defaults that affect the operation.

Copy link
Member

@nylen nylen Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to remove the npm dependency and allow the user to pass in a request instance. You should be able to do that and keep the same concept of wrapping rather than modifying request. I probably won't have time to do a detailed review but the new concept seems solid to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to remove the npm dependency and allow the user to pass in a request instance

Sure 👍

I probably won't have time to do a detailed review but the new concept seems solid to me.

Thank you for the concept ACK.

@pedrobranco pedrobranco force-pushed the enhancement/refactor-request-debug branch 2 times, most recently from 9c2bb88 to 6e1ea30 Compare September 29, 2016 16:57
- "iojs"
- "0.12"
- "0.10"
- "4.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 4/5/6?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@pedrobranco pedrobranco force-pushed the enhancement/refactor-request-debug branch 2 times, most recently from 6eef63e to ea96b3a Compare September 30, 2016 13:55
README.md Outdated
This will set up event handlers on every request performed with the `client`
variable from this point.

The constructor `RequestDebug` supports all options of `request` (see options [here](https://github.com/request/request#requestoptions-callback)):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after options.

README.md Outdated
baseUrl: 'http://www.google.com',
json: true
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?

.travis.yml Outdated
- "4"
- "5"
- "6"
- "6.6.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 will alias to the latest stable of 6.x.

@pedrobranco pedrobranco force-pushed the enhancement/refactor-request-debug branch from ea96b3a to 1467094 Compare October 3, 2016 13:40
@pedrobranco
Copy link
Author

All comments were addressed.

@pedrobranco
Copy link
Author

ping @nylen @simov

@fixe
Copy link

fixe commented Nov 3, 2016

@simov can you take a look at this one?

@pedrobranco
Copy link
Author

@simov @nylen Can you please give a look on this PR?

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.

Dependencies using request-debug in application

4 participants