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

Function optimize

static/vuejs/vue.js:8241–8249  ·  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

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

Callers 1

baseCompileFunction · 0.70

Calls 2

markStatic$1Function · 0.70
markStaticRootsFunction · 0.70

Tested by

no test coverage detected