Danger JavaScript, Ruby and Swift

Tale of Many Dangers

Danger has been in the works since 2015, in that time there’s been two complete implementations of the idea. Why two? Well, that’s a question answered in the blog post on the Artsy blog here.

It’s understandable if you are not in a Ruby or JavaScript context it can be a bit hard to decide which version of Danger you should use. Therefore this document is a high-level overview of the differences between them.

Danger on Ruby is more mature, has a solid plugin eco-system and is very stable. It supports Ruby 2.0 and above, and will likely work on any CI setup without additional work.

The project is on version 5.x with about a hundred releases, that’s a lot of battle testing. I consider it in a great place and is unlikely to have breaking changes from this point onwards. The GitHub issues to number of downloads is really healthy too. Almost 10 million downloads now and a new issue maybe once a week.

I have no intention of ever deprecating Danger Ruby. If you’re using it today, you’re fine to stay that way.

Get started with Danger on Ruby.

In re-creating Danger in JavaScript, I built it with a larger scale in mind.

Danger JS has its own plugin eco-system and is doing a bunch of things the Ruby version cannot (like Peril and separate language implementations). Danger JavaScript probably has everything you need.

If you’re working in a Node environment this is definitely the right choice.

FWIW, I find it easier to work with JavaScript Dangerfiles because they have TypeScript annotations.

Get started with Danger on JavaScript.

You may notice that there are now a suite of other language implementations on the homepage. The JavaScript implementation of Danger supports a hand-off system which allows other language ecosystems to flourish by having their own rules in their own languages. Currently Swift is very production-worthy, and Kotlin and Python are getting real close.