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
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)
<script setup>
import { Link } from "@inertiajs/vue3";
const props = defineProps({
timestamp: Date,
timeStampPartial: Date
})
</script>
<template>
<Link href="/" >full page reload</Link>
<br/>
<br/>
<h1>test</h1>
<Link href="/" :only="['timestampPartial']">trigger only partial reload</Link>
</template>
Default web.php added the Route::get('/') so it would point to the default controller
<?php
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
Route::get('/', [\App\Http\Controllers\Controller::class,'index']);
Route::middleware([
'auth:sanctum',
config('jetstream.auth_session'),
'verified',
])->group(function () {
Route::get('/dashboard', function () {
return Inertia::render('Dashboard');
})->name('dashboard');
});
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.
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Inertia\Inertia;
class Controller
{
public function index(){
return Inertia::render('Dashboard', [
'timestamp' => fn() => $this->timestamp(),
'timestampPartial' => fn() => $this->timestampPartial()
]);
}
public function timestamp()
{
Log::info('hello');
return Carbon::now();
}
public function timestampPartial()
{
Log::info('partial function');
return Carbon::now();
}
}
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:
As is evident there, upon a partial reload it still takes 2 seconds, since the time prop is also executed, even though it's not requested and not returned in the response
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: