// Patch flags are optimization hints generated by the compiler. // when a block with dynamicChildren is encountered during diff, the algorithm // enters "optimized mode". In this mode, we know that the vdom is produced by // a render function generated by the compiler, so the algorithm only needs to // handle updates explicitly marked by these patch flags. // Patch flags can be combined using the | bitwise operator and can be checked // using the & operator, e.g. // // const flag = TEXT | CLASS // if (flag & TEXT) { ... } // Indicates an element with dynamic textContent (children fast path) export const TEXT = 1 // Indicates an element with dynamic class export const CLASS = 1 << 1 // Indicates an element with dynamic style export const STYLE = 1 << 2 // Indicates an element that has non-class/style dynamic props. // Can also be on a component that has any dynamic props (includes class/style). // when this flag is present, the vnode also has a dynamicProps array that // contains the keys of the props that may change so the runtime can diff // them faster (without having to worry about removed props) export const PROPS = 1 << 3 // Indicates a fragment or element with keyed or partially-keyed v-for children export const KEYED = 1 << 4 // Indicates a fragment or element that contains unkeyed v-for children export const UNKEYED = 1 << 5 // Indicates a component with dynamic slot (e.g. slot that references a v-for // iterated value). Components with this flag are always force updated. export const SLOTS = 1 << 6