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

Function optimize

static/vuejs/vue.common.js:8247–8255  ·  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

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

Callers 1

baseCompileFunction · 0.70

Calls 2

markStatic$1Function · 0.70
markStaticRootsFunction · 0.70

Tested by

no test coverage detected