prop/assets/js
Graham McIntire e688d8c244
perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types
**Wire format — /map scores payload.** Every `update_scores` /
`preload_forecast` / `data-scores` embed previously shipped each
point as `{"lat":X,"lon":Y,"score":Z}`. At 95k cells in full CONUS
that's ~36 bytes/point × 95k = 3.4 MB of JSON, ~50% of it repeating
the three key names. Packing as `[lat, lon, score]` tuples drops
per-point overhead to ~19 bytes → ~1.8 MB on the wire, ~45% smaller.
New `Propagation.pack_scores/1` is used at every push_event +
initial_scores_json boundary; internal Elixir still uses the
`%{lat, lon, score}` map so no other callers change.

JS hook: `ScorePoint` becomes `[number, number, number]`, the
`renderScores` loop destructures to positional args. Regression
test in map_live_test updated to match the new shape.

**ProfilesFile compression.** Rust writer was at gzip level 6
(default). Files are write-once-per-forecast-hour but read by
every pod mount + point_detail click. Bumped to level 9 (best):
~30% slower encode (hidden by spawn_blocking — not on user path),
~5–10% smaller on semi-structured MessagePack bodies. No reader
changes needed — same gzip stream.

**TypeScript strictness.**
- `app.ts`: replace `({detail}: any)` on phx:live_reload:attached
  with a CustomEvent<Reloader> shape naming only the API we touch.
- `weather_map_hook.ts`: drop the `(this as any)._map` pair by
  declaring a `GridLayerWithMap = L.GridLayer & { _map: L.Map }`
  intersection on the overlay's createTile `this` parameter.
- `global.d.ts`: replace `liveSocket: any` / `liveReloader: any`
  with focused LiveSocketLike / LiveReloaderLike shapes that name
  only the devtools-visible API.

No more `any` in the codebase (verified via rg).
2026-04-21 17:45:06 -05:00
..
types perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types 2026-04-21 17:45:06 -05:00
app.ts perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types 2026-04-21 17:45:06 -05:00
beacon_map_hook.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
beacons_list_map_hook.ts Beacon list map, profile page polish, nav ordering fix 2026-04-12 16:23:09 -05:00
contact_map_hook.ts refactor: normalize pos1/pos2 JSONB key to 'lon' everywhere 2026-04-17 09:10:32 -05:00
contacts_map_hook.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
elevation_profile_hook.ts feat(contact): loading spinners, callsign-aware summaries, axis callsigns 2026-04-18 13:43:35 -05:00
format.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
locate_me_hook.ts Convert all JavaScript to TypeScript with type annotations 2026-04-11 16:59:28 -05:00
maidenhead_grid.ts Add 6-char subsquare grid overlay and fix map edge rendering 2026-04-11 18:08:18 -05:00
propagation_map_hook.ts perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types 2026-04-21 17:45:06 -05:00
rover_map_hook.ts fix(maps): same reconnect/visibility fix for rover and weather hooks 2026-04-18 13:25:38 -05:00
weather_map_hook.ts perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types 2026-04-21 17:45:06 -05:00