Laravel Doesn’t Follow Semantic Versioning
While browsing repositories on GitHub I often come across Laravel packages which could simple stop working with future versions of Laravel. This can easily be fixed by being more specific.
Laravel doesn’t follow Semantic Versioning. Instead Laravel keeps the first number as a name, the second as major release and the third can be both feature and bug-fix. Laravel follows Romantic Versioning.
HUMAN.MAJOR.MINOR NAME.MAJOR.MINOR/PATCH NAME.BREAKING.FEATURE/BUGFIX
This is quite important and in my opinion all Laravel package developers should know about this.
Packages will most likely break if you allow all future versions of Laravel 5.
The solution is to be more specific. Let’s say we support version 5.2 and 5.3. We can add both versions to the composer.json file.
"illuminate/support": "5.2.* || 5.3.*"
Now we know it wont break in Laravel 5.4 since we don’t allow that version.
@barryvdh I would use 5.0.x… not that anything major will change, but sometimes very small thing sdo— Taylor Otwell (@taylorotwell) March 9, 2015
I suggest taking a look at Graham Campbell’s packages and use them as a boilerplate for future and existing Laravel packages. Graham is one of the core contributors of Laravel. He always specifies the exact versions of Laravel in his packages.
Like this article? Reach out to me and say hi on Twitter!
All articles written with ♥ by Vincent Klaiber