refactor: rename/re-organize files
This commit is contained in:
parent
abdaf10d88
commit
90b9884eb4
@ -1,4 +1,3 @@
|
||||
import { ComponentOptions } from '../src/component'
|
||||
import {
|
||||
h,
|
||||
TestElement,
|
||||
@ -7,9 +6,10 @@ import {
|
||||
ref,
|
||||
KeepAlive,
|
||||
serializeInner,
|
||||
nextTick
|
||||
nextTick,
|
||||
ComponentOptions
|
||||
} from '@vue/runtime-test'
|
||||
import { KeepAliveProps } from '../src/keepAlive'
|
||||
import { KeepAliveProps } from '../../src/components/KeepAlive'
|
||||
|
||||
describe('keep-alive', () => {
|
||||
let one: ComponentOptions
|
@ -2,7 +2,7 @@ import { Component, Data, validateComponentName } from './component'
|
||||
import { ComponentOptions } from './apiOptions'
|
||||
import { ComponentPublicInstance } from './componentProxy'
|
||||
import { Directive, validateDirectiveName } from './directives'
|
||||
import { RootRenderFunction } from './createRenderer'
|
||||
import { RootRenderFunction } from './renderer'
|
||||
import { InjectionKey } from './apiInject'
|
||||
import { isFunction, NO } from '@vue/shared'
|
||||
import { warn } from './warning'
|
||||
|
@ -10,7 +10,7 @@ import { warn } from './warning'
|
||||
import { capitalize } from '@vue/shared'
|
||||
import { pauseTracking, resumeTracking, DebuggerEvent } from '@vue/reactivity'
|
||||
|
||||
export { onActivated, onDeactivated } from './keepAlive'
|
||||
export { onActivated, onDeactivated } from './components/KeepAlive'
|
||||
|
||||
export function injectHook(
|
||||
type: LifecycleHooks,
|
||||
|
@ -27,7 +27,7 @@ import {
|
||||
callWithAsyncErrorHandling
|
||||
} from './errorHandling'
|
||||
import { onBeforeUnmount } from './apiLifecycle'
|
||||
import { queuePostRenderEffect } from './createRenderer'
|
||||
import { queuePostRenderEffect } from './renderer'
|
||||
|
||||
export type WatchHandler<T = any> = (
|
||||
value: T,
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
makeMap,
|
||||
isPromise
|
||||
} from '@vue/shared'
|
||||
import { SuspenseBoundary } from './suspense'
|
||||
import { SuspenseBoundary } from './rendererSuspense'
|
||||
import {
|
||||
CompilerError,
|
||||
CompilerOptions,
|
||||
|
@ -6,19 +6,19 @@ import {
|
||||
ComponentInternalInstance,
|
||||
LifecycleHooks,
|
||||
currentInstance
|
||||
} from './component'
|
||||
import { VNode, cloneVNode, isVNode } from './vnode'
|
||||
import { warn } from './warning'
|
||||
import { onBeforeUnmount, injectHook, onUnmounted } from './apiLifecycle'
|
||||
} from '../component'
|
||||
import { VNode, cloneVNode, isVNode } from '../vnode'
|
||||
import { warn } from '../warning'
|
||||
import { onBeforeUnmount, injectHook, onUnmounted } from '../apiLifecycle'
|
||||
import { isString, isArray } from '@vue/shared'
|
||||
import { watch } from './apiWatch'
|
||||
import { ShapeFlags } from './shapeFlags'
|
||||
import { SuspenseBoundary } from './suspense'
|
||||
import { watch } from '../apiWatch'
|
||||
import { ShapeFlags } from '../shapeFlags'
|
||||
import { SuspenseBoundary } from '../rendererSuspense'
|
||||
import {
|
||||
RendererInternals,
|
||||
queuePostRenderEffect,
|
||||
invokeHooks
|
||||
} from './createRenderer'
|
||||
} from '../renderer'
|
||||
|
||||
type MatchPattern = string | RegExp | string[] | RegExp[]
|
||||
|
@ -1,14 +1,18 @@
|
||||
// Public API ------------------------------------------------------------------
|
||||
|
||||
export { createComponent } from './apiCreateComponent'
|
||||
export { nextTick } from './scheduler'
|
||||
export * from './apiReactivity'
|
||||
export * from './apiWatch'
|
||||
export * from './apiLifecycle'
|
||||
export * from './apiInject'
|
||||
export { nextTick } from './scheduler'
|
||||
export { createComponent } from './apiCreateComponent'
|
||||
|
||||
// Advanced API ----------------------------------------------------------------
|
||||
|
||||
// For getting a hold of the internal instance in setup() - useful for advanced
|
||||
// plugins
|
||||
export { getCurrentInstance } from './component'
|
||||
|
||||
// For raw render function users
|
||||
export { h } from './h'
|
||||
export {
|
||||
@ -21,7 +25,7 @@ export {
|
||||
// VNode type symbols
|
||||
export { Text, Comment, Fragment, Portal, Suspense } from './vnode'
|
||||
// Internal Components
|
||||
export { KeepAlive } from './keepAlive'
|
||||
export { KeepAlive } from './components/KeepAlive'
|
||||
// VNode flags
|
||||
export { PublicShapeFlags as ShapeFlags } from './shapeFlags'
|
||||
import { PublicPatchFlags } from '@vue/shared'
|
||||
@ -40,11 +44,8 @@ export const PatchFlags = PublicPatchFlags as {
|
||||
BAIL: number
|
||||
}
|
||||
|
||||
// For advanced plugins
|
||||
export { getCurrentInstance } from './component'
|
||||
|
||||
// For custom renderers
|
||||
export { createRenderer, RootRenderFunction } from './createRenderer'
|
||||
export { createRenderer, RootRenderFunction } from './renderer'
|
||||
export { warn } from './warning'
|
||||
export {
|
||||
handleError,
|
||||
@ -94,7 +95,7 @@ export {
|
||||
} from './apiOptions'
|
||||
|
||||
export { ComponentPublicInstance } from './componentProxy'
|
||||
export { RendererOptions } from './createRenderer'
|
||||
export { RendererOptions } from './renderer'
|
||||
export { Slot, Slots } from './componentSlots'
|
||||
export {
|
||||
Prop,
|
||||
@ -110,6 +111,6 @@ export {
|
||||
FunctionDirective,
|
||||
DirectiveArguments
|
||||
} from './directives'
|
||||
export { SuspenseBoundary } from './suspense'
|
||||
export { SuspenseBoundary } from './rendererSuspense'
|
||||
|
||||
export const version = __VERSION__
|
||||
|
@ -47,11 +47,11 @@ import { ComponentPublicInstance } from './componentProxy'
|
||||
import { App, createAppAPI } from './apiApp'
|
||||
import {
|
||||
SuspenseBoundary,
|
||||
SuspenseImpl,
|
||||
Suspense,
|
||||
queueEffectWithSuspense
|
||||
} from './suspense'
|
||||
} from './rendererSuspense'
|
||||
import { ErrorCodes, callWithErrorHandling } from './errorHandling'
|
||||
import { KeepAliveSink } from './keepAlive'
|
||||
import { KeepAliveSink } from './components/KeepAlive'
|
||||
|
||||
export interface RendererOptions<HostNode = any, HostElement = any> {
|
||||
patchProp(
|
||||
@ -265,7 +265,7 @@ export function createRenderer<
|
||||
optimized
|
||||
)
|
||||
} else if (__FEATURE_SUSPENSE__ && shapeFlag & ShapeFlags.SUSPENSE) {
|
||||
;(type as typeof SuspenseImpl).process(
|
||||
;(type as typeof Suspense).process(
|
||||
n1,
|
||||
n2,
|
||||
container,
|
@ -3,13 +3,13 @@ import { ShapeFlags } from './shapeFlags'
|
||||
import { isFunction, isArray } from '@vue/shared'
|
||||
import { ComponentInternalInstance, handleSetupResult } from './component'
|
||||
import { Slots } from './componentSlots'
|
||||
import { RendererInternals } from './createRenderer'
|
||||
import { RendererInternals } from './renderer'
|
||||
import { queuePostFlushCb, queueJob } from './scheduler'
|
||||
import { updateHOCHostEl } from './componentRenderUtils'
|
||||
import { handleError, ErrorCodes } from './errorHandling'
|
||||
import { pushWarningContext, popWarningContext } from './warning'
|
||||
|
||||
export const SuspenseImpl = {
|
||||
export const Suspense = {
|
||||
__isSuspense: true,
|
||||
process(
|
||||
n1: VNode | null,
|
@ -16,9 +16,9 @@ import { RawSlots } from './componentSlots'
|
||||
import { ShapeFlags } from './shapeFlags'
|
||||
import { isReactive, Ref } from '@vue/reactivity'
|
||||
import { AppContext } from './apiApp'
|
||||
import { SuspenseBoundary } from './suspense'
|
||||
import { SuspenseBoundary } from './rendererSuspense'
|
||||
import { DirectiveBinding } from './directives'
|
||||
import { SuspenseImpl } from './suspense'
|
||||
import { Suspense as SuspenseImpl } from './rendererSuspense'
|
||||
|
||||
export const Fragment = (Symbol(__DEV__ ? 'Fragment' : undefined) as any) as {
|
||||
// type differentiator for h()
|
||||
@ -48,7 +48,7 @@ export type VNodeTypes =
|
||||
| typeof Portal
|
||||
| typeof Text
|
||||
| typeof Comment
|
||||
| typeof SuspenseImpl
|
||||
| typeof Suspense
|
||||
|
||||
export interface VNodeProps {
|
||||
[key: string]: any
|
||||
|
Loading…
Reference in New Issue
Block a user