Просмотр исходного кода

chore(runtime-vapor): reorganize imports

daiwei 1 месяц назад
Родитель
Сommit
2095d5ad4e

+ 2 - 1
packages/runtime-vapor/src/apiCreateFor.ts

@@ -13,7 +13,7 @@ import {
 } from '@vue/reactivity'
 import { isArray, isObject, isString } from '@vue/shared'
 import { createComment, createTextNode } from './dom/node'
-import { type Block, applyTransitionHooks, insert, remove } from './block'
+import { type Block, insert, remove } from './block'
 import { queuePostFlushCb, warn } from '@vue/runtime-dom'
 import { currentInstance, isVaporComponent } from './component'
 import {
@@ -41,6 +41,7 @@ import {
   isLastInsertion,
   resetInsertionState,
 } from './insertionState'
+import { applyTransitionHooks } from './transition'
 
 class ForBlock extends VaporFragment {
   scope: EffectScope | undefined

+ 0 - 8
packages/runtime-vapor/src/block.ts

@@ -329,11 +329,3 @@ export function isFragmentBlock(block: Block): boolean {
   }
   return false
 }
-
-export { setScopeId, setComponentScopeId } from './scopeId'
-
-export {
-  registerTransitionHooks,
-  applyTransitionHooks,
-  applyTransitionLeaveHooks,
-} from './transition'

+ 2 - 8
packages/runtime-vapor/src/component.ts

@@ -38,14 +38,7 @@ import {
   warn,
   warnExtraneousAttributes,
 } from '@vue/runtime-dom'
-import {
-  type Block,
-  insert,
-  isBlock,
-  remove,
-  setComponentScopeId,
-  setScopeId,
-} from './block'
+import { type Block, insert, isBlock, remove } from './block'
 import {
   type ShallowRef,
   markRaw,
@@ -124,6 +117,7 @@ import { DynamicFragment, isFragment } from './fragment'
 import type { VaporElement } from './apiDefineCustomElement'
 import { parentSuspense, setParentSuspense } from './components/Suspense'
 import { isInteropEnabled } from './vdomInteropState'
+import { setComponentScopeId, setScopeId } from './scopeId'
 
 export { currentInstance } from '@vue/runtime-dom'
 

+ 2 - 1
packages/runtime-vapor/src/componentSlots.ts

@@ -1,5 +1,5 @@
 import { EMPTY_OBJ, NO, hasOwn, isArray, isFunction } from '@vue/shared'
-import { type Block, type BlockFn, insert, setScopeId } from './block'
+import { type Block, type BlockFn, insert } from './block'
 import { rawPropsProxyHandlers, resolveFunctionSource } from './componentProps'
 import {
   type GenericComponentInstance,
@@ -28,6 +28,7 @@ import {
 import { createElement } from './dom/node'
 import { setDynamicProps } from './dom/prop'
 import { isInteropEnabled } from './vdomInteropState'
+import { setScopeId } from './scopeId'
 
 /**
  * Flag to indicate if we are executing a once slot.

+ 2 - 8
packages/runtime-vapor/src/components/Teleport.ts

@@ -15,14 +15,7 @@ import {
   setCurrentInstance,
   warn,
 } from '@vue/runtime-dom'
-import {
-  type Block,
-  type BlockFn,
-  applyTransitionHooks,
-  insert,
-  move,
-  remove,
-} from '../block'
+import { type Block, type BlockFn, insert, move, remove } from '../block'
 import {
   createComment,
   createTextNode,
@@ -51,6 +44,7 @@ import {
 } from '../dom/hydration'
 import type { DefineVaporSetupFnComponent } from '../apiDefineComponent'
 import { getScopeOwner } from '../componentSlots'
+import { applyTransitionHooks } from '../transition'
 
 const VaporTeleportImpl = {
   name: 'VaporTeleport',

+ 1 - 2
packages/runtime-vapor/src/fragment.ts

@@ -5,8 +5,6 @@ import {
   type BlockFn,
   type TransitionOptions,
   type VaporTransitionHooks,
-  applyTransitionHooks,
-  applyTransitionLeaveHooks,
   findBlockNode,
   insert,
   isValidBlock,
@@ -43,6 +41,7 @@ import {
   setCurrentKeepAliveCtx,
   withCurrentCacheKey,
 } from './components/KeepAlive'
+import { applyTransitionHooks, applyTransitionLeaveHooks } from './transition'
 
 export class VaporFragment<
   T extends Block = Block,