MCPcopy
hub / github.com/vuejs/core / process

Function process

packages/runtime-core/src/components/Suspense.ts:77–133  ·  view source on GitHub ↗
(
    n1: VNode | null,
    n2: VNode,
    container: RendererElement,
    anchor: RendererNode | null,
    parentComponent: ComponentInternalInstance | null,
    parentSuspense: SuspenseBoundary | null,
    namespace: ElementNamespace,
    slotScopeIds: string[] | null,
    optimized: boolean,
    // platform-specific impl passed from renderer
    rendererInternals: RendererInternals,
  )

Source from the content-addressed store, hash-verified

75 // internals.
76 __isSuspense: true,
77 process(
78 n1: VNode | null,
79 n2: VNode,
80 container: RendererElement,
81 anchor: RendererNode | null,
82 parentComponent: ComponentInternalInstance | null,
83 parentSuspense: SuspenseBoundary | null,
84 namespace: ElementNamespace,
85 slotScopeIds: string[] | null,
86 optimized: boolean,
87 // platform-specific impl passed from renderer
88 rendererInternals: RendererInternals,
89 ): void {
90 if (n1 == null) {
91 mountSuspense(
92 n2,
93 container,
94 anchor,
95 parentComponent,
96 parentSuspense,
97 namespace,
98 slotScopeIds,
99 optimized,
100 rendererInternals,
101 )
102 } else {
103 // #8678 if the current suspense needs to be patched and parentSuspense has
104 // not been resolved. this means that both the current suspense and parentSuspense
105 // need to be patched. because parentSuspense's pendingBranch includes the
106 // current suspense, it will be processed twice:
107 // 1. current patch
108 // 2. mounting along with the pendingBranch of parentSuspense
109 // it is necessary to skip the current patch to avoid multiple mounts
110 // of inner components.
111 if (
112 parentSuspense &&
113 parentSuspense.deps > 0 &&
114 !n1.suspense!.isInFallback
115 ) {
116 n2.suspense = n1.suspense!
117 n2.suspense.vnode = n2
118 n2.el = n1.el
119 return
120 }
121 patchSuspense(
122 n1,
123 n2,
124 container,
125 anchor,
126 parentComponent,
127 namespace,
128 slotScopeIds,
129 optimized,
130 rendererInternals,
131 )
132 }
133 },
134 hydrate: hydrateSuspense as typeof hydrateSuspense,

Callers

nothing calls this directly

Calls 2

mountSuspenseFunction · 0.85
patchSuspenseFunction · 0.85

Tested by

no test coverage detected