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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

fix/static-web-imports → main 0 commits

  • Merged. fix/static-web-imports was merged into main as 42c8c1d.

Review

Sign in to review this change.
4 files changed +11 −4
src/core/app_flags.ts +1 −1
@@ -14,7 +14,7 @@ import { parseValue, type FlagValue } from "./flags.ts";
1414
1515 export type AppFlagDecl = { why: string; default: boolean };
1616
17 export const FLAGS_FILE = "flags.json";
17 export { FLAGS_FILE } from "./flags_file.ts";
1818 export const MAX_FLAGS = 100;
1919 /** A flag name: lower case, digits, dashes and underscores; it is a URL and a column. */
2020 export const NAME = /^[a-z][a-z0-9_-]{0,47}$/;
src/core/empty_words.ts +1 −1
@@ -5,7 +5,7 @@
55 * every kind and holds each to its sentence and its single link.
66 */
77
8 import { FLAGS_FILE } from "./app_flags.ts";
8 import { FLAGS_FILE } from "./flags_file.ts";
99
1010 export interface EmptyWords {
1111 /** One sentence, plain words, ending in a full stop. */
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, "..");
2727 const MODULES = ["src/web/style.ts", "src/web/client.ts", "src/web/asset.ts"];
2828
2929 /** 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/`
3132 * only `env_phrase.ts` (plain words, type-only imports) is allowed, so
3233 * any path into the apps graph — `runtime.ts`, `data.ts`, … — fails. */
3334 const HEAVY = [
34 /^src\/core\/(?!empty_words\.ts$)/,
35 /^src\/core\/(?!(empty_words|flags_file)\.ts$)/,
3536 /^src\/db\//,
3637 /^src\/apps\/(?!env_phrase\.ts$)/,
3738 /^src\/web\/pages\/board\.ts$/,

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs