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(compiler-sfc): fix missing ReadonlyArray, ReadonlySet, ReadonlyMap and UnknownType (fix #10726) #10746

Closed
wants to merge 1 commit into from

Conversation

NathanFreeman
Copy link

No description provided.

@NathanFreeman
Copy link
Author

#10726

@NathanFreeman
Copy link
Author

Maybe the type of ReadonlyArray should be object, I'm not quite sure.

@NathanFreeman NathanFreeman changed the title fix(compiler-sfc): add ReadonlyArray type fix(compiler-sfc): fix missing ReadonlyArray, ReadonlySet, ReadonlyMap and UnknownType Apr 20, 2024
@NathanFreeman NathanFreeman changed the title fix(compiler-sfc): fix missing ReadonlyArray, ReadonlySet, ReadonlyMap and UnknownType fix(compiler-sfc): fix missing ReadonlyArray, ReadonlySet, ReadonlyMap and UnknownType (fix #10726) Apr 21, 2024
Copy link

@VividLemon VividLemon left a comment

Choose a reason for hiding this comment

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

Lgtm


export default /*#__PURE__*/_defineComponent({
props: {
"modelValue": { type: [String, ReadonlyArray, ReadonlySet, ReadonlyMap], skipCheck: true },
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't make sense. ReadonlyArray is a TS type, not a built-in JavaScript object at runtime.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you!
Okay, can I move the ReadonlyArray, ReadonlySet, ReadonlyMap to the next case and return it as an object?

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.7 kB (+28 B) 34.5 kB (+7 B) 31.1 kB (+3 B)
vue.global.prod.js 148 kB 53.8 kB (+2 B) 48 kB (+11 B)

Usages

Name Size Gzip Brotli
createApp 50.8 kB (+47 B) 19.9 kB (+17 B) 18.1 kB (+1 B)
createSSRApp 54.1 kB (+28 B) 21.2 kB (+6 B) 19.3 kB (-1 B)
defineCustomElement 53.1 kB (+47 B) 20.6 kB (+17 B) 18.8 kB (+4 B)
overall 64.5 kB (+47 B) 24.9 kB (+20 B) 22.6 kB (+1 B)

@yyx990803
Copy link
Member

Thanks for the PR, however I don't think these are the right fixes. The tests are also not defineModel specific - they should be tested in resolveType.spec.ts instead.

See 5cef52a

@yyx990803 yyx990803 closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants