6 ms·
This is great! This will make bootstrap more attractive and competitive as a framework. JQuery was one of the most important frameworks in Javascript history.
by entelechy 8y ago
This is great!
This will make bootstrap more attractive and competitive as a framework.
JQuery was one of the most important frameworks in Javascript history. It has enabled us to built real webapps.
However since then differences between browsers shrunk significantly and we learned how to build maintainable and scalable apps in a more declarative fashion (hello React, Angular and friends)
- tyingq 8y agoI am still more fond of jQuery's ajax functionality than anything that followed, including the fetch API.
- tcd 8y agoWhy? fetch returns a native promise, which are _much much much_ nicer to work with than XHR ever was or desired to be. Good riddance.
- arve0 8y agoMissing .abort() on safari is one reason. https://caniuse.com/#feat=abortcontroller https://caniuse.com/#feat=abortcontroller
- tracker1 8y agohttps://www.npmjs.com/package/ky https://www.npmjs.com/package/ky
- tyingq 8y agoStraightforward error handling both for actual http numbered errors, and for transport errors (site down/DNS/etc).
- aaaaaaaaaaab 8y agoFor one, fetch() doesn’t support progress reporting.
- voltagex_ 8y agoI'm not particularly familiar with fetch, but does this do what you want? https://github.com/SitePen/javascript-streams-blog-examples/blob/master/streaming-fetch/main.js https://github.com/SitePen/javascript-streams-blog-examples/...
- aaaaaaaaaaab 8y agoThis is a hack that works only for downloads via streams. It won’t work e.g. for file uploads (unless you read the file into memory first, which is highly undesirable).
- runarberg 8y agoIt does. The fetch response object exposes a `ReadableStream` through the `body` property, which you can loop through with a `for await ... of` loop. On each iteration, simply update your progress.
- tcd 8y agoSee [1] for a demo [1]:https://tejasq.github.io/basically-streams/examples/fetch/ https://tejasq.github.io/basically-streams/examples/fetch/
- aaaaaaaaaaab 8y agoYep, that’s a cute hack. Now what would be the equivalent of that for file upload? There’s no such API for fetch() because there’s no writeable body stream for requests. QED
- altmind 8y agojquery also returns a promise
- shados 8y agofetch is very bleh, so that's not a high bar. What I'd love to see is more Observable-based offerings in that space... RxJS has some rudimentary client, but seeing that pushed further would be great.
- deleted 8y ago[deleted]
- runarberg 8y agoYou should look at `for await ... of`[1]. You can get a streaming reader from a `fetch` response and loop if through an async iterator. If you prefer the functional syntax observables, I'm sure you can find a library that wraps async iterators as observables. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- benbristow 8y agoI've always liked to use axios which provides a jQuery-ish AJAX library. Works in the browser and server-side with NodeJS. https://github.com/axios/axios https://github.com/axios/axios Much nicer to use than fetch IMHO
- dstroot 8y agoThis.
- deleted 8y ago[deleted]
- ljm 8y agoI’d say that modern web patterns exist only because of jQuery. jQuery adapted the DOM and did for JS what LINQ did for C#. Replace datastore for DOM. JavaScript itself has subsumed most of jQuery and replacements like lodash would not have existed without it. Browsers will catch up badly.
- Theodores 8y agoWhoosh! Bootstrap is going the way of table layouts. Table layouts were great too but times change. Right now we have CSS Grid and it works in all browsers. I am sure they will bring this goodness to Bootstrap 5 but there is no need for the new layout engine that works great in all useful browsers to have a framework wrapper. Similarly with the jQuery, it was once useful in a table layout kind of way but nowadays you might as well just write ES6 javascript rather than learn how to do things the special jQuery way. Frameworks are dead in a similar way to how the internal combustion engine is. Using the intrinsic properties of the browser is where it is at in the same way that electric is where it is at in the automotive world. The fact that everyone is stuck with their excuses for frameworks (and ICE engines) does not change matters. Hence I read this news with all the enthusiasm of a Tesla owner reading about Peugeot developing a more efficient diesel engine.
- coldtea 8y ago>Bootstrap is going the way of table layouts. Table layouts were great too but times change. Right now we have CSS Grid and it works in all browsers. Which is irrelevant, as Bootstrap is much more than a grid system. Not to mention it's not meant for the types to mess with their own custom grid layout anyway.
- hugi 8y agoAs a web programmer, I tend to agree with this. While I'm at it, I'd also like to extend a polite "fuck you" to the web industry. It's a horrible place. I like bootstrap and I'm going to use it so fuck. you.
- Theodores 8y agoWell I just checked to see if I missed anything with it and I didn't. The utilities and components are the same as I remember them being. I was the biggest fan of Bootstrap ever about five or more years ago, a total evangelist. But it seems to be just another flavour of div soup really. I have moved on. Even things like cool scrollspy things aren't worth the bloat or the learning requirement. I also prefer to learn real things rather than fake framework things. Now the tools are needed in modern browsers you might as well do it properly and learn something useful rather than follow some convenient hacks. It is quicker.
- deleted 8y ago[deleted]