Skip to content

chore(app): drop remeda from app and ui - #59016

Merged
kitlangton merged 1 commit into
devfrom
drop-remeda
Oct 25, 2026
Merged

kitlangton merged 1 commit into
devfrom
drop-remeda

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What it does

Removes remeda from packages/app and packages/ui. It was used in two places for a handful of group, first and unique helpers that native array methods cover. (tui, web and gui-extensions still use it.)

How it works

  • ui/src/hooks/use-filtered-list.tsx: grouping moves to an exported groupItems. It builds a plain object and reads it with Object.entries, so group order is unchanged, including numeric-looking categories listed first.
  • app/src/providers/models/models.tsx: latestModels uses Map.groupBy per provider and per family:isFree, then picks the newest release_date with a reduce that only replaces on a strictly greater date. Ties keep the first model, like firstBy. uniqueModels keeps the first of each key in order, like uniqueBy.

Risk

The model picker's default visible models, its recent list, and the grouping and order of filtered lists (pickers and menus built on useFilteredList). The old and new code were compared on 500 random inputs (groups with numeric and negative keys, tied dates, duplicate keys) and gave identical results; that script was not committed. Provider order inside latestModels could differ only for integer-like provider ids, and the result is only used as a set.

Proof

  • bun test src in packages/ui: 157 pass, with new groupItems tests.
  • bun test ./src/providers in packages/app: 37 pass, with new tests for the tie, free/paid grouping and uniqueness.
  • bun typecheck in packages/ui and packages/app: clean.
  • bun script/lint-changed.ts origin/dev: 0 problems.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. On 2,000 random inputs (tied dates, missing families, free/paid twins, numeric and empty categories, duplicate keys), the new latestModels, uniqueModels and groupItems give the same output as the remeda versions. test:unit passes in packages/app (768) and bun test src in packages/ui (157), and tsc is clean in both. Map.groupBy is already used elsewhere in the app, so it adds no new runtime requirement.

The new models.test.ts only passes through the package's test:unit script (--conditions=solid). A bare bun test in packages/app fails at import with solid-sonner's "Client-only API" error. That matches how the package runs its tests, so it is not a blocker.

Public API: unchanged (internal app/ui code and dependencies only).

@kitlangton
kitlangton merged commit 467d61f into dev Oct 25, 2026
21 checks passed
@kitlangton
kitlangton deleted the drop-remeda branch October 25, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant