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

dx(reactivity): warn on nested readonly ref update during unwrapping #12141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jh-leong
Copy link
Member

@jh-leong jh-leong commented Oct 10, 2024

related to #12138

  1. Warn instead of throwing an error when updating a nested readonly ref, keeping consistency with the readonly API.
  2. Improved error message for better clarity.

Before: TypeError: 'set' on proxy: trap returned falsish for property 'foo'
After: [Vue warn] Set operation on key "foo" failed: target is readonly.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (+1 B) 38.1 kB (+2 B) 34.3 kB (+65 B)
vue.global.prod.js 160 kB (+1 B) 58 kB (+1 B) 51.5 kB (-70 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49.1 kB (+1 B) 18.9 kB 17.3 kB (+1 B)
createApp 55.7 kB (+1 B) 21.4 kB (-1 B) 19.6 kB
createSSRApp 59.7 kB (+1 B) 23.1 kB 21.1 kB (+42 B)
defineCustomElement 60.4 kB (+1 B) 23 kB 20.9 kB (-8 B)
overall 69.4 kB (+1 B) 26.5 kB 24.1 kB (+73 B)

Copy link

pkg-pr-new bot commented Oct 10, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@12141

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@12141

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@12141

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@12141

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@12141

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@12141

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@12141

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@12141

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@12141

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@12141

vue

pnpm add https://pkg.pr.new/vue@12141

commit: 0453906

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. ready to merge The PR is ready to be merged. scope: reactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants