jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.39k forks source link

Suggestion: Kill some modules and leverage fetch #4207

Closed jfbrennan closed 5 years ago

jfbrennan commented 5 years ago

I'd love to see a version of Backbone that has Model and Collection only and uses fetch instead of depending on $.ajax under the hood. And a CDN build with Underscore included to top it off.

The web community needs it. They're doing some pretty gross stuff where as the Backbone APIs are so good for Model, Collection, and talking to RESTful services.

jashkenas commented 5 years ago

Go for it. It's open source!

jfbrennan commented 5 years ago

@jashkenas Curious to know if something similar has been or is currently being discussed/attempted. If there's enthusiasm, would you support an official release?

jashkenas commented 5 years ago

I'm not aware of something along those lines — although it's certainly easy enough to just use Model and Collection, if that's all you need.

As for switching to fetch, that would be a lovely upgrade, and any PR that implemented it would probably be taken.

jashkenas commented 5 years ago

Oh, and as to supporting an "official" release that removes the View and Router — I don't think so. Backbone at this point has been stable for a long time. We're not going to remove major APIs.

jfbrennan commented 5 years ago

@akre54 you wrote backbone.fetch, does "any PR that implemented [fetch] would probably be taken" interest you? Happy to help

blikblum commented 5 years ago

I'd love to see a version of Backbone that has Model and Collection only and uses fetch instead of depending on $.ajax under the hood.

I did that, plus implemented as ES6 classes: https://github.com/blikblum/backbone/tree/nextbone

akre54 commented 5 years ago

@jfbrennan I'd imagine any pull request for this would look a lot like my plugin, so feel free to grab my code if that helps as a starting point.

...though to be honest I'm not sure what benefits this would have over just using the plugin as-is.