Comments (8)
aww he likes it!
from browser-request.
I would like that too, particulary since browser-request is missing tons of API stuff that request still does.
Off the top of my head, I see a few challenges
- mikeal/request (at least the README examples) focuses on streams. That is problematic with XHR. Best case, it would bloat the code
- There is no NPM for the browser. Maybe Ender but I've found it less satisfying than NPM. Do you really want to add a build step and some non-NPM release mechanism?
- browser-request uses a LGPL library (hence the otherwise unwelcome Git submodule)
from browser-request.
what submodule wants LGPL?
i'm confused as to why we need NPM or Ender? Why can't we just run it through a minifier and release it like everyone else releases their browser libraries?
the docs would change dramatically. we would start with some examples that work in both places, then talk about streams and note that it's node only. then we would list all the options, sectioning them out and noting which sections only pertain to node (you'll never be able to take options like cookiejar).
from browser-request.
browser-request builds directly from xhr. However it uses a very nice library called XMLHttpRequest.js (not the best name), like a CSS reset style, but for XHR; it removes all idiosyncrasies and bugs. See http://www.ilinsky.com/articles/XMLHttpRequest/ for a feature list. XMLHttpRequest.js is LGPL.
For that reason, I kept it arm's length via Git submodule.
Good point that we might merge the projects before solving the tedium of documentation and examples. So the following paragraph is not a dealbreaker.
We don't need NPM or Ender; but my point is, for my money, the best thing about Node is NPM. Everything is there. It's simple. Browser libraries OTOH are just total chaos. It's nonstop emails and semi-useful bug reports because people didn't install it right or whatever. Ender and RequireJS solve that; but unless you're Yahoo or Twitter, the medicine is worse than the disease.
So I was reminding you how awful it is to maintain browser libraries, asking if you're cool with that.
from browser-request.
+1
When comparing, say, reqwest or jQuery.ajax, to browser-request, I think the main expectation is that the API will ressemble mikeal/request's, but they don't have to be identical -- it would be fine to have in the documentation comments like "(Node.js only)".
FWIW ahr2 doesn't try to do streams; http-browserify "does".
from browser-request.
Just adding a +1 on idea of a possible combination with @mikeal's "upstream" request. Especially see the value of code-sharing and extension with new features.
from browser-request.
Two notes based on things I encountered recently:
- To address the qualms about NPM/Ender, the browser version could be delivered as a component (explicitly: make mikeal/request available as both an npm package and a component). The only existing HTTP request component, apily/request, uses a different (fluent) API.
- JetPack aka mozilla/addon-sdk is another target which could use a mikeal/request compliant API, with a different set of constraints (
cookiejar
would work, but I don't expect the native stream API to be compatible with Node.js'). The current HTTP request module, request, is based on XHR. The point being that if we're going to make mikeal/request more generic, it might be worth considering what it would take to make it available on that platform as well, so that it adapts to the different platform constraints (cookies/no-cookies, streams/no-streams,http.request
/XHR, ...).
from browser-request.
I got here because the request repo I can't use with browserify. This one worked. But now I am confused, You wanted to merge the two almost 3 years ago. That never happened I guess?
from browser-request.
Related Issues (20)
- Not support bearer authentication HOT 1
- Content-Type is application/json,application/json
- request module work in browser HOT 1
- Request works in Chrome, fails in Firefox with "CORS request rejected" error HOT 2
- default baseUrl is not working
- formData not supported HOT 4
- IE11 InvalidErrorStatus HOT 2
- Unexpected end of JSON input - Offline mode HOT 1
- Does your library support cookies?
- Refused to set unsafe header "User-Agent"
- Typescript support HOT 1
- Uncaught error, no options given
- Simple way to make a request sync? HOT 1
- window.request is undefined
- Support proxy option
- Is anyone still maintaining this library? HOT 4
- Sending an image file using the form? HOT 1
- Promise to obide by project guidelines
- ### Description of the bug:
- ### Description of the bug:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browser-request.