4 ms·
> Rails should be baking in support for creating API only apps, make it easy to shed template-driven code and write UX-agnostic backends. Mobile is driving a ne
by technoweenie 14y ago
> Rails should be baking in support for creating API only apps, make it easy to shed template-driven code and write UX-agnostic backends. Mobile is driving a need for creating API-only apps, and something like Asset Pipeline is an evolutionary dead-end.
This has never been Rails' focus. Let Rails keep doing what it kicks ass at. Sinatra works great for API endpoints. There's probably an opportunity for an API-focused extension to Sinatra. Of course, Grape works too (https://github.com/intridea/grape https://github.com/intridea/grape).
The nice thing is that all of these are built on Rack now. GitHub.com runs as a Unicorn rack app that mounts over 30 Sinatra apps and a massive Rails app together. I'm not saying this is an optimal solution, it's just where the app is at in its current evolution. But it is very possible :)
- VeejayRampay 14y agoFor things like APIs, Rails has https://github.com/rails-api/rails-api https://github.com/rails-api/rails-api, an excellent project.
- hosh 14y agoI've taken a look at it. It does not really use the Rails 3 architecture (Russian Doll Pattern) to its fullest potential. I have written https://github.com/intermodal/intermodal https://github.com/intermodal/intermodal back in 2010 to demonstrate it, and have put that code into production. There are some people trying to revive Rails-API. I have already sent them an email begging them to steal ideas from Intermodal. https://groups.google.com/forum/#!topic/rails-api-core/LoJap3IzOig https://groups.google.com/forum/#!topic/rails-api-core/LoJap... Maybe they will, maybe they won't. I got a polite brush-off so I doubt they really looked at it, but since I am exiting, whatever. In writing Intermodal, I've had to muck around with some of the guts of Rails. I've found that Rails 3.0 very much follows the principle of Russian Doll Pattern, but Rails 3.1 onwards started moving away from it. There are baked-in assumptions in the code for a template-driven app. This is where the Rails leadership is focused on.
- hosh 14y agoSinatra is not actually all that good for writing API endpoints. The Rails 3 architecture is very modular. It was designed as framework to write frameworks, of which a template-driven app is one such framework. I have written a different framework specifically for just an app focused on SASS that has an abundance of CRUD operations. However, when Rails 3.1 started transitioning into Rails 3.2, the assumption that Rails is specific for a template-driven app started being baked deeper into it. It was moving away from the "Russian Doll Pattern" that was so useful for me.