Files
wc-timer/CHANGELOG.md
2026-01-06 01:50:20 +01:00

1.3 KiB

CHANGELOG

[1.1.0] : Refactor and Optimization

Performance

  • IntlCache: Implemented caching for Intl objects. Date formatting no longer creates new instances on every refresh.
  • Shared Styles: Used adoptedStyleSheets instead of <style> tags. The browser parses CSS only once.
  • Date Math: Removed while loops for year/month calculations. Replaced them with faster O(1) mathematical formulas.

Stability and UI

  • Layout Shift (CLS): Fixed content jumping on load. The component now has a default min-height.
  • Initialization: Added a non-breaking space (\u00A0) at start. This prevents zero height before the first render.
  • TickHub Safety: Iteration over subscribers now uses a copy. An error in one timer will not stop others.

Code Quality

  • Private Fields: Changed _variable convention to native private fields #variable. Internal state is now fully protected.
  • Attribute Handling: Improved attribute update logic (#isAttrUpdate). This eliminates unnecessary render cycles.
  • Auto-restart: The stopped timer restarts automatically if the target date changes to the future.
  • Fallback: Added a safety check returning 00:00:00 if formatting results in an empty string.

[1.0.1] : Added README.md

[1.0.0] : First version