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

v2 #169

Closed
ndelvalle opened this issue Oct 21, 2018 · 3 comments
Closed

v2 #169

ndelvalle opened this issue Oct 21, 2018 · 3 comments
Assignees
Milestone

Comments

@ndelvalle
Copy link
Member

ndelvalle commented Oct 21, 2018

Required changes to V2:

Personal proposals:

  • Remove trae.defaults() method (Not passing any arguments), In my opinion, this is kind of confusing. We can create something like getConfig, or maybe expose a config attribute.
  • Remove trae.baseUrl([url]) method. We can achieve the same functionality using defaults or defining it when we create a new instance.
  • Make trae.finally([middleware]) async. After all promises finally are async.
  • Use statusCode instead of status on response objects
  • Remove all-contributors implementation. We don't have time to update this and contributors are already shown by github
  • Remove the request method. I'm not entarely convinced yet, but I don't like it much
  • Add a timeout functionality

Branch: v2

@gillchristian
Copy link
Member

For "Enhance implementation and API" I suggests:

  • Make methods static instead of creating them as class properties.
  • Only keep public methods as part of the Trae class. Internal methods could be functions instead.

Agree with most of the "Personal proposals". Only question about two items:

  • Make trae.finally([middleware]) async: I wonder how much finally is used. Instead of making it async I would make it so accepts one function and that's the only thing it runs. If then someone wants to add multiple functions to it they can compose or composeP those functions. And now that I mention this maybe it also makes sense for the other middleware. Wdyt?
  • Add a timeout functionality: what do you propose? I wouldn't delay v2 for this one. Would rather have it as v2.x. I also wanted to add TypeScript support but better leave it for v2.x.

@gillchristian gillchristian reopened this Oct 22, 2018
@ndelvalle
Copy link
Member Author

@gillchristian
I agree with your Enhance suggestions. About your questions:

  • I think it makes sense to have just one finally, otherwise it can be a bit confusing. I'd like to kind of replicate promises approach
  • Definitely, I agree with you here.

👍

@gillchristian
Copy link
Member

I'll close this and create a new one

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

No branches or pull requests

2 participants