Skip to content

Commit 0f8ba7e

Browse files
docs(glossary): update "hoisting" and "cache static" (#3182)
1 parent 23118c9 commit 0f8ba7e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/glossary/index.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,16 @@ The term *hoisting* is used to describe running a section of code before it is r
153153

154154
JavaScript uses hoisting for some constructs, such as `var`, `import` and function declarations.
155155

156-
In a Vue context, the template compiler applies *static hoisting* to improve performance. When converting a template to a render function, VNodes that correspond to static content can be created once and then reused. These static VNodes are described as hoisted because they are created outside the render function, before it runs. A similar form of hoisting is applied to static objects or arrays that are generated by the template compiler.
156+
In a Vue context, the compiler applies *hoisting* to improve performance. When compiling a component, static values are moved out of the component's scope. These static values are described as 'hoisted' because they are created outside the component.
157+
158+
## cache static {#cache-static}
159+
160+
The term *cache* is used to describe the temporary storage of frequently accessed data to improve performance.
161+
162+
The Vue template compiler identifies those static VNodes, caches them during the initial render, and reuses the same VNodes for every subsequent re-render.
157163

158164
For more details see:
159-
- [Guide - Rendering Mechanism - Static Hoisting](/guide/extras/rendering-mechanism.html#static-hoisting)
165+
- [Guide - Rendering Mechanism - Cache Static](/guide/extras/rendering-mechanism.html#cache-static)
160166

161167
## in-DOM template {#in-dom-template}
162168

0 commit comments

Comments
 (0)