瀏覽代碼

refactor(runtime-vapor): remove created & beforeCreate hooks

三咲智子 Kevin Deng 2 年之前
父節點
當前提交
5d15314c4e

+ 0 - 2
packages/runtime-vapor/src/apiLifecycle.ts

@@ -9,8 +9,6 @@ import { ErrorTypeStrings, callWithAsyncErrorHandling } from './errorHandling'
 import { toHandlerKey } from '@vue/shared'
 
 export enum VaporLifecycleHooks {
-  BEFORE_CREATE = 'bc',
-  CREATED = 'c',
   BEFORE_MOUNT = 'bm',
   MOUNTED = 'm',
   BEFORE_UPDATE = 'bu',

+ 0 - 16
packages/runtime-vapor/src/component.ts

@@ -69,14 +69,6 @@ export interface ComponentInternalInstance {
   isUnmounted: boolean
   isUpdating: boolean
   // TODO: registory of provides, lifecycles, ...
-  /**
-   * @internal
-   */
-  [VaporLifecycleHooks.BEFORE_CREATE]: LifecycleHook
-  /**
-   * @internal
-   */
-  [VaporLifecycleHooks.CREATED]: LifecycleHook
   /**
    * @internal
    */
@@ -186,14 +178,6 @@ export const createComponentInstance = (
     isUnmounted: false,
     isUpdating: false,
     // TODO: registory of provides, appContext, lifecycles, ...
-    /**
-     * @internal
-     */
-    [VaporLifecycleHooks.BEFORE_CREATE]: null,
-    /**
-     * @internal
-     */
-    [VaporLifecycleHooks.CREATED]: null,
     /**
      * @internal
      */

+ 0 - 2
packages/runtime-vapor/src/errorHandling.ts

@@ -39,8 +39,6 @@ export type ErrorTypes =
 
 export const ErrorTypeStrings: Record<ErrorTypes, string> = {
   // [VaporLifecycleHooks.SERVER_PREFETCH]: 'serverPrefetch hook',
-  [VaporLifecycleHooks.BEFORE_CREATE]: 'beforeCreate hook',
-  [VaporLifecycleHooks.CREATED]: 'created hook',
   [VaporLifecycleHooks.BEFORE_MOUNT]: 'beforeMount hook',
   [VaporLifecycleHooks.MOUNTED]: 'mounted hook',
   [VaporLifecycleHooks.BEFORE_UPDATE]: 'beforeUpdate hook',