tracker
All repositories: gitoria
1.7 KB
// tracker#46 gate: the person page's per-request code (components/person.hl, people.hl `filmographyOf`, `personInfoOf`) must not// fetch a title's whole record per credit (showsTable.fetch / showById / liveShowOf: 311 decoded records for Tom Hanks per// request, which fed the byte-triggered GC) nor scan a table (find / iterate). It reads the slim `creditRowLive` cache.// usage: node tests/person-lookup.mjs [tree] (default: the tree of this file)import { readFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';const root = resolve(process.argv[2] ?? resolve(dirname(fileURLToPath(import.meta.url)), '..'));const people = readFileSync(root + '/lib/people.hl', 'utf8');const comp = readFileSync(root + '/components/person.hl', 'utf8');const body = (src, name) => {const i = src.indexOf('static ' + name + ' = ');if (i < 0) throw new Error('no ' + name);const m = src.indexOf('\nstatic ', i + 10);return src.slice(i, m < 0 ? undefined : m);};const banned = /showsTable\.(fetch|find|iterate)|showById\(|liveShowOf\(|\.find\(|\.iterate\(/;let bad = 0;for (const [label, text] of [['people.hl filmographyOf', body(people, 'filmographyOf')], ['people.hl personInfoOf', body(people, 'personInfoOf')],['people.hl personBySlug', body(people, 'personBySlug')], ['components/person.hl', comp.split('\n').filter(l => !l.trim().startsWith('//')).join('\n')]]) {const m = text.match(banned);if (m) { bad++; console.log('FAIL ' + label + ': ' + m[0]); } else console.log('ok ' + label);}if (!/creditRowLive\(/.test(body(people, 'filmographyOf'))) { bad++; console.log('FAIL filmographyOf does not use creditRowLive'); }console.log(bad ? 'person-lookup: FAILED' : 'person-lookup: passed');process.exit(bad ? 1 : 0);
Branches
Latest commits
- fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
- b2e2206dlog: #63 livemre
- 5831e0e0log: HM64 donemre
- 4042b923Flatten catalog membership rows into paired slotsmre
- ea8a759elog: #61 #62 live, DP63 and HM64 startedmre
- 40439456Merge hm63-searchtext: tracker#63 packed search textmre
- b7e6b48ePack normalized search text behind numeric offsetsmre
- b35f53e1log: DP62 stale runtime decisionmre
- f9593602log: Apollo deploy rule correctionmre
- 3c95f7f3log: DP62 and HM63 startedmre
- 9c4397c9mission HM63mre
- 8dfe42c8mission DP62mre
- e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
- 8274bcf1log: RV44 done, deploy held for the usage windowmre
- 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
- a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
- 6159a248Merge branch 'hm62-personindex' into rv44mre
- a8923d93log: RV44 startedmre
- cf28cf77mission RV44mre
- 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre