-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
feat(reactivity): untrack and peek for ref #13286
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
base: minor
Are you sure you want to change the base?
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: edison <daiwei521@126.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… the optimized path (vuejs#13223) * fix(runtime-core): update __vnode of static nodes when patching along the optimized path * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…unmounting (vuejs#13215) * fix(compiler-core): remove slot cache from parent renderCache during unmounting * chore: update
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
WalkthroughThis change introduces a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Ref
participant ComputedRef
participant Effect
User->>Ref: a = ref(1)
User->>ComputedRef: c = computed(() => a.value + 1)
User->>Ref: a.peek()
Note right of Ref: Returns value without tracking
User->>ComputedRef: c.peek()
Note right of ComputedRef: Returns computed value without tracking
User->>Effect: effect(() => { untrack(() => a.value) })
Note right of Effect: Access inside untrack is not tracked
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@teleskop150750 |
RFC vuejs/rfcs#747
Implementation
Allows access without dependency tracking
Summary by CodeRabbit
New Features
peek()
method for refs and computed refs, allowing users to access current values without triggering reactivity.untrack
utility function to enable reading reactive values without establishing dependencies.Tests
peek()
method and theuntrack
utility, ensuring non-reactive access and correct caching behavior.