Skip to content

Conversation

@ilyaliao
Copy link
Member

@ilyaliao ilyaliao commented Sep 13, 2025

Description

This PR deprecates computedEager, as since Vue 3.4 the built-in computed already avoids triggering dependents when the value is unchanged, and with VueUse v14 requiring Vue 3.5+, users can use the native computed directly.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 13, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 13, 2025

Open in StackBlitz

@vueuse/components

npm i https://pkg.pr.new/@vueuse/components@5034

@vueuse/core

npm i https://pkg.pr.new/@vueuse/core@5034

@vueuse/electron

npm i https://pkg.pr.new/@vueuse/electron@5034

@vueuse/firebase

npm i https://pkg.pr.new/@vueuse/firebase@5034

@vueuse/integrations

npm i https://pkg.pr.new/@vueuse/integrations@5034

@vueuse/math

npm i https://pkg.pr.new/@vueuse/math@5034

@vueuse/metadata

npm i https://pkg.pr.new/@vueuse/metadata@5034

@vueuse/nuxt

npm i https://pkg.pr.new/@vueuse/nuxt@5034

@vueuse/router

npm i https://pkg.pr.new/@vueuse/router@5034

@vueuse/rxjs

npm i https://pkg.pr.new/@vueuse/rxjs@5034

@vueuse/shared

npm i https://pkg.pr.new/@vueuse/shared@5034

commit: 26fbb47

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 15, 2025
@antfu antfu changed the title feat: mark computedEager as deprecated feat(computedEager): deprecate computedEager Sep 16, 2025
@antfu antfu added this pull request to the merge queue Sep 16, 2025
Merged via the queue into vueuse:main with commit 26a7d34 Sep 16, 2025
10 checks passed
@ilyaliao ilyaliao deleted the feat/deprecate-computedeager branch September 16, 2025 14:55
@benedictleejh
Copy link

I'm posting here as suggested by @9romise, and hopefully there can be a discussion on a way forward. To repost my comment from #4748:

I want to chime in a bit here regarding the behaviour of computedEager and computed. Vue's computed does not fully replace the behaviour of computedEager at the moment. computed is lazy, and the first computation is only be triggered when it is used, whether in the template or later in the script block, whereas computedEager is triggered immediately.

Is there a way for Vue's computed to be triggered immediately? Without it, I am unable to replace computedEager with computed. I am currently on Vue 3.5.22.

While Vue 3.4's computed may already avoid triggering dependents (and I'm sure some people were using computedEager to do so previously), as things currently stand, computed does not work as a complete replacement for the behaviour of computedEager due to the continued lazy evaluation of computed.

---
category: Reactivity
alias: eagerComputed
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilyaliao we forgot to deprecate it in frontmatter 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants