inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
1.99k stars 222 forks source link

Partial reload behaviour change in 1.1.0 causes lazy attributes not to be reloaded correctly #640

Closed Verox001 closed 1 month ago

Verox001 commented 1 month ago

Version:

Describe the problem:

I updated Inertia a few minutes ago and found the following issue. Before the Update to 1.1.0: When having a list of objects 'foos', with each object having a lazy attribute like 'bar', reloading the list object foos, will result in the bar object being loaded in correctly.

return Inertia::render('TestView', [
    'foos' => [
        [
            'bar' => Inertia::lazy(function () {
                return 'Test';
            })
        ],
        ...
    ]
])
reload({
    only: [
        'foos'
    ],
});

Current behaviour (after 1.1.0): When I now try to do the same, bar is not being loaded into the foo object. I think the partial reload changed in this specific version are faulty for that behavior.

Verox001 commented 1 month ago

I think it would be great if that could be solved by reloading 'foos.*.bar' or something like that.

reinink commented 1 month ago

Hey thanks for reporting, this should be fixed now (see #641), and it's been released as part of v1.3.0 👍