MCPcopy Create free account
hub / github.com/TruthHun/BookStack / optimize

Function optimize

static/vuejs/vue.esm.js:8245–8253  ·  view source on GitHub ↗

* Goal of the optimizer: walk the generated template AST tree * and detect sub-trees that are purely static, i.e. parts of * the DOM that never needs to change. * * Once we detect these sub-trees, we can: * * 1. Hoist them into constants, so that we no longer need to * create fresh nodes f

(root, options)

Source from the content-addressed store, hash-verified

8243 * 2. Completely skip them in the patching process.
8244 */
8245function optimize (root, options) {
8246 if (!root) { return }
8247 isStaticKey = genStaticKeysCached(options.staticKeys || '');
8248 isPlatformReservedTag = options.isReservedTag || no;
8249 // first pass: mark all non-static nodes.
8250 markStatic$1(root);
8251 // second pass: mark static roots.
8252 markStaticRoots(root, false);
8253}
8254
8255function genStaticKeys$1 (keys) {
8256 return makeMap(

Callers 1

baseCompileFunction · 0.70

Calls 2

markStatic$1Function · 0.70
markStaticRootsFunction · 0.70

Tested by

no test coverage detected