+ ## [3.4.27](https://github.com/vuejs/core/compare/v3.4.26...v3.4.27) (2024-05-06)
+
+
+ ### Bug Fixes
+
+ * **compat:** include legacy scoped slots ([#10868](https://github.com/vuejs/core/issues/10868)) ([8366126](https://github.com/vuejs/core/commit/83661264a4ced3cb2ff6800904a86dd9e82bbfe2)), closes [#8869](https://github.com/vuejs/core/issues/8869)
+ * **compiler-core:** add support for arrow aysnc function with unbracketed ([#5789](https://github.com/vuejs/core/issues/5789)) ([ca7d421](https://github.com/vuejs/core/commit/ca7d421e8775f6813f8943d32ab485e0c542f98b)), closes [#5788](https://github.com/vuejs/core/issues/5788)
+ * **compiler-dom:** restrict createStaticVNode usage with option elements ([#10846](https://github.com/vuejs/core/issues/10846)) ([0e3d617](https://github.com/vuejs/core/commit/0e3d6178b02d0386d779720ae2cc4eac1d1ec990)), closes [#6568](https://github.com/vuejs/core/issues/6568) [#7434](https://github.com/vuejs/core/issues/7434)
+ * **compiler-sfc:** handle keyof operator ([#10874](https://github.com/vuejs/core/issues/10874)) ([10d34a5](https://github.com/vuejs/core/commit/10d34a5624775f20437ccad074a97270ef74c3fb)), closes [#10871](https://github.com/vuejs/core/issues/10871)
+ * **hydration:** handle edge case of style mismatch without style attribute ([f2c1412](https://github.com/vuejs/core/commit/f2c1412e46a8fad3e13403bfa78335c4f704f21c)), closes [#10786](https://github.com/vuejs/core/issues/10786)
+
+
+
+# [3.5.0-alpha.2](https://github.com/vuejs/core/compare/v3.4.26...v3.5.0-alpha.2) (2024-05-04)
+
+
+### Bug Fixes
+
+* **types:** fix app.component() typing with inline defineComponent ([908f70a](https://github.com/vuejs/core/commit/908f70adc06038d1ea253d96f4024367f4a7545d)), closes [#10843](https://github.com/vuejs/core/issues/10843)
+* **types:** fix compat with generated types that rely on CreateComponentPublicInstance ([c146186](https://github.com/vuejs/core/commit/c146186396d0c1a65423b8c9a21251c5a6467336)), closes [#10842](https://github.com/vuejs/core/issues/10842)
+* **types:** props in defineOptions type should be optional ([124c4ca](https://github.com/vuejs/core/commit/124c4cac833a28ae9bc8edc576c1d0c7c41f5985)), closes [#10841](https://github.com/vuejs/core/issues/10841)
+
+
+### Features
+
+* **runtime-core:** add app.onUnmount() for registering cleanup functions ([#4619](https://github.com/vuejs/core/issues/4619)) ([582a3a3](https://github.com/vuejs/core/commit/582a3a382b1adda565bac576b913a88d9e8d7a9e)), closes [#4516](https://github.com/vuejs/core/issues/4516)
+
+
+
## [3.4.26](https://github.com/vuejs/core/compare/v3.4.25...v3.4.26) (2024-04-29)
{
"private": true,
- "version": "3.4.27",
+ "version": "3.5.0-alpha.2",
- "packageManager": "pnpm@9.0.6",
+ "packageManager": "pnpm@9.1.2",
"type": "module",
"scripts": {
"dev": "node scripts/dev.js",
expect(a.value).not.toBe(r)
})
+ test('should not trigger when setting the same raw object', () => {
+ const obj = {}
+ const r = ref(obj)
+ const spy = vi.fn()
+ effect(() => spy(r.value))
+ expect(spy).toHaveBeenCalledTimes(1)
+
+ r.value = obj
+ expect(spy).toHaveBeenCalledTimes(1)
+ })
++
+ test('toValue', () => {
+ const a = ref(1)
+ const b = computed(() => a.value + 1)
+ const c = () => a.value + 2
+ const d = 4
+
+ expect(toValue(a)).toBe(1)
+ expect(toValue(b)).toBe(2)
+ expect(toValue(c)).toBe(3)
+ expect(toValue(d)).toBe(4)
+ })
})
expect(scope.effects.length).toBe(0)
})
+ // simplified case of VueUse syncRef
+ test('sync watcher should not be batched', () => {
+ const a = ref(0)
+ const b = ref(0)
+ let pauseB = false
+ watch(
+ a,
+ () => {
+ pauseB = true
+ b.value = a.value + 1
+ pauseB = false
+ },
+ { flush: 'sync' },
+ )
+ watch(
+ b,
+ () => {
+ if (!pauseB) {
+ throw new Error('should not be called')
+ }
+ },
+ { flush: 'sync' },
+ )
+
+ a.value = 1
+ expect(b.value).toBe(2)
+ })
+
+ test('watchEffect should not fire on computed deps that did not change', async () => {
+ const a = ref(0)
+ const c = computed(() => a.value % 2)
+ const spy = vi.fn()
+ watchEffect(() => {
+ spy()
+ c.value
+ })
+ expect(spy).toHaveBeenCalledTimes(1)
+ a.value += 2
+ await nextTick()
+ expect(spy).toHaveBeenCalledTimes(1)
+ })
++
+ test('circular reference', async () => {
+ const obj = { a: 1 }
+ // @ts-expect-error
+ obj.b = obj
+ const foo = ref(obj)
+ const spy = vi.fn()
+
+ watch(foo, spy, { deep: true })
+
+ // @ts-expect-error
+ foo.value.b.a = 2
+ await nextTick()
+ expect(spy).toHaveBeenCalledTimes(1)
+ expect(foo.value.a).toBe(2)
+ })
})
$watch<T extends string | ((...args: any) => any)>(
source: T,
cb: T extends (...args: any) => infer R
- ? (...args: [R, R]) => any
- : (...args: any) => any,
+ ? (...args: [R, R, OnCleanup]) => any
+ : (...args: [any, any, OnCleanup]) => any,
options?: WatchOptions,
): WatchStopHandle
-} & IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> &
- ShallowUnwrapRef<B> &
- UnwrapNestedRefs<D> &
- ExtractComputedReturns<C> &
- M &
- ComponentCustomProperties &
- InjectToObject<I>
+} & ExposedKeys<
+ IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> &
+ ShallowUnwrapRef<B> &
+ UnwrapNestedRefs<D> &
+ ExtractComputedReturns<C> &
+ M &
+ ComponentCustomProperties &
+ InjectToObject<I>,
+ Exposed
+>
export type PublicPropertiesMap = Record<
string,