Earlier quoted context omitted.
Fetch support is awful. Rachel McAdams knew the future.
Plenty of polyfills out there. I mentioned it because it's a lot lighter than superagent or worse, request.
jQuery 3.0 Release Candidate
51–60 of 71 posts
Re: jQuery 3.0 Release Candidate
#52Since I used d3.js for one project a few years ago, I have not touched jQuery ever since. d3 offers key jQuery features, but goes much more beyond that.
Re: jQuery 3.0 Release Candidate
#53Exciting news for jQuery. Last night, I was working on a side project. For the front-end, I'm using React, React-Route, and I'm working on figuring out Fluxible. superagent to wrap XmlHttpRequest. browserify to compile what I serve to the front-end. I don't run a reverse-proxy with a node backend since the API is in PHP, I just served the minified JS files. Honestly, it's a huge pain. And every module I toss in there…
Re: jQuery 3.0 Release Candidate
#54Earlier quoted context omitted.
Plenty of polyfills out there. I mentioned it because it's a lot lighter than superagent or worse, request.
Honest question, what is wrong with request (and superagent)? Is it just size or something more? I am only asking because yesterday I was looking for a promise supported library and I was comparing superagent (with its promise wrapper), request-promise, axios and node-fetch. I have narrowed it down to axios and fetch but I would like to hear your opinion on the matter.
Never used axios but I've heard good things about it and its creator is awesome. I just use fetch because it does what I want.
Re: jQuery 3.0 Release Candidate
#55Earlier quoted context omitted.
Fetch support is awful. Rachel McAdams knew the future.
+1 for fetch. Use the good github fetch polyfill for old browsers https://github.com/github/fetch
Also sinon.js couldn't mock it, and dealing with error cases is inelegant (it doesn't look like much extra code, but is hard to justify if you're just writing a small component that hits one endpoint, in terms of weird new code to explain to your teammates that is).
I have gone back to $.ajax for now, though I do mean to try out qwest [1] when I get the chance. Seems to be both tiny and also have a sane promise-y API.
Re: jQuery 3.0 Release Candidate
#56Earlier quoted context omitted.
Honest question, what is wrong with request (and superagent)? Is it just size or something more? I am only asking because yesterday I was looking for a promise supported library and I was comparing superagent (with its promise wrapper), request-promise, axios and node-fetch. I have narrowed it down to axios and fetch but I would like to hear your opinion on the matter.
The size. For a Node app, maybe not so bad (though I'd use node-fetch or got[1] which are smaller). For a browser app, loading all of superagent (which is almost 2 megabytes) just to make a few GET and POST calls is silly. Never used axios but I've heard good things about it and its creator is awesome. I just use fetch because it does what I want. [1] https://github.com/sindresorhus/got
Re: jQuery 3.0 Release Candidate
#57Exciting news for jQuery. Last night, I was working on a side project. For the front-end, I'm using React, React-Route, and I'm working on figuring out Fluxible. superagent to wrap XmlHttpRequest. browserify to compile what I serve to the front-end. I don't run a reverse-proxy with a node backend since the API is in PHP, I just served the minified JS files. Honestly, it's a huge pain. And every module I toss in there…
Curious - why are you using React and all of that for a simple 2 page project? Is it for the learning experience? Seems like way overkill unless its for the learning experience.
he needs most of the libraries only on two pages: login and register. i sincerely doubt his site only has these two.
Re: jQuery 3.0 Release Candidate
#58Re: jQuery 3.0 Release Candidate
#59Since I used d3.js for one project a few years ago, I have not touched jQuery ever since. d3 offers key jQuery features, but goes much more beyond that.
It lacks a ton of key features. No eq(), toggleClass(), show(), length, etc. Sure you can rewrite them in D3 but why bother?
In D3 you can do selection.classed('active', false). This is equivalent to toggleClass().
According to jQuery's API, show() "... is roughly equivalent to calling .css( "display", "block"), except that the display property is restored to whatever it was initially." Instead of show, you can just do selection.transition().duration(300).style(display, 'block').
The length method? You can just use JavaScript's native .length.
Re: jQuery 3.0 Release Candidate
#60Major Changes: .load, .unload, and .error, deprecated since jQuery 1.8, are no more. Use .on() to register listeners. jQuery.Deferred is now Promises/A+ compatible Error cases don’t silently fail Animations now use requestAnimationFrame Massive speedups for some jQuery custom selectors
> jQuery.Deferred is now Promises/A+ compatible Finally. Our old codebase is using quite a lot of jQuery deferreds and, well, Promises/A+ clearly improved a lot of things API-wise.