diff --git a/apps/cms/package.json b/apps/cms/package.json
index 166d0680..048efd67 100644
--- a/apps/cms/package.json
+++ b/apps/cms/package.json
@@ -29,7 +29,6 @@
"dotenv": "^16.4.7",
"express": "^4.21.2",
"form-data": "^4.0.1",
- "lodash": "^4.17.21",
"mailgun.js": "^10.2.4",
"nanoid": "^3.3.8",
"papaparse": "^5.4.1",
@@ -43,7 +42,6 @@
"@tietokilta/ui": "workspace:*",
"@types/express": "^4.17.21",
"@types/express-fileupload": "^1.5.1",
- "@types/lodash": "^4.17.13",
"@types/papaparse": "^5.3.15",
"@types/react": "catalog:",
"copyfiles": "^2.4.1",
diff --git a/apps/web/package.json b/apps/web/package.json
index adeb42ac..dec1a0cc 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -17,7 +17,6 @@
"autoprefixer": "catalog:",
"clsx": "catalog:",
"date-fns": "^4.1.0",
- "lodash": "^4.17.21",
"next": "^14.2.20",
"next-international": "^1.3.1",
"nextjs-toploader": "^3.7.15",
@@ -30,6 +29,7 @@
"react-markdown": "^9.0.1",
"remark": "^15.0.1",
"remark-gfm": "^4.0.0",
+ "remeda": "^2.19.0",
"server-only": "^0.0.1",
"sharp": "^0.33.5",
"strip-markdown": "^6.0.0",
@@ -46,7 +46,6 @@
"@tietokilta/cms-types": "workspace:*",
"@tietokilta/config-typescript": "workspace:*",
"@tietokilta/eslint-config": "workspace:*",
- "@types/lodash": "^4.17.13",
"@types/mdast": "^4.0.4",
"@types/node": "catalog:",
"@types/qs": "^6.9.17",
diff --git a/apps/web/src/components/events-display/index.tsx b/apps/web/src/components/events-display/index.tsx
index 280e699d..58786531 100644
--- a/apps/web/src/components/events-display/index.tsx
+++ b/apps/web/src/components/events-display/index.tsx
@@ -1,7 +1,7 @@
import { Button, ClockIcon, MapPinIcon } from "@tietokilta/ui";
import Link from "next/link";
import { Suspense } from "react";
-import _ from "lodash";
+import { chunk } from "remeda";
import { notFound } from "next/navigation";
import {
Pagination,
@@ -112,7 +112,7 @@ async function EventList({ currentPage = 1 }: { currentPage?: number }) {
return null;
}
- const paginatedEvents = _.chunk(eventsList, 5);
+ const paginatedEvents = chunk(eventsList, 5);
const pageCount = paginatedEvents.length;
if (pageCount !== 0 && (currentPage < 1 || currentPage > pageCount)) {
diff --git a/apps/web/src/components/hero/index.tsx b/apps/web/src/components/hero/index.tsx
index c091391f..3c3ef6ae 100644
--- a/apps/web/src/components/hero/index.tsx
+++ b/apps/web/src/components/hero/index.tsx
@@ -3,7 +3,7 @@
import Image from "next/image";
import { useEffect, useState } from "react";
import { useScramble } from "use-scramble";
-import _ from "lodash";
+import { shuffle } from "remeda";
import { cn } from "../../lib/utils";
export interface ImageWithPhotographer {
@@ -86,7 +86,7 @@ export function Hero({
});
useEffect(() => {
- const shuffledTexts = _.shuffle(texts);
+ const shuffledTexts = shuffle(texts);
setCurrentText(shuffledTexts[0]);
const interval = setInterval(() => {
diff --git a/apps/web/src/components/honors-list/index.tsx b/apps/web/src/components/honors-list/index.tsx
index 2ddbf7c6..ed8b3f72 100644
--- a/apps/web/src/components/honors-list/index.tsx
+++ b/apps/web/src/components/honors-list/index.tsx
@@ -1,7 +1,7 @@
import type { AwardedHonor, Honor } from "@tietokilta/cms-types/payload";
import { ChevronDownIcon } from "@tietokilta/ui";
-import _ from "lodash";
import type { JSX } from "react";
+import { unique } from "remeda";
import { cn } from "../../lib/utils";
function AwardedPersonDropdown({
@@ -58,11 +58,11 @@ export function HonorsList({ honor }: { honor: Honor }): JSX.Element {
const awardedPersons = honor.awardedHonors.map(
(item) => item.awardedHonor as AwardedHonor,
);
- const awardsByYear = _.groupBy(
+ const awardsByYear = Object.groupBy(
awardedPersons,
(awardedPerson) => awardedPerson.guildYear,
);
- const years = _.uniq(
+ const years = unique(
awardedPersons.map((awardedPerson) => awardedPerson.guildYear),
).sort((a, b) => Number(b) - Number(a));
@@ -71,7 +71,7 @@ export function HonorsList({ honor }: { honor: Honor }): JSX.Element {
{Object.entries(years).map((awardYear) => (