Centralize libs base path and unify library loading across frontend
I maintainer di solito rispondono entro 1 giorno
@erseco ci sta già lavorando.
Dal 22/6/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Background
Several places in the frontend independently resolve the path to vendored libraries under public/libs/ and load scripts in slightly different ways. This is a small but real source of duplication, and it makes it harder to land cross-cutting work like #1593 (which is removing committed vendor artifacts and rebuilding them from Bun dependencies).
This issue tracks the cleanup so that both concerns — where public/libs/ lives at runtime and how a module pulls a script from it — share a single, reusable surface.
Motivation
This came out of the slide iDevice hotfix #1850, where @ignacigros pointed out that the bridge's loadScript and resolveLibsBase helpers look like things that probably belong in a shared place. Two related complaints in the same area:
public/preview-sw.jshardcodes/libs/pdfjs/pdf.min.mjsand/libs/pdfjs/pdf.worker.min.mjs.public/files/perm/idevices/base/slide/edition/slide.jsderives/libs/from its own iDevice path via a localresolveLibsBase()helper (slide.js:64).eXe.app.loadScriptinpublic/app/workarea/project/idevices/idevicesEngine.js:2772exists but is workarea-only, callback-style, and unconditionally appends?t=${Date.now()}cache-busting — making it unsuitable as-is for large vendored libs (Fabric ~330 KB, DOMPurify ~22 KB) that we want the browser to cache across iDevice opens.
PR #1593 ("Removed bundled libraries and generate from package.json dependencies") is directly complementary: it changes how vendored files arrive into public/libs/ at build time. Centralizing how runtime code consumes them removes friction for that effort, and avoids new ad-hoc path resolvers landing in parallel.
Proposed scope
-
Centralize the libs base URL. Expose something like
eXe.app.paths.libs(orwindow.eXeLearning.paths.libs), seeded once from the same place that knowsBASE_PATH. Replace the local resolvers in:public/preview-sw.jspublic/files/perm/idevices/base/slide/edition/slide.js(resolveLibsBase)- any other call site found during the work.
-
Provide a Promise-based, cache-friendly
loadScript(or reworkeXe.app.loadScript) that:- returns a Promise (so callers can chain dependencies cleanly),
- does not cache-bust by default — opt-in via a flag, so vendored singletons (fabric, dompurify, …) benefit from the browser cache across opens,
- keeps the existing tag-tracking / cleanup behavior for one-shot scripts,
- degrades gracefully when
eXe.appis not available (e.g. iDevice running in the static editor / embedding host / unit tests).
-
Migrate existing call sites (slide iDevice bridge first) once both pieces are in place.
Out of scope
- Refactoring
eXe.app.loadScriptconsumers outside iDevices in this issue. - Changing the runtime asset layout — that's #1593's territory.
References
- PR #1850 — slide iDevice hotfix that surfaced the suggestion.
- PR #1593 — removes committed vendor artifacts and generates them from Bun dependencies; complementary to this work.
public/app/workarea/project/idevices/idevicesEngine.js:2772— currentloadScript.public/files/perm/idevices/base/slide/edition/slide.js:64— currentresolveLibsBase.public/preview-sw.js— hardcoded/libs/pdfjs/...paths.
- Lingua principale
- JavaScript
- Stelle
- 145
- Fork
- 33
- Merge medio
- 3g 14h
- PR unite (30g)
- 93
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di exelearning/exelearning
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
exelearning/exelearning#2677 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
exelearning/exelearning#2497 ·
I maintainer di solito rispondono entro 1 giorno
-
Mermaid: long node labels are cut off in Chrome and Edge at some zoom levels, and the cut is saved in previews and exportsForse già presa @erseco l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
exelearning/exelearning#2490 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
exelearning/exelearning#2455 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
non-english
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
exelearning/exelearning#2448 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di exelearning/exelearning
Issue simili
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validationForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
cncf/endusers#2006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
check:passed feeds:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
all-contributors/cli#587 ·
I maintainer di solito rispondono entro 1 giorno
-
RGAA5
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 8 giorni
-
feedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
githubnext/gh-aw-workshop#5157 ·
I maintainer di solito rispondono entro 1 giorno