DEDUP-AUDIT.md (measured today: 253 files, 31 cross-plugin duplicate clusters, 622 duplicated lines) ranks this tenth by raw cost and first by suitability. It is the only cluster where the copies are identical in code, close over nothing, and sit in two plugins with one owner between them. loadScriptOnce (13 lines) and whenTagDefined (11) were byte-identical between doxa-maps-spa and plugin-studio. deriveTreeBase (9) differed by ONE COMMENT LINE and not one character of code -- drift in the documentation of a shared function, which is its own argument for having one copy. They are one concern, not three: load a bundle's script once, wait for its custom element to register, and work out the tree base to load it from. That is what a capability-5 app shell does to nest another plugin, and both plugins here ARE the capability-5 shells. Any future shell needs the same three. Verbatim move: no parameterisation, no behaviour change, callers import instead of declaring. The comments travel with the code because each records a measurement -- particularly the one explaining why onload is not a usable success signal for a dev-server ES module. ONE BEHAVIOUR CHANGE, AND IT IS AN IMPROVEMENT: the _loaded cache is now shared. Two shells on one page previously kept separate caches and each loaded the same bundle; the second now reuses the first's promise. deriveTreeBase reads document.currentScript, so it is only valid AT MODULE EVALUATION TIME. The call sites did not move -- both entries still call it at module top level -- and the library file documents the constraint, because a later call silently returns '' and every nested bundle URL would break. Verified: both bundles build; each built file contains all three functions exactly once and still derives currentScript; check:sri, check:series-isolation, check:studio-rail and check:capability-derived all PASS. library/utils/embedScript.js is the build owner's under rule 5B. The plugin-designs and public/ changes are in the same commit because they import it -- landing them apart breaks the build in between.
24 lines
1.2 KiB
HTML
24 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<!-- THIS PAGE IS OURS. The only thing that knows a document belongs to the plugin is the page
|
|
the generator writes, so it says so here. library/i18n reads it before reflecting an RTL
|
|
locale on <html dir>; nothing else sets it, so a PARTNER page defaults to "not ours" and
|
|
is never touched. Absence must mean restraint — an embedded plugin flipping a partner's
|
|
whole <html> because a reader followed a ?lang=ar link is the bug this prevents. -->
|
|
<script>window.MAP_OWNS_PAGE = true;</script>
|
|
<title>dx-maps plugin studio</title>
|
|
<link rel="icon" href="data:,">
|
|
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
|
<style>
|
|
html, body { margin: 0; padding: 0; height: 100%; background: #f3f3f1; }
|
|
plugin-studio { display: block; width: 100%; height: 100vh; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<plugin-studio tree-base="."></plugin-studio>
|
|
<script src="./plugin-studio/plugin-studio.js" integrity="sha384-hounA2cKrxqGX3ltwUElfV5XW1XSg3lOoSVUTSeOrWw1zTLzyyeR1ywb4fQ/zTsu" crossorigin="anonymous"></script>
|
|
</body>
|
|
</html>
|