]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: rename/re-organize files
authorEvan You <yyx990803@gmail.com>
Sat, 2 Nov 2019 16:18:35 +0000 (12:18 -0400)
committerEvan You <yyx990803@gmail.com>
Sat, 2 Nov 2019 16:18:35 +0000 (12:18 -0400)
12 files changed:
packages/runtime-core/__tests__/components/KeepAlive.spec.ts [moved from packages/runtime-core/__tests__/keepAlive.spec.ts with 99% similarity]
packages/runtime-core/src/apiApp.ts
packages/runtime-core/src/apiLifecycle.ts
packages/runtime-core/src/apiWatch.ts
packages/runtime-core/src/component.ts
packages/runtime-core/src/components/KeepAlive.ts [moved from packages/runtime-core/src/keepAlive.ts with 95% similarity]
packages/runtime-core/src/index.ts
packages/runtime-core/src/renderer.ts [moved from packages/runtime-core/src/createRenderer.ts with 99% similarity]
packages/runtime-core/src/rendererSuspense.ts [moved from packages/runtime-core/src/suspense.ts with 99% similarity]
packages/runtime-core/src/vnode.ts
packages/runtime-dom/src/components/Transition.ts [moved from packages/runtime-dom/src/components/transition-group.ts with 100% similarity]
packages/runtime-dom/src/components/TransitionGroup.ts [moved from packages/runtime-dom/src/components/transition.ts with 100% similarity]

similarity index 99%
rename from packages/runtime-core/__tests__/keepAlive.spec.ts
rename to packages/runtime-core/__tests__/components/KeepAlive.spec.ts
index d7af1b334a0b27117f32695c33ae15a2835a7840..ef15b7f4bd86ec02039141ad2a3eabb2598c936f 100644 (file)
@@ -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
index 20c6521317dec107d74c5b173e6dbbf81bf09ede..e431945c78ac27f87b563b498964f8dab078c4a2 100644 (file)
@@ -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'
index 18de3e2cc5af81eef18033a1f6367c6e3ccff241..1bab9ca9576e076738f38513113b3bf726e6379b 100644 (file)
@@ -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,
index 8abe22ee93dfb152b0a5d976be518132f483c0ca..2673b8dccc7bbc2fafc63d2bfd0682d7f565c2a2 100644 (file)
@@ -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,
index ea554144a76c9ee92dd4d59c8ead809472bf54ad..621f95bcd9e587a816f7bc96bdd812b4867a2e4d 100644 (file)
@@ -25,7 +25,7 @@ import {
   makeMap,
   isPromise
 } from '@vue/shared'
-import { SuspenseBoundary } from './suspense'
+import { SuspenseBoundary } from './rendererSuspense'
 import {
   CompilerError,
   CompilerOptions,
similarity index 95%
rename from packages/runtime-core/src/keepAlive.ts
rename to packages/runtime-core/src/components/KeepAlive.ts
index 27b20a4cc3cef36446123883cdc46488aaa7b14e..6b4618fdb6ea05d07eb32daa6f360474c0361a7e 100644 (file)
@@ -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[]
 
index c51b1f2663788016b4231147e575401a44a8e093..e09d17e7fbf54b2ddb626e8323b61424bb1d869e 100644 (file)
@@ -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__
similarity index 99%
rename from packages/runtime-core/src/createRenderer.ts
rename to packages/runtime-core/src/renderer.ts
index 7cd7f23ded8e8ca02cd2c356418ee20a229e5486..2d6d5d5a5541dd1c5543c7466623d6bf83988e57 100644 (file)
@@ -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,
similarity index 99%
rename from packages/runtime-core/src/suspense.ts
rename to packages/runtime-core/src/rendererSuspense.ts
index 1494d241caa58f996ceaa65188b891070f07dab3..ab39a5ea76c04fa78890659fdc1864d3debb6cbe 100644 (file)
@@ -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,
index 1f6d904038b5646cf7f0be025f54a9581f7cbf98..1eecd0303fcdd4476980ffa939f046cd6098e20b 100644 (file)
@@ -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