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

fix(reactive): markRaw function return the value directly when it has been marked #11864

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

kovsu
Copy link
Contributor

@kovsu kovsu commented Sep 9, 2024

Closes: #11862

Copy link

github-actions bot commented Sep 9, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+17 B) 37.7 kB (+5 B) 34 kB (-25 B)
vue.global.prod.js 159 kB (+17 B) 57.7 kB (+4 B) 51.3 kB (+33 B)

Usages

Name Size Gzip Brotli
createApp 55.4 kB (+18 B) 21.3 kB (+9 B) 19.5 kB (+52 B)
createSSRApp 59.3 kB (+18 B) 23 kB (+9 B) 20.9 kB
defineCustomElement 60.1 kB (+18 B) 22.8 kB (+12 B) 20.7 kB
overall 69.1 kB (+18 B) 26.4 kB (+9 B) 24 kB (+80 B)

Copy link

pkg-pr-new bot commented Sep 9, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: e9a60e9

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

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

Could you add a test case for this?

Currently there's a typo in the PR title, markRow.

@@ -405,6 +405,7 @@ export type Raw<T> = T & { [RawSymbol]?: true }
* @see {@link https://vuejs.org/api/reactivity-advanced.html#markraw}
*/
export function markRaw<T extends object>(value: T): Raw<T> {
if (hasOwn(value, ReactiveFlags.SKIP)) return value
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps merge this check into the if below, rather than duplicating the return value?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed

@kovsu kovsu changed the title fix(reactive): markRow function return the value directly when it has been marked fix(reactive): markRaw function return the value directly when it has been marked Sep 9, 2024
@edison1105 edison1105 added need test The PR has missing test cases. scope: reactivity 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels Sep 9, 2024
@edison1105 edison1105 added ready to merge The PR is ready to be merged. and removed need test The PR has missing test cases. labels Sep 9, 2024
@yyx990803 yyx990803 merged commit 67d6596 into vuejs:main Sep 10, 2024
13 checks passed
@kovsu kovsu deleted the fix-#11862 branch September 10, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. 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.

vue.markRaw Cannot assign to read only property '__v_skip' of object '#<Object>'
4 participants