perf: optimize bundle, assets and mobile sidebar#5
Merged
Conversation
- drop framer-motion in favor of IntersectionObserver in ScrollReveal - migrate Contact form from antd to MUI; remove antd and @ant-design/icons - swap remaining @ant-design/icons in About to MUI equivalents - lazy-load GitHubCalendar via IntersectionObserver in bento preview - pause canvas animations (Constellation, MatrixRain) and Home typewriter when off-screen or when document is hidden - only animate CursorGlow when cursor moves - memoize BentoCard and stabilize handlers via useMemo - delete 16 unused asset files (~9 MB) - convert 11 images to WebP and resize via sharp script (~2 MB saved) - preload hero avatar with fetchPriority=high inside <picture> - add loading=lazy and decoding=async to non-hero images - redesign mobile drawer: numbered nav, dot indicator, footer with email and social links; remove ChatGPT-like border-left highlight - fix logo spacing between "Xuan" and "Anh" - remove dead header.css and contact.css Main bundle (raw) drops from 658 KB to 412 KB. Largest chunk drops from 360 KB to 82 KB. src/assets drops from ~12 MB to 3.4 MB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/optimize-images.js(sharp); delete 16 unused asset filesBundle impact
Notable changes
ScrollReveal: framer-motion → IntersectionObserver + CSS transitionContact: rebuilt with MUI TextField/Snackbar/AlertTitle, manual validationGitHubPreview: defersreact-github-calendaruntil card enters viewport, with skeleton placeholder matching the real 7×52 grid layoutConstellationBackground,MatrixRain: pause via IntersectionObserver +visibilitychangeCursorGlow: rAF only runs while cursor movesHome: typewriter pauses when section is off-screen or tab hiddenBentoCard:React.memo+useMemohandlers inBentoGrid<picture>with WebP source andfetchPriority="high"on imgloading="lazy",decoding="async"01.–06.) with monospace prefix, accent dot indicator, footer with email + location + social icons; removedborder-leftactive styleTest plan
npm run dev— verify hero avatar loads as WebP, no layout shift on heronpm run build— succeeds, bundle sizes match the table above