Closed veneliniliev closed 6 months ago
It's actually worse than that - laravel-json-api/laravel
relies on ^5.0
.
This has actually been discussed on Slack. I agree it would be really useful to be able to install both the old package and the new package - and the only blocker to doing that is the Neomerx dependency.
So yes, I think it would be useful to do this upgrade in the old package to unblock this. However, I don't really have a concept of how long that'll take, as it's bit of an unknown quantity as to how big the change is.
I think it would be quite convenient for people like me to migrate to the new version.
i tested with "laravel-json-api/laravel": "^1.0" and there are no problems with conflicts. BUT has problem with PHP 8.1
Cannot use 'readonly' as an identifier. It is a reserved keyword since PHP 8.1
in
interface Fillable extends ReadOnly
I'm thinking of an option where even if I migrate twice, I can get a new version...
@veneliniliev you need to use laravel-json-api/laravel:^2.0
as that works with PHP 8.1 (it fixes that readonly problem).
@veneliniliev you need to use
laravel-json-api/laravel:^2.0
as that works with PHP 8.1 (it fixes that readonly problem).
yes, but I return to the first problem. obviously, migration will not be easy :(
FYI have started working on upgrading cloudcreativity/laravel-json-api
to the latest version of the Neomerx dependency, so that both the old and new packages could be installed at once.
It's looking like a big job, so not sure how long it will take me. But have started!
this is good news. if I can help with something... i'm ready :)
thanks for the offer! it's a bit difficult to split up as I'm really not sure where the problems are without exploring and fixing stuff as I go. So think I'll just keep plugging on with it, probably this coming weekend.
Latest update on this. I'm 95% of the way through upgrading the neomerx dependency. Basically it's all working (as far as I can tell) except for default include paths. My first attempt at getting them working hasn't worked, so need to try another approach.
Just thought I'd put an update here so you all know I'm still working on this!
I hope you can find a good solution. it would be very convenient to smoothly migrate versions. I have a project with a lot of tests and I will find out if everything works properly
Good news, just tagged v5.0.0-alpha.1
that has the Neomerx upgrade in it. As I don't have this package in any applications anymore, I really need people to give it a go and let me know if there's anything that isn't working. (If you find something that isn't working, create a new issue and make it clear on the issue you're using the 5.0 alpha version.)
Upgrade guide is here. Also let me know if there's any steps missing from the upgrade guide: https://github.com/cloudcreativity/laravel-json-api/blob/v5.0.0-alpha.1/docs/upgrade.md
all my tests passed! I will test a little more and the installation of the new package. tnx!
@lindyhopchris I have a problem. in the old version, the order of includes was different.
example: includes=relation.subrelation in v4 response: includes:[ subrelation..., relation... ],
in v5 response: includes:[ relation... subrelation..., ]
is there an option for them to come the old way because the frontend library doesn't recognize the relations because it goes through them in order and doesn't find the resources?
I believe the spec says that there is no significance to the order of the resources in the included
top-level member. I'll need to find that in the spec.
The frontend library should be using the type
and id
combination that forms the resource identifier in the relationship to locate the resources in the included
member. Trying to find it by numeric index in the included
array seems extremely strange as the order isn't guaranteed.
@lindyhopchris everything looks fine. already works on prod!
Closing this as this issue is now effectively done.
I want to migrate from cloudcreativity/laravel-json-api to laravel-json-api/laravel.
I have too much code that I don't want to migrate when starting a new laravel project. Can I install both libraries in one project?
I have a problem with one dependency library that is different version laravel-json-api/encoder-neomerx
@lindyhopchris Is there a possibility that this will happen?