From 5d15314c4ec78ab30aa34eef047751eaed3abac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 16 Mar 2024 03:32:16 +0800 Subject: [PATCH] refactor(runtime-vapor): remove created & beforeCreate hooks --- packages/runtime-vapor/src/apiLifecycle.ts | 2 -- packages/runtime-vapor/src/component.ts | 16 ---------------- packages/runtime-vapor/src/errorHandling.ts | 2 -- 3 files changed, 20 deletions(-) diff --git a/packages/runtime-vapor/src/apiLifecycle.ts b/packages/runtime-vapor/src/apiLifecycle.ts index dd81a686c..e0df48ed2 100644 --- a/packages/runtime-vapor/src/apiLifecycle.ts +++ b/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', diff --git a/packages/runtime-vapor/src/component.ts b/packages/runtime-vapor/src/component.ts index 87488a05a..60f9fd298 100644 --- a/packages/runtime-vapor/src/component.ts +++ b/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 */ diff --git a/packages/runtime-vapor/src/errorHandling.ts b/packages/runtime-vapor/src/errorHandling.ts index 215bb40cc..d3ba3cd7c 100644 --- a/packages/runtime-vapor/src/errorHandling.ts +++ b/packages/runtime-vapor/src/errorHandling.ts @@ -39,8 +39,6 @@ export type ErrorTypes = export const ErrorTypeStrings: Record = { // [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',