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

Computed values from extended array methods do not re-evaluate #11628

Closed
scottbedard opened this issue Aug 15, 2024 · 2 comments · Fixed by #11629
Closed

Computed values from extended array methods do not re-evaluate #11628

scottbedard opened this issue Aug 15, 2024 · 2 comments · Fixed by #11629
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: reactivity

Comments

@scottbedard
Copy link
Contributor

scottbedard commented Aug 15, 2024

Vue version

3.5.0-beta.2

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uk1v2zAM/SucLnEWT2na7RLYwbqih+2wDdtu0zA4NpM6kSVBH2kLw/99lDW3ORQFDAsi3yMfn9iza2P4KSBbs8LVtjUeHPpgNkK1ndHWQw+17kzw2ORgcQcD7KzuYEakmVBC1bJyDm60lFj7VivAB4+qcXBtbfUIvVAAu1Y12REf5+kKVMgHq8AFg5aPWb09QLkBOjgBoSxLiIQIH4Sijzpp5Tz4u1btHZRRTKbw/qx1FtF95K1hlYOiPwy5UHMqM9EbHbYSG+JPY2XZPHYelUWMlsil3mezCfBmNsr4rzn156dKBkzSV3Ou4C1ckkwCFsvkIzlIF4+dkZVHugEUxuKm70liKpI/qRlgGIplTEcWIbfBe/LyYy3b+lgKlgi/L/5wtVgItlmsimXCEKNYnrVhOfOO5ti1e35wWtHLjqMJFudpJdpvJprlBFtPzyFYJaW+/zLGvA1IpqV4fYf18YX4wT3EmGDfLTq0JxTsKecru0ef0rc/v9I+nCU73QRJ6FeSP5DeIESNCfYpqIZkn+FGtZ/H/SRbfrnbuHJuGioKHfdmxAtGm3rzyujPcq/4+2nfyMW/J7SxJhl4xT/wi3db9BW/ZMM/xOERfQ==

Last working: 3.4.38

Steps to reproduce

  1. Create a class that extends Array
  2. Add a method to that class that calls it's super method
  3. Create a computed value that relies on that method

What is expected?

The computed property should re-evaluate when it's value in the collection changes

What is actually happening?

The computed value does not re-evaluate

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 215.31 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
    pnpm: 9.7.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 127.0.6533.101
    Firefox Nightly: 129.0a1
    Safari: 17.4.1
  npmPackages:
    vue: 3.5.0-beta.2 => 3.5.0-beta.2

Any additional comments?

Relates to #11570 and #11573

@Disservin
Copy link
Contributor

mh all of these types don't really make sense when one is extending the js array
https://github.com/vuejs/core/blob/main/packages/reactivity/src/arrayInstrumentations.ts#L60

in your case fn will be of type number

@edison1105 edison1105 linked a pull request Aug 16, 2024 that will close this issue
@edison1105 edison1105 added scope: reactivity ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Aug 16, 2024
@scottbedard
Copy link
Contributor Author

Thank you for another fast fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: reactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants