Skip to content

Conversation

@zguig52
Copy link
Contributor

@zguig52 zguig52 commented Apr 23, 2025

πŸ”— Linked issue

Resolves #3962 #3377 #3597 #3821

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Tables are no more reactive in v3, being based on TanStack Table.
By using an internal ref + watcher that automatically trigger data re-assignation to be detected/updated by TanStack.
Optionally, in case of performances issues, original behaviour can be restored by setting watchDepth prop to false. Depth can also be fine tuned to limit it.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

zguig52 and others added 4 commits April 23, 2025 17:35
…uration (for performances optimization capabilities)

Restore Nuxt UI v2 behaviour of table:
nuxt#3962
nuxt#3377
nuxt#3597
nuxt#3821

NB: typecheck issue was already present before this commit
../ui/src/runtime/components/Table.vue:228:3 - error TS2322: Type 'Ref<UnwrapRefSimple<T>[], T[] | UnwrapRefSimple<T>[]>' is not assignable to type 'MaybeRef<T[]>'.
  Type 'Ref<UnwrapRefSimple<T>[], T[] | UnwrapRefSimple<T>[]>' is not assignable to type 'Ref<T[], T[]>'.
    Type 'UnwrapRefSimple<T>[]' is not assignable to type 'T[]'.
      Type 'UnwrapRefSimple<T>' is not assignable to type 'T'.
        'UnwrapRefSimple<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown'.
          Type 'unknown' is not assignable to type 'T'.
            'unknown' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown'.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 23, 2025

npm i https://pkg.pr.new/@nuxt/ui@3967

commit: af514d3

@benjamincanac benjamincanac changed the title feat(Table): allow Table reactivity + associated watcher depth configuration (for performances optimization capabilities) fix(Table): improve data reactivity Apr 23, 2025
zguig52 and others added 2 commits April 23, 2025 20:52
- remove useless new test
- change watchDeep prop to more general watchOptions
- integrate documentation directly in table props description
@benjamincanac benjamincanac merged commit 6e27304 into nuxt:v3 Apr 24, 2025
8 of 9 checks passed
@benjamincanac
Copy link
Member

Thanks @zguig52! 😊

@benjamincanac benjamincanac added the v3 #1289 label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 #1289

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table nested arrays are not reactive

2 participants