
Sinatra 2.0 released - bdcravens
https://github.com/sinatra/sinatra/tree/v2.0.0
======
grandalf
The relevant timeline for Sinatra is as follows:

\- Rails 1.0 is released, popularizing Ruby

\- Rails 2.0 is released, deprecating patterns that were best practices in 1.0
and advocating REST patterns.

\- Sinatra is born, distilling the ideas behind REST into an extremely simple
and performant microframework.

\- Sinatra has been copied/emulated in nearly every programming language, and
its clones have also been widely successful.

\- Rails went on to release subsequent versions, each of which advocated doing
a near rewrite of working code and obsoleted/broke many of the libraries in
the ecosystem.

\- Meanwhile, Sinatra has remained very stable and its design has continued to
inspire new clones. See Floor, Scotty, Opium, Express, Flask, etc.

Bravo to the Sinatra team for building and maintaining a useful product.

~~~
matt4077
> \- Rails went on to release subsequent versions, each of which advocated
> doing a near rewrite of working code and obsoleted/broke many of the
> libraries in the ecosystem.

That's simply wrong. I've maintained a moderately-sized Rails app since 3.x,
and updating never took more than an hour or so, even for the major version
changes.

It's also deeply unfair to the Rails team. Your timeline should include, as
the first entry:

\- Rails 1.0 is released, showing the web development community how to
structure a project, delivering us from XML, and banishing
config.backup.inc.php3 from our nightmares.

Rails came about in a world of SQL embedded in html, or (almost worse) the
idiotic idea of "templating languages" that were poorly designed re-
implementations of php ("but this time it's just for templates!"). Testing
meant clicking through your application, and javascript was exclusively used
for replacing the deprecated <marquee>.

~~~
oomkiller
This is a great comment, but I feel like you might have missed out on all of
the fun of upgrading Rails 2 => 3, which was especially painful. Some large
applications are still stuck on 2.x and pay third parties for support because
the changes were so large. They were mostly for the better of course, but
there's a good chance the parent comment experienced this pain, and this is
what they're referencing.

~~~
patio11
Both of my Rails apps were on 2.3 for this reason for 5+ years, though the new
owners might have migrated. When I specced it out for one it would have been
2+ weeks of solid work.

------
cyberferret
When Ruby on Rails first hit the ground, I thought that I would try and learn
it and get to grips with it. But even with 20+ years of programming background
to my name at the time, I really couldn't feel comfortable using it, as much
as I wanted to learn Ruby and a corresponding framework.

Then I tried playing with Sinatra, and completely fell in love with it. Made
perfect sense to me, and seemed to fit my thinking and my concept of a web
project a lot better. Now I exclusively build my web apps using it. Well,
actually I use Pardrino [0], which is the framework built upon Sinatra. I
wonder how soon they will have the Sinatra 2.0 core working with Padrino?!?

