inertia
inertia copied to clipboard
Updating data causes component to re-render
Versions:
@inertiajs/inertiaversion: 0.8.5@inertiajs/inertia-vue3version: 0.3.5
Describe the problem:
I noticed lag/delay when I typed into inputs on my website. So to debug this, I added all the lifecycle hooks to see what was happening and as you can see here, a couple of them were fired when updating the data. According to the docs these events should only be fired when updating the DOM.
Steps to reproduce:
I achieved this with both the Options API and Composition API. I removed my layout and tested with just returning a component without data from my controller.
Here is a simple example component:
<template>
<input
v-model="text"
type="text"
>
</template>
<script lang="ts">
import { defineComponent, ref, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, onErrorCaptured, onRenderTracked, onRenderTriggered } from 'vue';
export default defineComponent({
setup() {
const text = ref('');
// ... all lifecycle listeners here
return { text }
},
})
</script>
Also exist using Vue 2, components are re-rendered even if I use $inertia.reload({ only: ['specific_props']). I think it shouldn't behave that way, this will tear app performance.
Hey! Thanks so much for your interest in Inertia.js and for sharing this issue/suggestion.
In an attempt to get on top of the issues and pull requests on this project I am going through all the older issues and PRs and closing them, as there's a decent chance that they have since been resolved or are simply not relevant any longer. My hope is that with a "clean slate" me and the other project maintainers will be able to better keep on top of issues and PRs moving forward.
Of course there's a chance that this issue is still relevant, and if that's the case feel free to simply submit a new issue. The only thing I ask is that you please include a super minimal reproduction of the issue as a Git repo. This makes it much easier for us to reproduce things on our end and ultimately fix it.
Really not trying to be dismissive here, I just need to find a way to get this project back into a state that I am able to maintain it. Hope that makes sense! ❤️