TestCoreScriptBudget was red on main since4436b7d98(Make first under Smart, CryptoSarom on X), which added 1,080 bytes to app.js and took the core's scripts to 1,534,166, 364 over 1,533,802 (its parent was at 1,533,086). The budget is not raised (LESSONS: a budget raised whenever a change reaches it bounds nothing); code that only runs when a dialog opens moves out instead: - Settings > About's Open-source licenses dialog (showNotices) is now notices.js, imported when View is pressed. - Sync's Restore from the server and Upload asks (askRestore, askUpload) join Sync's forms in syncfiles.js; syncFile imports it for them when pressed, and an import that fails says so in the status line. app.js is 1,307,923 bytes (was 1,311,541) and the core 1,530,548, 3,254 under its budget. old-webkit's list of lazily loaded files names notices.js; the budget's comment records this. Run on mote at this tree (on origin/mained0ab567c): - gofmt -l internal/gui: nothing; node --check app.js, notices.js, syncfiles.js: ok. - go test -tags nogui -run TestCoreScriptBudget ./internal/gui: PASS (red ated0ab567c, per #5720). - go test -tags nogui -timeout 45m ./internal/gui: ok (80.9s). - node --test, chromium and webkit, every language and width the files have: about-notices, old-webkit, i18n-keys, auto-backup, github-sync, s3-sync and every sync-*.test.cjs: 210 of 212 pass. sync-auto-restore and sync-not-backup press Restore and Upload through the new import; about-notices opens the licenses. The 2 reds are red the same way at origin/mained0ab567cin a clean worktree, alone: i18n-keys "a plugin's words are its own" (#5332, #5426, #5482) and s3-sync webkit en "picking S3 must not scroll the page", 3 of 3 (#3413); both commented there. Not tried: the real app; the whole GUI suite.
20 lines
775 B
JavaScript
20 lines
775 B
JavaScript
// Settings › About's Open-source licenses: THIRD_PARTY_NOTICES, which
|
||
// every build carries. app.js imports this when View is pressed
|
||
// (showNotices), so it weighs nothing on the core (#5720).
|
||
window.noticesSheet = async function () {
|
||
let text;
|
||
try { text = (await api("notices")).text; } catch (e) { statusErr(e); return; }
|
||
const ed = el("div", "editor wide notices");
|
||
const head = el("div", "ehead");
|
||
head.append(el("b", "", t("Open-source licenses")));
|
||
const bar = el("div", "bar");
|
||
const ok = el("button", "text primary", t("Done"));
|
||
ok.onclick = cancelAsk;
|
||
bar.append(el("span", "grow"), ok);
|
||
ed.append(head, el("pre", "notices-text", text), bar);
|
||
confirmAsk = ed;
|
||
openModal(ed);
|
||
$("#modal").classList.add("lib");
|
||
ok.focus(NO_SCROLL);
|
||
}
|