perf: optimize framer-motion bundle size and memoize dictionary fetching

- Wrap getDictionary with React cache to prevent redundant JSON parsing on the server
- Create MotionProvider to globally initialize framer-motion LazyMotion with domAnimation
- Replace standard 'motion' imports with 'm' across all animated client components (HomeClient, Navbar, GaleriClient, SSSClient, card, text-reveal) to drastically reduce First Load JS size
This commit is contained in:
mstfyldz
2026-06-04 12:50:23 +03:00
parent e1d8bae5a4
commit acf01c81fa
9 changed files with 59 additions and 44 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
"use client";
import { useState } from "react";
import { motion, AnimatePresence } from "framer-motion";
import { m, AnimatePresence } from "framer-motion";
import { Plus, Minus } from "lucide-react";
import { SectionHeader } from "@/app/components/ui/section-header";
import { Badge } from "@/app/components/ui/badge";
@@ -26,7 +26,7 @@ function FaqItem({ q, a }: { q: string; a: string }) {
</button>
<AnimatePresence initial={false}>
{open && (
<motion.div
<m.div
initial={{ height: 0, opacity: 0 }}
animate={{ height: "auto", opacity: 1 }}
exit={{ height: 0, opacity: 0 }}
@@ -34,7 +34,7 @@ function FaqItem({ q, a }: { q: string; a: string }) {
className="overflow-hidden"
>
<p className="text-gray-500 text-sm leading-relaxed pb-5">{a}</p>
</motion.div>
</m.div>
)}
</AnimatePresence>
</div>