Coder Social home page Coder Social logo

Comments (8)

max-mapper avatar max-mapper commented on August 31, 2024

aww he likes it!

from browser-request.

jhs avatar jhs commented on August 31, 2024

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

  1. mikeal/request (at least the README examples) focuses on streams. That is problematic with XHR. Best case, it would bloat the code
  2. 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?
  3. browser-request uses a LGPL library (hence the otherwise unwelcome Git submodule)

from browser-request.

mikeal avatar mikeal commented on August 31, 2024

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.

jhs avatar jhs commented on August 31, 2024

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.

shimaore avatar shimaore commented on August 31, 2024

+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.

rufuspollock avatar rufuspollock commented on August 31, 2024

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.

shimaore avatar shimaore commented on August 31, 2024

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.

ashnur avatar ashnur commented on August 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.