Loading
Add initVueApp, the dual-runtime app-bootstrap helper
What does this MR do and why?
Adds the dual-runtime app-bootstrap machinery — no call sites are converted here (the ~550-file migration follows in !247299 (merged), stacked on this MR):
initVueApp({ el, component, props, events, ... })— the declarative replacement fornew Vue({ el, render })app roots. On Vue 2 or Vue3 compat it is exactly that call, so production behavior is unchanged. On pure Vue 3 (no compat) it usescreateAppwith Vue 2 replace-mount semantics (mount_wrapper.js), per-app pinia/apollo/plugin installs, and a BootstrapVue root-bus bridge for the$root.$emit('bv::show::modal')idiom on native runtimes (under@vue/compatthe instance event emitter already provides it, so the bridge is gated off there).compatH— version-agnostichfor hand-written render functions built on the Vue 2 vnode-data shape.getSlotFunction— papers over the$scopedSlots/$slotssplit (Vue 2 and@vue/compatexpose slot functions on$scopedSlots, plain Vue 3 on$slots). Added to the pre-existingnormalize_render.js, whosenormalizeRenderkeeps its semantics unchanged.getFirstComponentChild— replacesvm.$children[0], which the compat config disables.
Also teaches the infection scanner that initVueApp( bootstraps are app roots, exactly like new Vue({ el }) ones — without this, converted bootstraps stop acting as infection barriers and their vue-ness leaks upward into every importer chain (measured: ~850 extra dual-compiled files in the island builds; with the rule the migration wave is infection-neutral, +2 files: the helpers themselves).
Stacked on !247132 (merged).
Verification
Contract specs on both jest lanes (default and VUE_VERSION=3): init_vue_app_spec.js 24/24, compat_h_spec.js 11/11, get_first_component_child_spec.js 3/3.
Edited by Illya Klymov