You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just testing deferred props and noticed that my shared props were evaluated during the loading of the deferred props (partial load), even though all my shared props are in the Optional form and shouldn't be evaluated during a partial load.
"shared_list" => fn() => ...
I've tracked the issue to the resolveProperties function in Response:
resolves all props, no matter if they are supposed to be included in the response.
Moving $props = $this->resolveArrayableProperties($props, $request); below resolveExcept solves the issue as the props have been filtered at the point.
I don't know the potential ramifications of moving this line of code since this is a brand new refactor, but if it's OK with you I'm happy to submit a PR for the fix. Just let me know
The text was updated successfully, but these errors were encountered:
Instead of not running the closure on partial realods, even if you use only: [key_not_included_here] or except: [key_included_here] it will correctly NOT appear in the response, but it will be evaluated and all the code inside the closure will run.
Hi,
Testing v2 beta1 released today.
Just testing deferred props and noticed that my shared props were evaluated during the loading of the deferred props (partial load), even though all my shared props are in the Optional form and shouldn't be evaluated during a partial load.
I've tracked the issue to the resolveProperties function in Response:
inertia-laravel/src/Response.php
Lines 134 to 159 in 141256b
Calling
inertia-laravel/src/Response.php
Line 144 in 141256b
Moving
$props = $this->resolveArrayableProperties($props, $request);
belowresolveExcept
solves the issue as the props have been filtered at the point.I don't know the potential ramifications of moving this line of code since this is a brand new refactor, but if it's OK with you I'm happy to submit a PR for the fix. Just let me know
The text was updated successfully, but these errors were encountered: