Home / File/ state.ts — vue Source File

state.ts — vue Source File

Architecture documentation for state.ts, a typescript file in the vue codebase. 15 imports, 3 dependents.

File typescript CoreRuntime Instance 15 imports 3 dependents 13 functions

Entity Profile

Dependency Diagram

graph LR
  910d3a96_5984_cf85_40a3_47933bd75818["state.ts"]
  d22f3dff_cc24_705a_1193_eec206dcb1d5["config.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> d22f3dff_cc24_705a_1193_eec206dcb1d5
  acd39cb4_1b40_1f96_d7d8_00ba7dc7b283["watcher.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> acd39cb4_1b40_1f96_d7d8_00ba7dc7b283
  e7f4f452_deed_8a48_b501_c415a06a6251["Watcher"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> e7f4f452_deed_8a48_b501_c415a06a6251
  dfb2b3e1_ffba_6029_124e_b43a30f0f999["dep.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> dfb2b3e1_ffba_6029_124e_b43a30f0f999
  f3560440_54c1_5663_36f8_c7de54d7310b["lifecycle.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> f3560440_54c1_5663_36f8_c7de54d7310b
  012c0986_6b9d_ad59_8fba_57884312dd3b["index.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 012c0986_6b9d_ad59_8fba_57884312dd3b
  30a55d4c_1b7d_ce16_2a1e_1bfee103e294["set"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 30a55d4c_1b7d_ce16_2a1e_1bfee103e294
  1e8dd21f_c506_2ce7_ecf3_262154cc2d3f["del"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 1e8dd21f_c506_2ce7_ecf3_262154cc2d3f
  c50e49cd_c223_e73e_c96d_1c8391fde3c1["observe"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> c50e49cd_c223_e73e_c96d_1c8391fde3c1
  772e5b8f_95bc_3463_fed7_f1034ba985e1["defineReactive"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 772e5b8f_95bc_3463_fed7_f1034ba985e1
  2bcc88b5_db8a_b047_2abd_7382948898ab["toggleObserving"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 2bcc88b5_db8a_b047_2abd_7382948898ab
  2a298df2_21b8_7e5a_c372_51ba50c9d92d["index.ts"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 2a298df2_21b8_7e5a_c372_51ba50c9d92d
  648c881d_0a8b_2e54_833a_913760ae9a68["apiSetup"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 648c881d_0a8b_2e54_833a_913760ae9a68
  907f4994_ea28_43b1_7976_0db9f0e97637["component"]
  910d3a96_5984_cf85_40a3_47933bd75818 --> 907f4994_ea28_43b1_7976_0db9f0e97637
  style 910d3a96_5984_cf85_40a3_47933bd75818 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import config from '../config'
import Watcher from '../observer/watcher'
import Dep, { pushTarget, popTarget } from '../observer/dep'
import { isUpdatingChildComponent } from './lifecycle'
import { initSetup } from 'v3/apiSetup'

import {
  set,
  del,
  observe,
  defineReactive,
  toggleObserving
} from '../observer/index'

import {
  warn,
  bind,
  noop,
  hasOwn,
  isArray,
  hyphenate,
  isReserved,
  handleError,
  nativeWatch,
  validateProp,
  isPlainObject,
  isServerRendering,
  isReservedAttribute,
  invokeWithErrorHandling,
  isFunction
} from '../util/index'
import type { Component } from 'types/component'
import { shallowReactive, TrackOpTypes } from 'v3'

const sharedPropertyDefinition = {
  enumerable: true,
  configurable: true,
  get: noop,
  set: noop
}

export function proxy(target: Object, sourceKey: string, key: string) {
  sharedPropertyDefinition.get = function proxyGetter() {
    return this[sourceKey][key]
  }
  sharedPropertyDefinition.set = function proxySetter(val) {
    this[sourceKey][key] = val
  }
  Object.defineProperty(target, key, sharedPropertyDefinition)
}

export function initState(vm: Component) {
  const opts = vm.$options
  if (opts.props) initProps(vm, opts.props)

  // Composition API
  initSetup(vm)

  if (opts.methods) initMethods(vm, opts.methods)
  if (opts.data) {
// ... (334 more lines)

Domain

Subdomains

Frequently Asked Questions

What does state.ts do?
state.ts is a source file in the vue codebase, written in typescript. It belongs to the CoreRuntime domain, Instance subdomain.
What functions are defined in state.ts?
state.ts defines 13 function(s): createComputedGetter, createGetterInvoker, createWatcher, defineComputed, getData, initComputed, initData, initMethods, initProps, initState, and 3 more.
What does state.ts depend on?
state.ts imports 15 module(s): Watcher, apiSetup, component, config.ts, defineReactive, del, dep.ts, index.ts, and 7 more.
What files import state.ts?
state.ts is imported by 3 file(s): extend.ts, index.ts, init.ts.
Where is state.ts in the architecture?
state.ts is located at src/core/instance/state.ts (domain: CoreRuntime, subdomain: Instance, directory: src/core/instance).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free