Skip to content

Commit 24a8309

Browse files
committedJun 16, 2024
refactor
1 parent 54d8aca commit 24a8309

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed
 

‎packages/runtime-vapor/src/component.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,6 @@ function getAttrsProxy(instance: ComponentInternalInstance): Data {
413413
))
414414
)
415415
}
416-
const classifyRE = /(?:^|[-_])(\w)/g
417-
const classify = (str: string): string =>
418-
str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '')
419416

420417
export function getComponentName(
421418
Component: Component,
@@ -454,16 +451,6 @@ export function formatComponentName(
454451
return name ? classify(name) : isRoot ? `App` : `Anonymous`
455452
}
456453

457-
/**
458-
* Dev-only
459-
*/
460-
function getSlotsProxy(instance: ComponentInternalInstance): Slots {
461-
return (
462-
instance.slotsProxy ||
463-
(instance.slotsProxy = new Proxy(instance.slots, {
464-
get(target, key: string) {
465-
return target[key]
466-
},
467-
}))
468-
)
469-
}
454+
const classifyRE = /(?:^|[-_])(\w)/g
455+
const classify = (str: string): string =>
456+
str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '')

‎packages/runtime-vapor/src/devtools.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
6060
// (#4815)
6161
typeof window !== 'undefined' &&
6262
// some envs mock window but not fully
63-
window.HTMLElement // &&
63+
window.HTMLElement &&
6464
// also exclude jsdom
65-
// !window.navigator?.userAgent?.includes('jsdom')
65+
// eslint-disable-next-line no-restricted-syntax
66+
!window.navigator?.userAgent?.includes('jsdom')
6667
) {
6768
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
6869
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [])
@@ -86,10 +87,7 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
8687
}
8788

8889
export function devtoolsInitApp(app: App, version: string) {
89-
emit(DevtoolsHooks.APP_INIT, app, version, {
90-
Text,
91-
Comment,
92-
})
90+
emit(DevtoolsHooks.APP_INIT, app, version, {})
9391
}
9492

9593
export function devtoolsUnmountApp(app: App) {

0 commit comments

Comments
 (0)