| | @@ -20,6 +20,10 @@ highlighting. Nothing else changed: no new route, no new `GitQuery` method, **no |
| 20 | 20 | `hl-` classes at the bottom of the file. |
| 21 | 21 | - `syntect 5.3` with `default-features = false, features = ["default-fancy"]`: the pure |
| 22 | 22 | Rust regex engine, so the Debian release build gains no C dependency. |
| 23 | +- `two-face 0.5` with `default-features = false, features = ["syntect-fancy"]`: the |
| 24 | + grammars syntect's defaults lack. Its default feature is `syntect-onig`, so |
| 25 | + `default-features = false` is not tidiness — it is what keeps `onig`, and therefore a |
| 26 | + C dependency, out of the release build. |
| 23 | 27 | |
| 24 | 28 | ## progress.md material — decisions worth not rediscovering |
| 25 | 29 | |
| | @@ -62,17 +66,15 @@ highlighting. Nothing else changed: no new route, no new `GitQuery` method, **no |
| 62 | 66 | |
| 63 | 67 | ## current.md material — holes opened and shortcuts taken |
| 64 | 68 | |
| 65 | | −- **The default syntax set is missing four languages this project itself uses.** Checked |
| 66 | | − by test (`which_common_languages_the_default_set_knows`, prints its findings): |
| 69 | +- **`.jsx` is the one extension still unhighlighted.** `two_face` closed the gap that |
| 70 | + mattered — TOML, Dockerfile and TypeScript all highlight now, and the first two are in |
| 71 | + this repository — but its JavaScript grammar claims only `js` and `htc`, while React |
| 72 | + is covered on the TypeScript side by `TypeScriptReact` for `tsx`. So a `.jsx` file |
| 73 | + renders plain. Nothing here uses one; it is recorded rather than fixed, and the fix if |
| 74 | + it is ever wanted is to alias `jsx` onto the JavaScript syntax in `syntax_for`, not |
| 75 | + another crate. `the_languages_this_repository_uses_are_all_highlighted` asserts the |
| 76 | + sixteen that do work, so a future syntax-set swap cannot quietly reopen the hole. |
| 67 | 77 | |
| 68 | | − | Highlighted | **Plain** | |
| 69 | | − |---|---| |
| 70 | | − | Rust, shell, Markdown, Python, JavaScript, Go, YAML, JSON, CSS, SQL, Makefile, C | **TOML, Dockerfile, TypeScript, JSX/TSX** | |
| 71 | | − |
| 72 | | − `Cargo.toml` and `Dockerfile` render unhighlighted in this repository today — the |
| 73 | | − `highlight-toml-dark.png` screenshot is exactly that. `two-face` bundles the missing |
| 74 | | − grammars and is the fix, **deliberately not added here**: it is another dependency and |
| 75 | | − a decision for the orchestrator. As briefed, it was not attempted. |
| 76 | 78 | - **Highlighting costs ~87 ms per 1,255-line file in a release build** — measured on |
| 77 | 79 | `browse.rs` with `cargo test --release`, and it is paid on every view because nothing |
| 78 | 80 | caches. In the `topcoat dev` (debug) build the same page takes ~0.7 s to serve versus |
| | @@ -91,6 +93,24 @@ highlighting. Nothing else changed: no new route, no new `GitQuery` method, **no |
| 91 | 93 | - **The blob view's own header has no "this is Rust" indicator.** The language is |
| 92 | 94 | detected and then only ever visible as colour. |
| 93 | 95 | |
| 96 | +## The `two-face` decision, and what it cost |
| 97 | + |
| 98 | +Taken by the user after the first pass reported the gap. |
| 99 | + |
| 100 | +- **The syntax set is now `two_face::syntax::extra_newlines()`**, which is syntect's |
| 101 | + defaults plus the grammars `bat` curates. It is a drop-in for |
| 102 | + `SyntaxSet::load_defaults_newlines` — one line in the `OnceLock`. Nothing else moved: |
| 103 | + the `hl-` class output and every rule in `styles.css` are unchanged, because the extra |
| 104 | + grammars emit the same TextMate scopes the mapping was already written against. |
| 105 | +- **The release binary grew 0.59 MiB, from 13.65 MB to 14.27 MB** (`cargo build |
| 106 | + --release`, measured on this branch with and without the dependency). That is the |
| 107 | + embedded grammar dump; it is data, not code. Worth knowing because the artifact is |
| 108 | + downloaded by `install.sh` over whatever connection an operator has, and because |
| 109 | + 5b's release notes quote a size. |
| 110 | +- **No new C dependency.** `syntect-fancy` resolves to `syntect/regex-fancy`, the same |
| 111 | + pure-Rust engine already in use, so the musl/glibc reasoning recorded in `current.md` |
| 112 | + is untouched. |
| 113 | + |
| 94 | 114 | ## ui.md material |
| 95 | 115 | |
| 96 | 116 | - The blob's code cell is the only place colour carries information rather than |