Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 6008

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 27, 20242024-11-27T02:34:07+00:00 2024-11-27T02:34:07+00:00

4 Important Rules of Semantic Versioning

  • 60k

There are many things which a wise developer takes cares of. One of them is Semantic Versioning.

Before jumping onto Semantic versioning, let's consider one example:

Suppose you are developing an app named Building 🏒. While building this app, you need to integrate a third-party package called Crane πŸ—οΈ. When you installed Crane in your Building app, its version was 2.1.0. After some time you need one more package named Truck 🚚, which was having 1.1.4 version. Among these 2 packages; Crane was not following the standards of Semantic Versioning. And package Truck was appropriately following the rules of semantic versioning.

Let's pause this example here for a while and understand what is semantic versioning. At the end of article, we'll continue this example and see how Crane and Truck's releases will affect your Building app.


WHAT? βš™οΈ

Semantic Versioning is also called as SemVer for short notation. It is a standardized pattern to mark versions of any app, package, library, API, or any other product wherever it is applicable. (In the further article SemVer stands for Semantic Versioning)

MAJOR.MINOR.PATCH 
Enter fullscreen mode Exit fullscreen mode

Sample SemVer(s)

- 2.4.0 (Major: 2, Minor: 4, Patch: 0) - 4.6.2 (Major: 4, Minor: 6, Patch: 2) 
Enter fullscreen mode Exit fullscreen mode

Semantic Version consists of mainly 3 parts (it may be more depending on how many levels deep you want to take it)

MAJOR: It represents the major version of the app. Any incompatible change, API modification, or such changes are handled under this number.

MINOR: When you add new functionality in a backward compatible manner is introduced in the product. Any improvement (like performance, optimization, etc) can be covered under this.

PATCH: As the name suggests it is reserved for bug fixes internal to the system/product. Note that these bug fixes should be backward compatible.


WHY? πŸ“’

  • Reduce dependency hell: Suppose in an app, you have 15 dependencies of third-party packages. If those 15 packages don't follow the proper practices of SemVer then you will not know which package to update and what impact it will make on the app. At a point, you will end up in dependency hell where you will have to wait for third-party packages to update their versions in order to release your app. Practices rules of SemVer we can easily and efficiently do dependency management.
  • Following standards for release planning and deployments: Any release's stability and lifespan can be judged by its SemVer. For CI/CD pipelines also appropriate versioning plays a vital role.

RULES πŸ“

There are some standard practices that should be followed while using Semantic Versioning.

  1. MAJOR, MINOR, PATCH must be whole numbers (0,1,2…). These should not include negative integers or decimal points.
  2. Once version details are published for any app, they should not be altered. Version values can only be changed as a new release.
  3. Comparing 2 SemVer must be from left to right based on the increasing value of the number. Ex : 1.0.0 < 1.1.0 < 2.0.0 < 2.0.1
  4. Major version 0 (0.x.y) is for the development phase. During this, the app must not be considered stable.

(For more details visit semver.org)


Completing our Building App 🏒

  • Let's wind up our article by completing the example. We're building an app named Building. And among that; Crane was not following SemVer. The truck was following.
  • When you plan the release of the Building app at that time πŸ—οΈ Crane's version -> 2.1.3 & 🚚 Truck's version -> 1.2.2. By this, we can predict that for Crane -> till version 2.x.y & Truck -> till version -> 1.p.q we can publish our app and there will be no breaking changes.
  • But this surety can only be assured by a package Truck and not from Crane. The reason is Crane is not following SemVer standards. So in the next release Crane -> version 2.1.5 they might introduce some breaking changes of which we're unaware.
  • If we're using more ill-planned packages like Crane, this can lead to dependency hell and end up in an issue for App. So be cautious to choose packages…

What about Practical β“πŸ€”

  • Too much technical jargons so far… πŸ˜…. Only theory can't be sufficient. We'll look into the practical application of SemVer by developing a Node-based MunchPay API. Where we'll check each aspect of versioning and deploying.
  • Stay tuned for the continued series article: Semantic Versioning in MunchPay Node API for practical exposure.

Closing comments πŸ™‹β€β™‚οΈ

  • Thank you for reading along with me. If you find any queries on the above-mentioned topic, please ping in the comments.
  • Knowledge spreads by sharing. So please share this article with concerned friends.
  • PS : Also, I humbly request you to write which topic you want in my next blog. I will include that in my target list. 🎯

Tirth Patel, signing off! 🫑

opensourceproductivityprogrammingwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.