utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | 5bf78e316b3ccfb589a7c6b08c04c1cf21e94d14d4264c830614a2461735ff67 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 22:07 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-12 09:38 +02:00 |
| Parents | 9a38018bfc74 |
3 files changed
modified README.md +5 −3
| @@ -154,9 +154,11 @@ | ||
| 154 | 154 | `ide.js`: the palette list, the preview gate and the list of open tabs); with level 1 |
| 155 | 155 | extensions only, the same files and 4.4 KB more (the hooks in `js/ext/host.js` and |
| 156 | 156 | `store.js` that decide when to load `js/ext2/host2.js`); with the Extensions panel open |
| 157 | - and a search done, the same files and 19.8 KB more (what the panel now tells everyone: | |
| 158 | - what will work, the Works in Code filter, how extensions are isolated, the check before | |
| 159 | - Install). In none of these is anything fetched from `vendor/x2/`, `js/ext2/` or the | |
| 157 | + and a search done, the same files and 20,430 bytes more, within the suite's 20 KB budget | |
| 158 | + (what the panel now tells everyone: what will work, the Works in Code filter, how | |
| 159 | + extensions are isolated, the check before Install, which for a result that applies | |
| 160 | + without code loads nothing of level 2). In none of these is anything fetched from | |
| 161 | + `vendor/x2/`, `js/ext2/` or the | |
| 160 | 162 | sandbox site. Once code is on, the runtime is 2.6 MB gzip (from the manifest), fetched |
| 161 | 163 | once and then served from the HTTP cache. `?noext` pauses every extension, `?noext2` only |
| 162 | 164 | their code, `"enabled": false` in the manifest is a global kill switch, and the panel can |
modified tests/x2_ux.mjs +7 −0
| @@ -232,10 +232,17 @@ | ||
| 232 | 232 | const { ctx, page } = await profile(); |
| 233 | 233 | const log = []; |
| 234 | 234 | ctx.on('request', r => { if (/open-vsx\.org/.test(r.url())) log.push(r.method() + ' ' + new URL(r.url()).pathname); }); |
| 235 | + const l2 = []; | |
| 236 | + page.on('request', r => { if (/\/js\/ext2\//.test(r.url())) l2.push(new URL(r.url()).pathname); }); | |
| 235 | 237 | await openIde(page); |
| 236 | 238 | await panel(page); |
| 237 | 239 | await search(page, 'elffuss-ux'); |
| 238 | 240 | await until(async () => (await page.locator('#ext-results .ext-row').count()) === fixtures.length); |
| 241 | + // un tema: su manifiesto dice que algo se aplica y se instala sin cargar nada del nivel 2 | |
| 242 | + await row(page, 'elffuss-ux.decl').locator('.ext-install').click(); | |
| 243 | + const declMsg = await until(() => page.evaluate(() => document.getElementById('ext-msg')?.textContent || null)); | |
| 244 | + ok('X1b Install on a theme reads its manifest and goes on to install it, without loading anything of level 2', l2.length === 0 && log.some(l => /elffuss-ux\/decl\/1\.0\.0\/file\/package\.json$/.test(l)) && !!declMsg, | |
| 245 | + JSON.stringify({ l2, declMsg })); | |
| 239 | 246 | await row(page, 'elffuss-ux.webok').locator('.ext-install').click(); |
| 240 | 247 | const after = await until(() => page.evaluate(() => { |
| 241 | 248 | const r = [...document.querySelectorAll('#ext-results .ext-row')].find(x => x.dataset.id === 'elffuss-ux.webok'); |
modified web/js/ext/panel.js +6 −4
| @@ -507,15 +507,17 @@ | ||
| 507 | 507 | } catch (e) { det.replaceChildren(el('div', 'ext-ignored', textoError(e))); } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | -// «Instalar» sin detalle visto: su manifiesto antes que el .vsix; si solo | |
| 511 | -// trae código, la fila enseña su botón de código, con el foco | |
| 510 | +// «Instalar» sin detalle visto: su manifiesto antes que el .vsix (si algo se | |
| 511 | +// aplica, sin cargar el nivel 2); si solo trae código, su botón, con el foco | |
| 512 | 512 | async function antesDeInstalar(it) { |
| 513 | 513 | if (!estado.cls.get(clave(it))) { |
| 514 | 514 | try { |
| 515 | 515 | const ovsx = await import('./openvsx.js'); |
| 516 | - const manifest = await ovsx.manifest(await ovsx.metadata(it.namespace, it.name, it.version)); | |
| 516 | + const man = await ovsx.manifest(await ovsx.metadata(it.namespace, it.name, it.version)); | |
| 517 | + const a = (await import('./vsix.js')).analyzeManifest(man); | |
| 518 | + if (resumen({ ...a, themes: a.applies.themes }).any) return true; | |
| 517 | 519 | m2 ??= await gestor(); |
| 518 | - estado.cls.set(clave(it), (await m2.describe(manifest, { installedIds: new Set(host.list().map(e => e.id)), host })).cls); | |
| 520 | + estado.cls.set(clave(it), (await m2.describe(man, { installedIds: new Set(host.list().map(e => e.id)), host })).cls); | |
| 519 | 521 | } catch { return true; } |
| 520 | 522 | } |
| 521 | 523 | if (estado.cls.get(clave(it)).hasDeclarative) return true; |