Plugin studio: mount the element the bundle defines, not the one a profile's JSDoc names
A profile's `element` in the manifest is copied from its @element JSDoc,
and that can name a tag nothing registers. country-posters-mfe's says
<country-posters-mfe>, but country-posters' index.js defines only
<country-posters-map>, so the built studio showed "never registered"
on a working plugin (gospel-dashboard had the same shape until
5418a79c). The studio now uses a profile's element only when the
bundle's `elements` (what index.js actually registers) includes it, and
otherwise the bundle's defined element.
Across all 33 manifest profiles this is the only mismatch, and its
published embed snippet already uses the right tag. Verified on the
built tree: country-posters-mfe mounts <country-posters-map> with
content (2,025 elements).
This commit is contained in:
parent
e8bbe77822
commit
5bbbcc61f4
1 changed files with 8 additions and 1 deletions
|
|
@ -640,7 +640,14 @@ export default defineComponent({
|
|||
// never list the studio itself as one of its own tabs
|
||||
if (b.bundle === 'plugin-studio' || STUDIO_HIDDEN.has(b.bundle)) continue
|
||||
for (const p of (b.profiles || [])) {
|
||||
const tag = p.element || (b.elements && b.elements[0]) || b.bundle
|
||||
// ★ MOUNT ONLY A TAG THE BUNDLE DEFINES. A profile's `element` is copied from its @element
|
||||
// JSDoc, and that can name a tag nothing defines: country-posters-mfe's says
|
||||
// <country-posters-mfe>, while the bundle defines only <country-posters-map> (and gospel's
|
||||
// did the same until 5418a79c). Trusting it put "never registered" on a working plugin.
|
||||
// `elements` is what the bundle's index.js actually registers, so it is the authority.
|
||||
const defined = (b.elements && b.elements.length) ? b.elements : null
|
||||
const tag = (p.element && (!defined || defined.includes(p.element)) ? p.element : null)
|
||||
|| (defined && defined[0]) || p.element || b.bundle
|
||||
const cap = capFor(p.type || 'single')
|
||||
// A heavy row owns a live WebGL context, so it is torn down on deactivate rather than
|
||||
// hidden. Keyed by tag OR bundle so a bundle whose profiles differ still resolves.
|
||||
|
|
|
|||
Loading…
Reference in a new issue