From 248a14a39463379343853688b096b86adc04d7fb Mon Sep 17 00:00:00 2001 From: Alex <49969959+alexzhang1030@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:19:16 +0800 Subject: [PATCH 01/22] chore: update test case to align with vue behavior (#797) --- .../devtools-kit/__tests__/component/decode-state.test.ts | 7 ++++++- packages/devtools-kit/src/core/component/state/custom.ts | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/devtools-kit/__tests__/component/decode-state.test.ts b/packages/devtools-kit/__tests__/component/decode-state.test.ts index bb366e4b3..608af8e59 100644 --- a/packages/devtools-kit/__tests__/component/decode-state.test.ts +++ b/packages/devtools-kit/__tests__/component/decode-state.test.ts @@ -1,3 +1,5 @@ +import { getObjectDetails } from '../../src/core/component/state/custom' + function omitKeysOnCustom(obj: { _custom: { [key: string]: unknown } } | undefined, keys: string[]) { return obj == null ? obj : { _custom: Object.fromEntries(Object.entries(obj._custom).filter(([key]) => !keys.includes(key))) } } @@ -68,6 +70,7 @@ it.each([ () => { const bar = computed(() => '1') const a = toRef(() => bar.value) + a.value return a }, { @@ -83,6 +86,7 @@ it.each([ () => { const bar = reactive({ value: '1' }) const a = toRef(bar, 'value') + a.value return a }, { @@ -98,6 +102,7 @@ it.each([ () => { const bar = reactive({ value: '1', value2: '2' }) const a = toRefs(bar) + a.value.value return a.value }, { @@ -109,5 +114,5 @@ it.each([ }, ], ])('should getObjectDetail by passing %s state', (_, state, expected) => { - // expect(omitKeysOnCustom(getObjectDetails(state()), ['tooltipText'])).toEqual(expected) + expect(omitKeysOnCustom(getObjectDetails(state()), ['tooltipText'])).toEqual(expected) }) diff --git a/packages/devtools-kit/src/core/component/state/custom.ts b/packages/devtools-kit/src/core/component/state/custom.ts index 8ec165ea0..e7a76b187 100644 --- a/packages/devtools-kit/src/core/component/state/custom.ts +++ b/packages/devtools-kit/src/core/component/state/custom.ts @@ -219,8 +219,8 @@ export function getHTMLElementDetails(value: HTMLElement) { } /** - * - ObjectRefImpl, toRef({ foo: 'foo' }, 'foo'), `value` is the actual value - * - GetterRefImpl, toRef(() => state.foo), `value` is the actual value + * - ObjectRefImpl, toRef({ foo: 'foo' }, 'foo'), `_value` is the actual value, (since 3.5.0) + * - GetterRefImpl, toRef(() => state.foo), `_value` is the actual value, (since 3.5.0) * - RefImpl, ref('foo') / computed(() => 'foo'), `_value` is the actual value */ function tryGetRefValue(ref: { _value?: unknown } | { value?: unknown }) { From 2d22dabcf6b04213880ab48032be24a6d830e6fe Mon Sep 17 00:00:00 2001 From: Alex <49969959+alexzhang1030@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:19:46 +0800 Subject: [PATCH 02/22] refactor(ui): remove deprecated apis (#798) --- packages/ui/src/components/DropdownButton.vue | 2 +- packages/ui/src/composables/shiki.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/DropdownButton.vue b/packages/ui/src/components/DropdownButton.vue index 0df73e193..06c9a1b9b 100644 --- a/packages/ui/src/components/DropdownButton.vue +++ b/packages/ui/src/components/DropdownButton.vue @@ -1,7 +1,7 @@