Skip to content

Commit 3b9227b

Browse files
Merge branch 'main' into fix-vModel-checkbox
2 parents 3880db7 + 04d2c05 commit 3b9227b

File tree

23 files changed

+202
-46
lines changed

23 files changed

+202
-46
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [3.3.12](https://github.com/vuejs/core/compare/v3.3.11...v3.3.12) (2023-12-16)
2+
3+
4+
### Bug Fixes
5+
6+
* **hydration:** handle appear transition before patch props ([#9837](https://github.com/vuejs/core/issues/9837)) ([e70f4c4](https://github.com/vuejs/core/commit/e70f4c47c553b6e16d8fad70743271ca23802fe7)), closes [#9832](https://github.com/vuejs/core/issues/9832)
7+
* **sfc/cssVars:** fix loss of CSS v-bind variables when setting inline style with string value ([#9824](https://github.com/vuejs/core/issues/9824)) ([0a387df](https://github.com/vuejs/core/commit/0a387dfb1d04afb6eae4296b6da76dfdaca77af4)), closes [#9821](https://github.com/vuejs/core/issues/9821)
8+
* **ssr:** fix suspense hydration of fallback content ([#7188](https://github.com/vuejs/core/issues/7188)) ([60415b5](https://github.com/vuejs/core/commit/60415b5d67df55f1fd6b176615299c08640fa142))
9+
* **types:** add `xmlns:xlink` to `SVGAttributes` ([#9300](https://github.com/vuejs/core/issues/9300)) ([0d61b42](https://github.com/vuejs/core/commit/0d61b429ecf63591d31e09702058fa4c7132e1a7)), closes [#9299](https://github.com/vuejs/core/issues/9299)
10+
* **types:** fix `shallowRef` type error ([#9839](https://github.com/vuejs/core/issues/9839)) ([9a57158](https://github.com/vuejs/core/commit/9a571582b53220270e498d8712ea59312c0bef3a))
11+
* **types:** support for generic keyof slots ([#8374](https://github.com/vuejs/core/issues/8374)) ([213eba4](https://github.com/vuejs/core/commit/213eba479ce080efc1053fe636f6be4a4c889b44))
12+
13+
14+
115
## [3.3.11](https://github.com/vuejs/core/compare/v3.3.10...v3.3.11) (2023-12-08)
216

317

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"packageManager": "[email protected]",
55
"type": "module",
66
"scripts": {

packages/compiler-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

packages/compiler-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-sfc",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/compiler-sfc",
55
"main": "dist/compiler-sfc.cjs.js",
66
"module": "dist/compiler-sfc.esm-browser.js",

packages/compiler-ssr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-ssr",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/compiler-ssr",
55
"main": "dist/compiler-ssr.cjs.js",
66
"types": "dist/compiler-ssr.d.ts",

packages/dts-test/ref.test-d.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@ const state = reactive({
163163

164164
expectType<string>(state.foo.label)
165165

166+
describe('ref with generic', <T extends { name: string }>() => {
167+
const r = {} as T
168+
const s = ref(r)
169+
expectType<string>(s.value.name)
170+
171+
const rr = {} as MaybeRef<T>
172+
// should at least allow casting
173+
const ss = ref(rr) as Ref<T>
174+
expectType<string>(ss.value.name)
175+
})
176+
166177
// shallowRef
167178
type Status = 'initial' | 'ready' | 'invalidating'
168179
const shallowStatus = shallowRef<Status>('initial')
@@ -201,11 +212,28 @@ if (refStatus.value === 'initial') {
201212
expectType<IsAny<typeof a>>(false)
202213
}
203214

204-
describe('shallowRef with generic', <T>() => {
205-
const r = ref({}) as MaybeRef<T>
206-
expectType<ShallowRef<T> | Ref<T>>(shallowRef(r))
215+
describe('shallowRef with generic', <T extends { name: string }>() => {
216+
const r = {} as T
217+
const s = shallowRef(r)
218+
expectType<string>(s.value.name)
219+
expectType<ShallowRef<T>>(shallowRef(r))
220+
221+
const rr = {} as MaybeRef<T>
222+
// should at least allow casting
223+
const ss = shallowRef(rr) as Ref<T> | ShallowRef<T>
224+
expectType<string>(ss.value.name)
207225
})
208226

227+
{
228+
// should return ShallowRef<T> | Ref<T>, not ShallowRef<T | Ref<T>>
229+
expectType<ShallowRef<{ name: string }> | Ref<{ name: string }>>(
230+
shallowRef({} as MaybeRef<{ name: string }>)
231+
)
232+
expectType<ShallowRef<number> | Ref<string[]> | ShallowRef<string>>(
233+
shallowRef('' as Ref<string[]> | string | number)
234+
)
235+
}
236+
209237
// proxyRefs: should return `reactive` directly
210238
const r1 = reactive({
211239
k: 'v'

packages/reactivity-transform/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/reactivity-transform",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/reactivity-transform",
55
"main": "dist/reactivity-transform.cjs.js",
66
"files": [

packages/reactivity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/reactivity",
3-
"version": "3.3.11",
3+
"version": "3.3.12",
44
"description": "@vue/reactivity",
55
"main": "index.js",
66
"module": "dist/reactivity.esm-bundler.js",

packages/reactivity/src/ref.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ export type ShallowRef<T = any> = Ref<T> & { [ShallowRefMarker]?: true }
114114
* @param value - The "inner value" for the shallow ref.
115115
* @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowref}
116116
*/
117-
export function shallowRef<T>(value: MaybeRef<T>): Ref<T> | ShallowRef<T>
118-
export function shallowRef<T extends Ref>(value: T): T
119-
export function shallowRef<T>(value: T): ShallowRef<T>
117+
export function shallowRef<T>(
118+
value: T
119+
): Ref extends T
120+
? T extends Ref
121+
? IfAny<T, ShallowRef<T>, T>
122+
: ShallowRef<T>
123+
: ShallowRef<T>
120124
export function shallowRef<T = any>(): ShallowRef<T | undefined>
121125
export function shallowRef(value?: unknown) {
122126
return createRef(value, true)

0 commit comments

Comments
 (0)