fix big-picture @element to a bare tag and stop embed-smoke reporting every error as a mount timeout
This commit is contained in:
parent
727e3ee8ad
commit
bb5fd9aed4
2 changed files with 27 additions and 2 deletions
|
|
@ -91,7 +91,22 @@ for (const t of list) {
|
|||
if (verdict.errorCard) r.why = 'ProfileLoader error card shown'
|
||||
else if (verdict.nodes < 5) r.why = `shadow DOM nearly empty (${verdict.nodes} nodes)`
|
||||
else { r.ok = true; r.why = `${verdict.nodes} nodes${verdict.canvas ? ' + canvas' : ' (no canvas — DOM profile)'}` }
|
||||
} catch (e) { r.why = 'mount timeout / ' + String(e.message || e).slice(0, 100) }
|
||||
} catch (e) {
|
||||
// ★ DO NOT COLLAPSE EVERY REJECTION INTO "mount timeout" — that is a DIAGNOSIS, and it was
|
||||
// the WRONG one. A malformed @element in the manifest made querySelector throw a SyntaxError;
|
||||
// reported as "mount timeout", it accused big-picture (tab-1 of the cap-5 SPA) of being a
|
||||
// broken plugin for as long as this suite has existed. The plugin was fine; the SELECTOR was
|
||||
// invalid. Name what actually happened and let the reader diagnose.
|
||||
const msg = String(e.message || e)
|
||||
if (/SyntaxError|is not a valid selector|failed to execute 'queryselector'/i.test(msg)) {
|
||||
r.why = `INVALID SELECTOR — @element is not a bare tag: ${JSON.stringify(t.element)} ` +
|
||||
'(fix the @element JSDoc in the bundle\'s root .vue; it is copied verbatim into manifest.json)'
|
||||
} else if (/Timeout|exceeded/i.test(msg)) {
|
||||
r.why = 'mount timeout / ' + msg.slice(0, 100)
|
||||
} else {
|
||||
r.why = 'error / ' + msg.slice(0, 100)
|
||||
}
|
||||
}
|
||||
if (errors.length && r.ok) r.why += ` · ${errors.length} pageerror(s): ${errors[0]}`
|
||||
results.push(r)
|
||||
console.log(` ${r.ok ? '✓' : '✗'} ${t.bundle}/${t.profile} <${t.element}> — ${r.why}`)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,17 @@
|
|||
*
|
||||
* @profile big-picture
|
||||
* @bundle big-picture
|
||||
* @element bp-big-picture (this composite) + bp-research-header + people-groups-grid (nested)
|
||||
* @element bp-big-picture
|
||||
*
|
||||
* ★ @element MUST BE A BARE TAG — ONE VALID CSS SELECTOR, NOTHING ELSE.
|
||||
* It was previously prose: "bp-big-picture (this composite) + bp-research-header +
|
||||
* people-groups-grid (nested)". generate-tree copies @element VERBATIM into manifest.json, and
|
||||
* consumers feed that value straight to document.querySelector(). The prose threw
|
||||
* "SyntaxError: Failed to execute 'querySelector'", which embed-smoke's catch-all reported as
|
||||
* "mount timeout" — so a DATA defect in this comment masqueraded as a BROKEN PLUGIN, on the one
|
||||
* bundle that is tab-1 of the cap-5 SPA. big-picture mounts fine; only this string was invalid.
|
||||
* Every other bundle in the repo declares a single bare tag; this was the lone outlier.
|
||||
* The nested elements are documented above and in @composes — they do not belong in @element.
|
||||
*
|
||||
* Becomes tab-1 of the Cat-5 SPA.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue