discourse/plugins/styleguide/assets/javascripts/discourse
Sérgio Saquetim 0c4f285618
DEV: Replace deprecated Ember's array uniq and uniqBy (#35227)
This commit replaces several instances of `.uniq`, `.uniqBy`, and related
array deduplication methods with a new utility function
`uniqueItemsFromArray`. This change ensures proper deduplication logic
across the codebase while addressing the deprecation issues.

**Main Changes:**

* Created new utility function `uniqueItemsFromArray`: Located in a new
file, `array-tools.js`, this function provides a reusable and
configurable alternative for deduplication.
* Replaced old methods: Updated multiple files to use the new utility
function instead of deprecated or custom implementations for
deduplication.
* Replaced manual deduplication: Replace uses of `[...new Set(array)]`
to standardize the deduplication logic across the codebase.
* Added unit tests: Introduced thorough test coverage
(`array-tools-test.js`) to validate functionality and edge cases for the
utility function.
* Updated deprecation workflow: Added logging for deprecated uniq and
uniqBy methods to the `deprecation-workflow.js`.

This change is primarily focused on code quality improvements, ensuring
future-proof deduplication, and maintaining alignment with deprecation
guidelines.
2025-10-13 16:47:36 -03:00
..
components DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
controllers DEV: Remove renderTemplate from the styleguide (#21660) 2023-05-25 11:22:36 +02:00
helpers DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
lib UX: rework button classes (#34882) 2025-10-02 13:32:36 -06:00
pre-initializers Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
routes DEV: allows fabricators to use faker (#26555) 2024-04-08 21:00:09 +02:00
templates DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
styleguide-route-map.js DEV: Remove .es6 extensions from core (#14912) 2021-11-13 12:51:53 +01:00