-
-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 Partial reloads #2094
Comments
Created a repo that reproduces the issue: RobertBoes/partial-props-bug@0b904a0 As is evident there, upon a partial reload it still takes 2 seconds, since the Did a little debugging, seems like it's going wrong here: https://github.com/inertiajs/inertia-laravel/blob/a836013b5b86b999189b4eb2ce60835cd1329136/src/Response.php#L138-L142 |
I see that the PR was merged. But this is happening to me with deferred props. Is it possible to combine deferred with partials? return Inertia::render('Hours/HourIndex', [
'usedHours' => Inertia::defer(fn () => $hoursService->getUsedHours()),
'expiringHours' => Inertia::defer(fn () => $hoursService->getExpiringHours()),
]); If from the frontend, I execute: return router.visit(route(route().current(), { only: ['usedHours'] }), {
preserveScroll: true,
preserveState: true,
}); It will load both props. The thing is that if I wrap this in Should I open a separate issue? |
Versions:
@inertiajs/vue3
version: 2.0.0-beta.2@inertiajs/inertia-laravel
version: 2.x-devproblem:
I know it's still beta for V2 but just wanted to bring this bug to the attention.
I setup a simple partial reload.
But triggering the partial reload also triggers the other props not specified in :only array
So it still executes queries/functions you don't want on a partial reload.
In V1 it skipped other props not mentioned for the partial reload.
And also did not execute the queries/functions
Steps to reproduce:
The setup for a simple dashboard page ( I stripped down the default Laravel Dashboard.vue file)
Default web.php added the Route::get('/') so it would point to the default controller
Default controller file.
Added index function with the 2 props setup as partials directing to a separate function.
Creating logs to show what is being triggered by clicking on the partial Link in de Dashboard.vue file.
English isn't my native language so tried explaining as best as i could.
If any more info i needed let me know, glad to help out!!
The text was updated successfully, but these errors were encountered: