question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.0 Proposal - Please read & comment!

See original GitHub issue

1.0 Proposal

Twitter Lite is gaining traction and after learning how folks have been using it, here are changes I would make:

Breaking Changes

Turn all request arguments into keyword arguments:

before: async get (resource, parameters) async post (resource, body, parameters)

after: async get({ resource, params }) async post({ resource, body, params })

There won’t be any confusion in argument ordering.

Return results, response, error from requests

Currently we return just the results but there are rate limiting errors that are 200-level and don’t crash.

New API would look similar to:

return {
  results, // tweets, etc.
  response, // raw response object. You'd have to do your own `response.json()` here
  error // error object (if any)
}

Error handling

Right now twitter-lite forces the consumer to handle errors. We can take care of the errors ourselves. ** Would love to hear what folks think of this one **

Enhancements

Create makeRequest function that handles all requests under the hood. This will reduce code size.

  • create a makeRequest function that handles:
    • get
    • post
    • stream

This will reduce bundle size and make handling errors / responses easier.

  • add flowtype support Easier to debug errors

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:24 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
peterpmecommented, Mar 19, 2018

How do ya’ll feel about making this a server-side only module for the time being? After reading a bunch about this, it seems like its a safer alternative than allowing requests to take place on the client

2reactions
tylerbucheacommented, Mar 15, 2018

Although it will create an extra hurdle for contributors, having Typescript and Flow support will greatly increase the attraction from consumers of this library who use those technologies and it will have no negative effect for those who do not.

Since we are developing a library here I think valuing the consumers above the contributors (within reason) is always a smart move.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Employee or Independent Contractor Classification under the ...
The Department believes that this proposal, if finalized, will provide more consistent guidance to employers as they determine whether workers ...
Read more >
A Proposal to Fill the Gap Between Regulation and ... - SEC.gov
Running on Empty: A Proposal to Fill the Gap Between Regulation and Decentralization Remarks at Blockress Commissioner Hester M. Peirce ...
Read more >
REQUEST FOR PUBLIC COMMENT: NEW CASELOAD ...
NEW CASELOAD STANDARDS & COMPENSATION PROPOSALS ... below do not account for any compensation changes and only refer to the impact the.
Read more >
Details re: Our 8/26 Economic Proposal - AFSCME Local 328
Please read our commenting guidelines (linked at the bottom of this post) ... If we settle by 9/5/22: $1,000 for employees at 0.5...
Read more >
Verifiable Credentials Data Model v1.1 - W3C
Comments regarding this specification are welcome at any time, ... For details, see the test suite and implementation report.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found