LaravelFreelancerNL's avatar

Laravel version support in new package

I've got a new package in development. The 1.0.0-alpha is nearly ready for the beta stage. Currently it supports L10. Support for L11 would change enough to justify a new major release.

I'm curious what the community thinks about just bumping the minimum level of support to L11 given that it is in alpha stage anyway (and thus not solidified). For me personally that would be just fine. As I already use it in production and can just upgrade those projects.

That would exclude L10 though which may pose a problem for others, given that it will receive another two years of support.

What do you think would be a good solution and why?

0 likes
3 replies
LaryAI's avatar
Level 58
It's great to hear that you're nearing the beta stage with your new package. When it comes to supporting different versions of Laravel, there are a few considerations to keep in mind:

1. **User Base**: Consider the user base of your package. If a significant number of your potential users are still on Laravel 10, it might be beneficial to support it. You can gather this information through surveys or by checking the download statistics of Laravel 10 versus Laravel 11 packages.

2. **Maintenance Overhead**: Supporting multiple versions of Laravel can increase the maintenance overhead. You'll need to ensure compatibility with each version and potentially deal with version-specific bugs.

3. **Features and Improvements**: If Laravel 11 introduces features or improvements that are essential for your package, or significantly simplifies the implementation, it might be worth focusing on the newer version.

Given that your package is still in the alpha stage, you have more flexibility in setting the requirements. Here are a few approaches you could take:

- **Support Both Versions**: Initially support both Laravel 10 and 11. This can be done by checking the Laravel version at runtime and conditionally loading different service providers or using different implementations as needed.

- **Branching Strategy**: Create separate branches for Laravel 10 and Laravel 11 support. This way, you can continue to offer updates for both versions, but new features might only be added to the Laravel 11 version.

- **Minimum Version Bump**: Since you're still in alpha, you could decide to only support Laravel 11 going forward. This is a cleaner approach but does risk alienating users who are not ready to upgrade.

- **Composer Constraints**: Use composer's version constraints to manage compatibility. For example, you could require `"illuminate/support": "^10.0|^11.0"` to allow installation on both Laravel 10 and 11.

Here's an example of how you might handle different Laravel versions within your package's service provider:

```php
public function register()
{
    if ($this->app->version() < 11) {
        // Register services for Laravel 10
    } else {
        // Register services for Laravel 11
    }
}

Ultimately, the decision should be based on your capacity to maintain the package and the needs of your user base. If you have the resources to support both versions without compromising the quality of the package, that would be ideal. However, if supporting Laravel 10 would hold back the development or add significant complexity, it might be better to focus on Laravel 11, especially since your package is still in alpha and users have not come to rely on it yet.

martinbean's avatar

@laravelfreelancernl Why would adding Laravel 11 support “justify a new major release”? What changed between Laravel 10 and 11, that would require such a monumental change in your package?

LaravelFreelancerNL's avatar

It's a driver for ArangoDB , a NoSql multimodel database.

It overrides a lot of things such as migration commands and transactions. For some, maybe all, of the changes in Laravel I could implement checks to support both. (Although I'd rather keep it clean.)

However I also need to override some of the orchestra/testbench features, and those typically change per Laravel version as the testbench gets a new major release for every Laravel version.

I went through the same song and dance last year for a 0.x release.

Please or to participate in this conversation.