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 2 commits 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

github-actions bot commented Oct 10, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+1 B) 38 kB (+1 B) 34.2 kB (+19 B)
vue.global.prod.js 159 kB (+1 B) 57.9 kB (+2 B) 51.5 kB (+35 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.9 kB (+1 B) 18.3 kB 16.7 kB (+2 B)
createApp 55 kB (+1 B) 21.3 kB (-1 B) 19.4 kB (+12 B)
createSSRApp 59 kB (+1 B) 23 kB (-1 B) 20.9 kB (-8 B)
defineCustomElement 59.8 kB (+1 B) 22.8 kB (-3 B) 20.8 kB (-64 B)
overall 68.7 kB (+1 B) 26.3 kB 24 kB (-5 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-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@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/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/shared

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

vue

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

@vue/compat

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

commit: 2317f7f

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