refactor(runtime-shared): move `Data`

This commit is contained in:
三咲智子 Kevin Deng 2024-05-11 23:14:26 +08:00
parent 7cd70505d5
commit 639c847c0c
No known key found for this signature in database
21 changed files with 28 additions and 31 deletions

View File

@ -11,7 +11,8 @@ import {
openBlock,
transformVNodeArgs,
} from '../src/vnode'
import { type Data, PatchFlags, ShapeFlags } from '@vue/shared'
import { PatchFlags, ShapeFlags } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { h, isReactive, reactive, ref, setBlockTracking, withCtx } from '../src'
import { createApp, nodeOps, serializeInner } from '@vue/runtime-test'
import { setCurrentRenderingInstance } from '../src/componentRenderContext'

View File

@ -21,7 +21,8 @@ import { warn } from './warning'
import { type VNode, cloneVNode, createVNode } from './vnode'
import type { RootHydrateFunction } from './hydration'
import { devtoolsInitApp, devtoolsUnmountApp } from './devtools'
import { type Data, NO, extend, isFunction, isObject } from '@vue/shared'
import { NO, extend, isFunction, isObject } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { version } from '.'
import { installAppCompatProperties } from './compat/global'
import type { NormalizedPropsOptions } from './componentProps'

View File

@ -1,4 +1,5 @@
import { type Data, isArray } from '@vue/shared'
import { isArray } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { inject } from '../apiInject'
import type { ComponentInternalInstance } from '../component'
import {

View File

@ -1,5 +1,4 @@
import {
type Data,
ShapeFlags,
extend,
hyphenate,
@ -11,6 +10,7 @@ import {
normalizeStyle,
toHandlerKey,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import type {
Component,
ComponentInternalInstance,

View File

@ -60,7 +60,6 @@ import {
normalizeEmitsOptions,
} from './componentEmits'
import {
type Data,
EMPTY_OBJ,
type IfAny,
NOOP,
@ -73,6 +72,7 @@ import {
isPromise,
makeMap,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import type { SuspenseBoundary } from './components/Suspense'
import type { CompilerOptions } from '@vue/compiler-core'
import { markAttrsAccessed } from './componentRenderUtils'

View File

@ -8,7 +8,6 @@ import {
currentInstance,
} from './component'
import {
type Data,
type LooseRequired,
NOOP,
type Prettify,
@ -19,6 +18,7 @@ import {
isPromise,
isString,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { type Ref, getCurrentScope, isRef, traverse } from '@vue/reactivity'
import { computed } from './apiComputed'
import {

View File

@ -6,7 +6,6 @@ import {
trigger,
} from '@vue/reactivity'
import {
type Data,
EMPTY_ARR,
EMPTY_OBJ,
type IfAny,
@ -25,6 +24,7 @@ import {
makeMap,
toRawType,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { warn } from './warning'
import {
type ComponentInternalInstance,

View File

@ -11,7 +11,6 @@ import {
instanceWatch,
} from './apiWatch'
import {
type Data,
EMPTY_OBJ,
type IfAny,
NOOP,
@ -23,6 +22,7 @@ import {
isGloballyAllowed,
isString,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import {
ReactiveFlags,
type ShallowUnwrapRef,

View File

@ -14,13 +14,8 @@ import {
normalizeVNode,
} from './vnode'
import { ErrorCodes, handleError } from './errorHandling'
import {
type Data,
PatchFlags,
ShapeFlags,
isModelListener,
isOn,
} from '@vue/shared'
import { PatchFlags, ShapeFlags, isModelListener, isOn } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { warn } from './warning'
import { isHmrUpdating } from './hmr'
import type { NormalizedProps } from './componentProps'

View File

@ -12,12 +12,8 @@ return withDirectives(h(comp), [
*/
import type { VNode } from './vnode'
import {
type Data,
EMPTY_OBJ,
isBuiltInDirective,
isFunction,
} from '@vue/shared'
import { EMPTY_OBJ, isBuiltInDirective, isFunction } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { warn } from './warning'
import { type ComponentInternalInstance, getExposeProxy } from './component'
import { currentRenderingInstance } from './componentRenderContext'

View File

@ -12,7 +12,8 @@ import {
isVNode,
openBlock,
} from '../vnode'
import { type Data, PatchFlags, SlotFlags } from '@vue/shared'
import { PatchFlags, SlotFlags } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { warn } from '../warning'
import { createVNode } from '@vue/runtime-core'
import { isAsyncWrapper } from '../apiAsyncComponent'

View File

@ -26,7 +26,6 @@ import {
updateHOCHostEl,
} from './componentRenderUtils'
import {
type Data,
EMPTY_ARR,
EMPTY_OBJ,
NOOP,
@ -37,6 +36,7 @@ import {
isArray,
isReservedProp,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import {
type SchedulerFactory,
type SchedulerJob,

View File

@ -1,5 +1,4 @@
import {
type Data,
EMPTY_ARR,
PatchFlags,
ShapeFlags,
@ -13,6 +12,7 @@ import {
normalizeClass,
normalizeStyle,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import {
type ClassComponent,
type Component,

View File

@ -4,7 +4,8 @@ import {
type ConcreteComponent,
formatComponentName,
} from './component'
import { type Data, isFunction, isString } from '@vue/shared'
import { isFunction, isString } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { isRef, pauseTracking, resetTracking, toRaw } from '@vue/reactivity'
import { ErrorCodes, callWithErrorHandling } from './errorHandling'

View File

@ -1 +1,2 @@
export { toHandlers } from './toHandlers'
export { type Data } from './typeUtils'

View File

@ -0,0 +1 @@
export type Data = Record<string, unknown>

View File

@ -26,7 +26,7 @@ import {
import { VaporLifecycleHooks } from './apiLifecycle'
import { warn } from './warning'
import { type AppContext, createAppContext } from './apiCreateVaporApp'
import type { Data } from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
export type Component = FunctionalComponent | ObjectComponent

View File

@ -1,5 +1,6 @@
import { type Data, remove } from '@vue/shared'
import { remove } from '@vue/shared'
import type { DelegatedHandler } from './dom/event'
import type { Data } from '@vue/runtime-shared'
export enum MetadataKind {
prop,

View File

@ -1,5 +1,4 @@
import {
type Data,
EMPTY_ARR,
EMPTY_OBJ,
camelize,
@ -9,6 +8,7 @@ import {
isArray,
isFunction,
} from '@vue/shared'
import type { Data } from '@vue/runtime-shared'
import { shallowReactive } from '@vue/reactivity'
import { warn } from './warning'
import {

View File

@ -1,5 +1,4 @@
import {
type Data,
includeBooleanAttr,
isArray,
isFunction,
@ -18,6 +17,7 @@ import {
recordPropMetadata,
} from '../componentMetadata'
import { on } from './event'
import type { Data } from '@vue/runtime-shared'
export function setClass(el: Element, value: any) {
const prev = recordPropMetadata(el, 'class', (value = normalizeClass(value)))

View File

@ -22,8 +22,6 @@ export type Awaited<T> = T extends null | undefined
: never // the argument to `then` was not callable
: T // non-object or non-thenable
export type Data = Record<string, unknown>
/**
* Utility for extracting the parameters from a function overload (for typed emits)
* https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709