Upgrade to Pro — share decks privately, control downloads, hide ads and more …

We fail to follow SemVer – and why it needn’t matter

We fail to follow SemVer – and why it needn’t matter

If extensive libraries and even the tiniest module followed SemVer strictly, dependency hell would be a thing of the past … but humans weren’t made to follow rules.

There are over 125.000 packages on npm today. By the time of this unconference, at least another 5.000 will have been added. Using the right packages in your own modules and applications makes JavaScript the joy to develop it is today. But if even immensely popular libraries fail to properly declare breaking changes, how can we trust the over 50.000 strangers who developed all these modules? Currently we can’t. Let me show you how to write confidence-inspiring modules by leaving package publishing up to the machines – instead of buggy humans.

Stephan Bönnemann

April 26, 2015
Tweet

More Decks by Stephan Bönnemann

Other Decks in Programming

Transcript

  1. We fail to follow SemVer
    JS Unconf 2015 – @boennemann

    View full-size slide

  2. and why it needn't matter
    JS Unconf 2015 – @boennemann

    View full-size slide

  3. !"
    I'm Stephan
    @boennemann
    JS Unconf 2015 – @boennemann

    View full-size slide

  4. 143,238
    packages on npm
    JS Unconf 2015 – @boennemann

    View full-size slide

  5. 1. npmsearch.com
    2. npm install
    3. ?
    4. profit
    JS Unconf 2015 – @boennemann

    View full-size slide

  6. X.Y.Z
    JS Unconf 2015 – @boennemann

    View full-size slide

  7. Semantic Versioning
    JS Unconf 2015 – @boennemann

    View full-size slide

  8. MAJOR.MINOR.PATCH
    JS Unconf 2015 – @boennemann

    View full-size slide

  9. 1.0.0
    JS Unconf 2015 – @boennemann

    View full-size slide

  10. 1.0.1
    JS Unconf 2015 – @boennemann

    View full-size slide

  11. ~1.0.1
    JS Unconf 2015 – @boennemann

    View full-size slide

  12. 1.1.0
    JS Unconf 2015 – @boennemann

    View full-size slide

  13. ^1.1.0
    JS Unconf 2015 – @boennemann

    View full-size slide

  14. 2.0.0
    JS Unconf 2015 – @boennemann

    View full-size slide

  15. Hauptversionsnummern-
    erhöhungsangst1
    1 Fear of increasing the major version
    JS Unconf 2015 – @boennemann

    View full-size slide

  16. You may just improvise new
    numbers from your mood on that
    day. The only important thing, is
    that the version number must be
    meaningful to you, the author.
    — Dominic Tarr, sentimentalversioning.org
    JS Unconf 2015 – @boennemann

    View full-size slide

  17. dependency hell
    JS Unconf 2015 – @boennemann

    View full-size slide

  18. Let's write a tiny module
    JS Unconf 2015 – @boennemann

    View full-size slide

  19. In the beginning was code
    JS Unconf 2015 – @boennemann

    View full-size slide

  20. the code was npm published
    JS Unconf 2015 – @boennemann

    View full-size slide

  21. versions are for computers
    names are for humans
    JS Unconf 2015 – @boennemann

    View full-size slide

  22. Conventions
    JS Unconf 2015 – @boennemann

    View full-size slide

  23. breaking change detection
    JS Unconf 2015 – @boennemann

    View full-size slide

  24. ⭐ git.io/semantic-release ⭐
    JS Unconf 2015 – @boennemann

    View full-size slide

  25. questions
    and hopefully answers
    JS Unconf 2015 – @boennemann

    View full-size slide

  26. ✨ Thank you ✨
    JS Unconf 2015 – @boennemann

    View full-size slide