[1] - [http://www.padrinorb.com](http://www.padrinorb.com)

~~~
da02
What public websites have you made with it? What other gems do you like? (eg
Sequel?)

~~~
cyberferret
A couple that are still going strong are LogbookHQ (www.logbookhq.com) and our
flagship product, HR Partner -
[http://www.hrpartner.io](http://www.hrpartner.io)

HR Partner is over 30,000 lines of Ruby/HAML code now, and nearing 100 tables.
All work to date has been carried out by a single programmer (myself).

We started out with Datamapper as our ORM, but since that is a dead project
now, we've transitioned all our new projects to Sequel, which once again, I
found far more intuitive and approachable than ActiveRecord.

We use a stack of existing gems, even rails specific one, however there are
quite a few that are now framework agnostic, or designed specifically for
Sinatra. For example, we use padrino-warden (a Warden gem tailored for
padrino) for all user authentication etc.

------
lacampbell
Sinatra is what finally made me "get" web applications. A few years back I
considered web programming a confusing, scary place, but figured it was my
future. I had tried out rails but I was overwhelmed with it all. I had done
PHP at university and sort of understood it, but didn't like it. But Sinatra
was such a nice abstraction over HTTP, and it came naturally to me.

We need more libraries like this. Straightforward, to the point, based around
an effective abstraction. It lets you implement the other bells and whistles
how you want - or lets you not implement them at all.

Really can't say enough good things about this library, but it's numerous
clones probably speak for themselves.

~~~
frou_dh
Writing a handful of #! scripts and serving them out of a CGI directory is
another good way to "get" what a dynamic webapp and HTTP are about.

~~~
lacampbell
By the time webdev was even on my radar, the only things I "knew" about CGI
was that it was old and bad. Or something.

~~~
frou_dh
It strikes me as Unix scripting writ large.

* Each page of your site could be a script written in a different language if you wanted.

* Environment variables (and optionally stdin) arrive to your script representing the request.

* Your script writes the response (HTTP headers and page content) to stdout then exits.

Security/perf pitfalls aside, I still think it's a nice model. It really
emphasises the statelessness of HTTP since a pristine new process is booted up
to handle each request.

~~~
mperham
My business is built on CGI scripts for processing automated webhooks. There's
several non-trivial benefits:

    
    
      1. Nothing running 24/7.  No services to monitor, very light on memory.
      2. Immune to memory leaks and bloat.  Guaranteed fresh state on every request.
    

It's not ideal for user-facing functionality but has proven extremely reliable
and maint-free. My goal was to use something that would require no recurring
maintenance, unlike all modern web tech. All that is running 24/7 is Apache.

~~~
lacampbell
That's pretty cool to hear actually. CGI or FastCGI?

------
eropple
Changelog (because I had to go digging for myself):

[https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md#...](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md#200
--2017-04-10)

------
giancarlostoro
I never got much into Ruby but everytime I played with it Sinatra is my
absolute favorite gem. Although now that I do Python I use CherryPy a lot,
which is somewhat similar (though others would pick Flask as a similar
framework for Python) glad to see it's still around. Of course this was also
the inspiration for NancyFX for .NET which is another one for C# that tries to
be similar as well. I'll always enjoy Sinatra as one of the few Ruby projects
I've ever played with.

------
dejv
Sinatra is awesome, but it has some limits. I've written
[http://notationtraining.com](http://notationtraining.com) using it and been
running this application for 7 or so years.

It was great when it was just two screens with a few lines of javascript, but
when you keep adding functionality the code gets messy very quickly and you
basically start to build some kind of meta framework on top of that DSL.

7 years in development and about million uniq users later I still like it. It
just do the job, there is very few things that could go wrong and it is fast.

~~~
pmontra
> you basically start to build some kind of meta framework on top of that DSL.

Exactly. That's why I almost always start with Rails. There are very little
projects with a tiny numer of urls. Furthermore I get some scaffolded code for
free and the integration with an ORM, a test framework, templating, db
migrations.

I started with Sinatra sometimes and switched to Rails after I realized that I
was adding most of the components and structures of a Rails application. It
was not worth doing it by hand instead of using a proven tool.

------
dmerrick
Grats to the Sinatra team!

Sinatra is one of my all-time favorite libraries. To me, it is the ideal
microframework for rapidly prototyping websites and APIs

~~~
pampa
After using Sinatra for many years, i switched to Roda
[http://roda.jeremyevans.net/](http://roda.jeremyevans.net/) as my goto web
framework. Hello world in Roda doesn't look as neat as in Sinatra, but bigger
apps come out cleaner and better structured with it.

------
slackoverflower
Anywhere to find the major changes for 2.0?

~~~
sb8244
There is a changelog at
[https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
but I don't see any obvious breaking changes?

Edit: some of the security based refactoring and ENV settings might be
breaking?

~~~
damagednoob
I think it's the deprecating of Ruby versions that is breaking:
[https://github.com/sinatra/sinatra/commit/af18cf588a2fed68ed...](https://github.com/sinatra/sinatra/commit/af18cf588a2fed68edd17e00e30169b4aa5a056c#diff-354f30a63fb0907d4ad57269548329e3)

------
stanislavb
Note: it's been almost a month since v2 has been released

~~~
bdcravens
You're think of the first RC; final 2.0 was released yesterday

[https://github.com/sinatra/sinatra/commits/master/lib/sinatr...](https://github.com/sinatra/sinatra/commits/master/lib/sinatra/version.rb)

------
bsharitt
I've always liked Sinatra(though I mostly use its Python equivalent, Flask,
these days). It's so simple and straight to the point.

------
xs
Does Jekyll still use Sinatra? If so, does this mean anything cool for Jekyll?

~~~
dermybaby
Looks like its just plain Ruby -->
[https://jekyllrb.com/docs/home/](https://jekyllrb.com/docs/home/)

"Jekyll is a simple, blog-aware, static site generator. It takes a template
directory containing raw text files in various formats, runs it through a
converter (like Markdown) and our Liquid renderer, and spits out a complete,
ready-to-publish static website suitable for serving with your favorite web
server."

~~~
kgilpin
That's true but in development mode the site is served dynamically.

That said, it doesn't use Sinatra there either. It uses WEBrick which is in
the Ruby standard library.

[https://github.com/jekyll/jekyll/blob/master/Gemfile](https://github.com/jekyll/jekyll/blob/master/Gemfile)

[https://github.com/jekyll/jekyll/blob/master/lib/jekyll/comm...](https://github.com/jekyll/jekyll/blob/master/lib/jekyll/commands/serve.rb)

