Convert to ES modules with import/export #10

Closed
opened 2026-02-15 05:30:45 -08:00 by kyle · 0 comments
Owner

Problem: All classes were attached to window.* and loaded via script tags in strict dependency order. This fragile loading contract was error-prone.

Solution: Converted all frontend JS files to use ES module import/export syntax. Changed index.html from 7 individual script tags to a single module entry point. Each file now explicitly declares its dependencies. Kept window.* assignments for cross-component runtime access.

Files changed:

  • public/js/main.js - Added imports, removed fallback checks
  • public/js/utils/constants.js - Added export
  • public/js/utils/logger.js - Added export
  • public/js/components/Clock.js - Added export
  • public/js/components/ConfigManager.js - Added export
  • public/js/components/WeatherManager.js - Added export
  • public/js/components/DeparturesManager.js - Added export
  • index.html - Single script type=module entry point
Problem: All classes were attached to window.* and loaded via script tags in strict dependency order. This fragile loading contract was error-prone. Solution: Converted all frontend JS files to use ES module import/export syntax. Changed index.html from 7 individual script tags to a single module entry point. Each file now explicitly declares its dependencies. Kept window.* assignments for cross-component runtime access. Files changed: - public/js/main.js - Added imports, removed fallback checks - public/js/utils/constants.js - Added export - public/js/utils/logger.js - Added export - public/js/components/Clock.js - Added export - public/js/components/ConfigManager.js - Added export - public/js/components/WeatherManager.js - Added export - public/js/components/DeparturesManager.js - Added export - index.html - Single script type=module entry point
kyle closed this issue 2026-02-15 05:31:58 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kyle/SignageHTML#10