What's new in Sinatra 1.4?
rkh.im
rkh.im
I don't blame the authors for discontinuing old branches (1.2.x), but it makes me hesitant using Sinatra for a production website that's meant to be there for >= 2 years (though is an eon in IT).
Also, the Sinatra code base is pretty small, so just because it's no longer officially maintained doesn't mean you can't run Sinatra 1.2.0. All security issues we have seen so far have all been in Sinatra dependencies (namely Rack) and never in Sinatra itself.
If you are stuck on an unmaintained Ruby version that's a way bigger issue than being stuck on an unmaintained Sinatra version. You should not run Ruby 1.8.6 in production for security reasons.
Many projects out there follow the two maintained feature versions approach, like Rails. How many versions of Sinatra should see regular releases? What about 1.1.x? Or 0.9.x?
It has also been announced with the 1.3.0 release that 1.2.x will be continued until the 1.4.0 release.
Being stuck on 1.2.x is pretty bad, as it still ships without rack-protection.
It's just the logical step to get rid of old deprecated stuff.
I haven't checked, but for starters you possibly could look at the download size.
This "opinionated default" makes it very hard to test when you're running your development environment from a virtual machine, like Vagrant.
More and more people are doing this (gotta use those extra cores + memory for something, right?), so please consider us before adding a "listen 127.0.0.1". :)
When do I use Sinatra?
It takes care of a lot of unknowns for a lot of people. For instance, it makes sure you do proper redirects. Did you know that IE9 implements 302 like 307 but only for redirects from Ajax? But you can't simply use 303 as some HTTP clients don't properly implement it? Rack does not care about such things.
It also comes with built-in security, which Rack does not.
If you are comfortable with Rails and it suits your needs (that is, a monolithic model driven application), stick with it, there is nothing wrong with Rails.
Sinatra is good for APIs but it's easy to find yourself reinventing Rails/Padrino when you have a view layer.
You can use Sinatra for the same things that you use Rails for, but typical use cases are API's, since there's a lot of stuff in Rails that you don't want to use if your main output isn't html.
And for REST endpoints.
The light part means: it doesn't drag a huge framework and code and complexity you don't need with it. It uses less resources than it would if it was doing that.
Our API app used to be a Rails application, but we ended up writing our own object serializers etc, so that the controllers were actually more or less just calling out to one method.
When we reworked our API, authentication, etc, we switched over to Sinatra.