fix: deduplicate Moment locale imports

HA
1d ago
+295-25

Summary

When a page uses both a reactive Moment locale and a literal locale, Reflex can emit imports for moment/min/locales and individual moment/locale/* modules. Since the all-locales bundle already includes those locale definitions, the redundant imports can trigger Moment’s defineLocale deprecation warnings.

This change removes individual Moment locale side-effect imports during page import collection only when moment/min/locales is present. Pages using only literal locales retain their specific imports.

Closes #7099.

Tests

  • tests/units/compiler/test_plugins.py and tests/units/reflex_components_moment/test_moment.py: 42 passed.
  • Ruff isolated checks and git diff --check passed.