towerops/lib/towerops_web
Graham McIntire e97748437c build(assets): split coverage hooks into a lazy-loaded chunk
Switch esbuild to ESM with --splitting and load app.js as type=module.
Heavy hooks now ship in their own chunk and only download when their
LiveView mounts.

- assets/js/lib/leaflet.ts: extract ensureLeaflet (vendored Leaflet
  loader) into a shared module with a typed window.L declaration.
- assets/js/hooks/coverage_hooks.ts: extract CoverageMap,
  MultiCoverageMap, and CoverageLocationPicker (~510 lines) with
  proper interface types for hook context and tightened typing on
  payloads / event handlers (CoveragePayload is now a real type).
- app.ts: replace those three inline hook bodies with lazyHook
  stubs that call import('./hooks/coverage_hooks') on first mount,
  forwarding lifecycle hooks once the chunk resolves. Also adds a
  scoped `declare const L: any` so the remaining Leaflet hooks
  type-check.
- root.html.heex: switch the script tag to type=module so the
  emitted ESM bundle can use dynamic import().
- esbuild config: add --splitting --format=esm.

Build output now produces:
  app.js                      1.2 MB
  coverage_hooks-<hash>.js   16  KB  (lazy)
  chunk-<hash>.js             2.4 KB  (shared, lazy)
2026-05-06 16:11:32 -05:00
..
channels perf+refactor: codebase-wide query and antipattern audit 2026-04-28 16:58:51 -05:00
components build(assets): split coverage hooks into a lazy-loaded chunk 2026-05-06 16:11:32 -05:00
controllers perf+refactor: codebase-wide query and antipattern audit 2026-04-28 16:58:51 -05:00
graphql dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
helpers feat: add status emoji to page titles 2026-03-06 14:45:02 -06:00
live feat(coverage): cnHeat-style unified multi-tower map at /coverage 2026-05-06 16:00:43 -05:00
plugs fix: vendor Leaflet 1.9.4 locally instead of fetching from unpkg 2026-05-01 17:06:54 -05:00
changelog_parser.ex remove-gleam (#218) 2026-03-29 11:03:20 -05:00
endpoint.ex feat: add Accept: text/markdown content negotiation for agent compatibility 2026-04-17 14:14:31 -05:00
gettext.ex init 2025-12-21 11:10:43 -06:00
gettext_helpers.ex feat: migrate email templates to gettext (Phase 2 - Emails) 2026-02-02 09:48:30 -06:00
graphql_socket.ex perf+refactor: codebase-wide query and antipattern audit 2026-04-28 16:58:51 -05:00
permissions.ex i18n: add Spanish locale with full translations, language selector, and locale hook 2026-02-14 17:44:01 -06:00
plug_exceptions.ex handle exceptions gracefully on api endpoints 2026-02-04 12:18:14 -06:00
remote_ip.ex dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
router.ex feat(coverage): cnHeat-style unified multi-tower map at /coverage 2026-05-06 16:00:43 -05:00
scoped_resource.ex dialyzer: expand PLT, drop blanket codebase suppression 2026-04-21 09:33:22 -05:00
telemetry.ex fix: add Oban config to dev.exs and replace Exq telemetry with Oban 2026-01-24 16:39:45 -06:00
telemetry_filter.ex fix: suppress health check logs and downgrade CI artifacts to v3 2026-03-05 15:54:47 -06:00
user_auth.ex perf+refactor: codebase-wide query and antipattern audit 2026-04-28 16:58:51 -05:00