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:
@@ -0,0 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { LazyMotion, domAnimation } from "framer-motion";
|
||||
|
||||
export function MotionProvider({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<LazyMotion features={domAnimation}>
|
||||
{children}
|
||||
</LazyMotion>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user