refactor(runtime-core): remove need for internal instance sink

This commit is contained in:
Evan You
2020-04-16 10:09:13 -04:00
parent 4d014dc3d3
commit 24e5ab33f5
5 changed files with 39 additions and 38 deletions

View File

@@ -143,6 +143,11 @@ export interface ComponentInternalInstance {
attrs: Data
slots: InternalSlots
proxy: ComponentPublicInstance | null
// The target object for the public instance proxy. In dev mode, we also
// define getters for all known instance properties on it so it can be
// properly inspected in the console. These getters are skipped in prod mode
// for performance. In addition, any user attached properties
// (via `this.x = ...`) are also stored on this object.
proxyTarget: ComponentPublicProxyTarget
// alternative proxy used only for runtime-compiled render functions using
// `with` block
@@ -156,9 +161,6 @@ export interface ComponentInternalInstance {
asyncDep: Promise<any> | null
asyncResolved: boolean
// storage for any extra properties
sink: { [key: string]: any }
// lifecycle
isMounted: boolean
isUnmounted: boolean
@@ -230,10 +232,6 @@ export function createComponentInstance(
asyncDep: null,
asyncResolved: false,
// user namespace for storing whatever the user assigns to `this`
// can also be used as a wildcard storage for ad-hoc injections internally
sink: {},
// lifecycle hooks
// not using enums here because it results in computed properties
isMounted: false,