After looking at a number of JavaScript libraries we have implemented, I found most of them either severely lacking or bloated. I would like to gather the requirements here for something that will be useful to all the new services on backend as well as frontend. Even though this code will benefit client-side developers, the library's focus is to make the server side more robust and stable by encouraging more efficient API usage. See also API gold standard.
General
- Support browsers and node.js
- User agent identification (policy, etiquette)
- Handle errors
- Report warnings
- Support error and warning message localization (once implemented)
- Support continuations
- Support response merging (batchcomplete)
- Use compression
Bots / backend scripts
- Support QoS - maxlag, throttling
- Handle login / session management
Performance
- Support multiple simultaneous requests over the same connection
Will NOT support
- specific actions / query commands should not be supported - the API should not wrap each of the hundreds of actions, query lists, props, etc Users should consult API manual directly, with this library providing only the most minimal but mandatory functionality