Public: anyone can read this; the crew can change it.
Main green: the static web loads no data graph again (FLAGS_FILE in a leaf module) #16912
Check · Review · Land · Live done — Landed and live in production.
fix/static-web-imports → main 0 commits
4 files
changed +11
−4
src/core/app_flags.ts +1 −1
| @@ -14,7 +14,7 @@ import { parseValue, type FlagValue } from "./flags.ts"; | ||
| 14 | 14 | |
| 15 | 15 | export type AppFlagDecl = { why: string; default: boolean }; |
| 16 | 16 | |
| 17 | export const FLAGS_FILE = "flags.json"; | |
| 17 | export { FLAGS_FILE } from "./flags_file.ts"; | |
| 18 | 18 | export const MAX_FLAGS = 100; |
| 19 | 19 | /** A flag name: lower case, digits, dashes and underscores; it is a URL and a column. */ |
| 20 | 20 | export const NAME = /^[a-z][a-z0-9_-]{0,47}$/; |
src/core/empty_words.ts +1 −1
src/core/flags_file.ts added +6
| @@ -0,0 +1,6 @@ | ||
| 1 | /** | |
| 2 | * The file an app declares its feature flags in (`core/app_flags.ts`), at its repository's root. A | |
| 3 | * leaf with no imports, so the empty-list words (`core/empty_words.ts`) can name it while the web's | |
| 4 | * static modules stay off the app's data graph (`test/web-import-cost.test.ts`). | |
| 5 | */ | |
| 6 | export const FLAGS_FILE = "flags.json"; |
test/web-import-cost.test.ts +3 −2
| @@ -27,11 +27,12 @@ const ROOT = join(import.meta.dir, ".."); | ||
| 27 | 27 | const MODULES = ["src/web/style.ts", "src/web/client.ts", "src/web/asset.ts"]; |
| 28 | 28 | |
| 29 | 29 | /** Modules the static web must never pull in: the data graph and the pages. |
| 30 | * `src/core/empty_words.ts` (the plain-words table, no imports) is allowed too. Of `src/apps/` | |
| 30 | * `src/core/empty_words.ts` (the plain-words table) and `src/core/flags_file.ts` (the one name it | |
| 31 | * imports, a leaf) are allowed too. Of `src/apps/` | |
| 31 | 32 | * only `env_phrase.ts` (plain words, type-only imports) is allowed, so |
| 32 | 33 | * any path into the apps graph — `runtime.ts`, `data.ts`, … — fails. */ |
| 33 | 34 | const HEAVY = [ |
| 34 | /^src\/core\/(?!empty_words\.ts$)/, | |
| 35 | /^src\/core\/(?!(empty_words|flags_file)\.ts$)/, | |
| 35 | 36 | /^src\/db\//, |
| 36 | 37 | /^src\/apps\/(?!env_phrase\.ts$)/, |
| 37 | 38 | /^src\/web\/pages\/board\.ts$/, |
new above
offline