Skip to content
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

Infinite Table updates? #191

Open
kikuomax opened this issue Feb 11, 2024 · 4 comments
Open

Infinite Table updates? #191

kikuomax opened this issue Feb 11, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kikuomax
Copy link
Collaborator

Overview of the problem

Buefy version: [0.1.2]
Vuejs version: [3.3.7]
OS/Browser: macOS/test-utils

Description

Table caused infinite updates of reactive states.

[Vue warn]: Maximum recursive updates exceeded in component <BTable>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.

Steps to reproduce

  1. Merge changes in the original buefy repo (Merge changes in buefy/buefy from b6233b9c335d99cf688ee2a3b9c61fd26a92a182 to v0.9.28 #159)
  2. cd packages/buefy-next
  3. npx jest src/components/table/TableColumn.spec.js

Expected behavior

No infinite updates.

Actual behavior

Infinite updates.

@kikuomax kikuomax added the bug Something isn't working label Feb 11, 2024
@wesdevpro wesdevpro moved this to 🆕 New in Buefy Vue3 Project Board Apr 15, 2024
@wesdevpro wesdevpro added this to the v0.1.5 milestone Jul 22, 2024
@wesdevpro wesdevpro moved this from 🆕 New to 🔖 Ready in Buefy Vue3 Project Board Aug 10, 2024
@kikuomax
Copy link
Collaborator Author

This might be caused by values bound to <b-slot-component>, which are return values of methods; i.e., a brand new object is created every time the method is called.

<b-slot-component
:component="column"
v-bind="column.tdAttrs(row, column)"
scoped
name="default"
tag="td"
:class="column.getRootClasses(row)"
:style="column.getRootStyle(row)"
:data-label="column.label"
:props="{
row, column, index, colindex,
toggleDetails, isActiveDetailRow
}"
@click="$emit('cellclick',row,column,index,colindex)"
/>

I found a case where the recursion error disappeared if I removed all of the v-bind, :class, and :style bindings.

@wesdevpro
Copy link

wesdevpro commented Aug 31, 2024

This might be caused by values bound to <b-slot-component>, which are return values of methods; i.e., a brand new object is created every time the method is called.

<b-slot-component
:component="column"
v-bind="column.tdAttrs(row, column)"
scoped
name="default"
tag="td"
:class="column.getRootClasses(row)"
:style="column.getRootStyle(row)"
:data-label="column.label"
:props="{
row, column, index, colindex,
toggleDetails, isActiveDetailRow
}"
@click="$emit('cellclick',row,column,index,colindex)"
/>

I found a case where the recursion error disappeared if I removed all of the v-bind, :class, and :style bindings.

As a result did the CPU usage go down to?

@kikuomax
Copy link
Collaborator Author

As a result did the CPU usage go down to?

@wesdevpro I was not able to measure the CPU usage because I just ran a tiny Vitest test case.

@kikuomax kikuomax self-assigned this Aug 31, 2024
@wesdevpro
Copy link

As a result did the CPU usage go down to?

@wesdevpro I was not able to measure the CPU usage because I just ran a tiny Vitest test case.

That makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants