Skip to content

Refactor & migration (Vite, MUI v5, Jest, Babel, etc.)#35

Merged
ThatZiv merged 29 commits into
masterfrom
refactor-migration
Jun 9, 2026
Merged

Refactor & migration (Vite, MUI v5, Jest, Babel, etc.)#35
ThatZiv merged 29 commits into
masterfrom
refactor-migration

Conversation

@ThatZiv

@ThatZiv ThatZiv commented Jun 9, 2026

Copy link
Copy Markdown
Owner

comprehensive migration and refactoring pass across the entire codebase:

  • JSX extension
  • dep updates
  • Vite build cfg (and migration from CRA)
  • Material-UI v4 to MUI V5
  • lazy loading
  • other improvements.

This includes jest snapshot and test(s) migrations, deprecated theming, babel cfg update, and future todo(s) for actual content updates (you know...the thing i need to actually be doing).

This massive refactor needed to be done sooner or later, and i figured I needed to get more comfortable in burning tokens so why not start here :)

ThatZiv added 19 commits May 24, 2026 15:26
…ponent

- Updated package.json to use react-swipeable instead of react-swipeable-views.
- Refactored Gallery component to utilize the new SwipeableView for image sliding.
- Enhanced Status component to handle fetch errors more gracefully with AbortController.
- Created SwipeableView component to manage swipe functionality and transitions.
- Updated Home component to use useEffect for delayed rendering logic.
- Refactored sections to use the new SwipeableView component for tab transitions.
- Updated snapshots to reflect changes in component structure and styles.
Copilot AI review requested due to automatic review settings June 9, 2026 17:34

Copilot AI 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.

Pull request overview

This PR performs a broad front-end migration/refactor, moving the app from CRA-era tooling to a Vite + React 18 + MUI v5 stack, while updating build/test setup and refactoring multiple UI components/sections to match the new ecosystem.

Changes:

  • Introduces Vite build configuration (including bundle analysis and build-date injection) and updates project scripts/output paths (dist).
  • Migrates Material-UI v4 usage to MUI v5 across pages/components/sections and refreshes theming.
  • Updates Jest tests/snapshots to be more stable under MUI v5/Emotion output and refactors some UI behaviors (lazy loading, swipe views, analytics).

Reviewed changes

Copilot reviewed 60 out of 75 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vite.config.mjs Adds Vite config, build-date define, analyzer mode, and manual chunking.
src/utils.jsx Adds shared utility helpers and generators.
src/Theme.jsx Replaces legacy theme with MUI v5 createTheme and component overrides.
src/Theme.js Removes legacy Material-UI v4 theme.
src/test/Utilities.test.jsx Adds Jest tests for new utilities.
src/test/Components.test.jsx Migrates/expands component tests and stabilizes snapshots.
src/test/Components.test.js Removes legacy component test file.
src/test/__snapshots__/Components.test.jsx.snap Adds new snapshot baseline for updated tests.
src/test/__snapshots__/Components.test.js.snap Removes legacy snapshot baseline.
src/sitemap-builder.js Updates sitemap builder to read index.jsx routes.
src/setupTests.js Removes CRA-era Jest setup file.
src/sections/Webserver.jsx Migrates Grid import to MUI v5.
src/sections/WayneHacks2.jsx Migrates Grid import to MUI v5.
src/sections/WayneHacks1.jsx Migrates Grid import to MUI v5.
src/sections/WanyeHacksWebsite.jsx Migrates MUI imports; simplifies Markdown usage.
src/sections/University.jsx Adds new Education section content and components.
src/sections/Template.jsx Adds a template for new sections.
src/sections/Spartahack8.jsx Migrates Grid import to MUI v5.
src/sections/School.jsx Migrates MUI imports to v5 explicit imports.
src/sections/SCD.jsx Migrates Grid import to MUI v5.
src/sections/PFG.jsx Migrates MUI imports to v5 explicit imports.
src/sections/MarketPulse.jsx Migrates Grid import to MUI v5.
src/sections/Jeva.jsx Migrates MUI imports and adds image lazy/async hints.
src/sections/index.jsx Replaces swipeable views impl and refactors badge rendering.
src/sections/Hackathon2.jsx Migrates MUI imports to v5 explicit imports.
src/sections/Hackathon.jsx Migrates MUI imports to v5 explicit imports.
src/sections/GDSC.jsx Migrates Grid import to MUI v5.
src/sections/Garage.jsx Adds new “Garage” section using Status/Gallery.
src/sections/FiveM.jsx Migrates MUI imports and adds image lazy/async hints.
src/sections/Doxim.jsx Migrates MUI imports to v5 explicit imports.
src/reportWebVitals.js Updates web-vitals integration for newer API surface.
src/pages/Portfolio.jsx Migrates Grid import to MUI v5.
src/pages/index.jsx Adds lazy-loaded route declarations for pages.
src/pages/Home.jsx Migrates MUI imports; fixes timeout usage with useEffect.
src/pages/Experience.jsx Migrates MUI imports and minor JSX formatting.
src/pages/Education.jsx Migrates MUI imports.
src/index.jsx Migrates to React 18 createRoot, MUI v5 providers, Vite env usage, and vitals/gtag logic.
src/contexts/viewport.jsx Adds debounced resize handling and updates effect deps.
src/contexts/reducer.jsx Introduces a reducer + initial UI state for context.
src/contexts/index.jsx Introduces UserContext + provider wiring around reducer.
src/components/YouTubeEmbed.jsx Adds iframe loading and stricter referrer policy.
src/components/Timeline.jsx Replaces timeline UI with MUI v5 Stepper-based component.
src/components/Tags.jsx Migrates to MUI v5 and updates icon usage.
src/components/SwipeableView.jsx Adds custom swipe/autoplay wrapper using react-swipeable.
src/components/Status.jsx Migrates to MUI v5, improves pattern handling, and adds abortable fetch cleanup.
src/components/SocialMedia.jsx Migrates to MUI v5 and switches analytics calls to gtag when available.
src/components/Section.jsx Migrates to MUI v5 and updates expand icon implementation.
src/components/Scroll.jsx Adds a simple scroll container component.
src/components/Objectives.jsx Migrates to MUI v5; adjusts styling.
src/components/Nav.jsx Migrates to MUI v5, updates build date handling, and refines styling with sx.
src/components/Modal.jsx Refactors imports to explicit MUI v5 paths.
src/components/MediaCard.jsx Migrates to MUI v5, adds media aspect ratio and image lazy/async hints, and updates analytics calls.
src/components/Markdown.jsx Migrates Typography import and adds richer heading/paragraph rendering + image lazy/async hints.
src/components/MainDialog.jsx Migrates to MUI v5 imports/colors.
src/components/Lecture.jsx Migrates MUI imports to v5 explicit imports.
src/components/Hover.jsx Adds a hover-toggle component (currently marked broken).
src/components/Generic.jsx Migrates MUI imports and memoizes component.
src/components/Gallery.jsx Migrates to custom swipe view; adds image lazy/async hints and memoization.
src/components/Footer.jsx Migrates to MUI v5 explicit imports.
src/components/Delayed.jsx Adds a delayed-render helper component.
src/components/DateRange.jsx Migrates Typography import to MUI v5.
src/components/Contributions.jsx Migrates MUI imports and adds image lazy/async hints.
src/components/BackdropProgress.jsx Migrates CircularProgress import to MUI v5.
src/components/AlertDialog.jsx Migrates dialog imports/colors to MUI v5.
src/App.jsx Introduces lazy-loaded layout components and switches analytics to gtag when available.
README.md Updates TODO/FIXME lists for post-migration cleanup.
public/service-worker.js Refactors Workbox caching strategies and routes.
package.json Switches scripts to Vite, updates deps/devDeps, and adjusts Jest transform settings.
index.html Migrates CRA placeholders to Vite entrypoint and static paths.
babel.config.js Updates Babel presets for JSX automatic runtime.
.gitignore Updates build output ignore from build to dist.
.babelrc Removes legacy Babel config file.
Comments suppressed due to low confidence (5)

src/App.jsx:26

  • import pages from './pages/index' is placed after executable statements (const Nav = React.lazy(...), etc.). Static import statements must be at the top-level before other statements; this will cause a syntax error during build/test transpilation.
    src/sections/FiveM.jsx:92
  • This <img> is rendered without src/alt (line 91), so it will request the current document URL as an image in some browsers and fails accessibility. It looks like it was meant to be the Top.gg status widget that existed previously.
    src/sections/FiveM.jsx:111
  • This <img> includes duplicated src and alt props (both appear twice). JSX will take the last occurrence, but this is easy to miss and should be cleaned up.
    src/contexts/viewport.jsx:12
  • The debounced resize handler can still have a pending setTimeout when the provider unmounts. That timeout can fire after unmount and call setWidth/setHeight, causing React warnings about state updates on unmounted components.
    src/sections/index.jsx:39
  • Tooltip doesn't support a target prop; it will be forwarded to the underlying DOM element and end up as an invalid attribute (and it won't make the link open in a new tab). If you want new-tab behavior, set target/rel on the Link instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vite.config.mjs
Comment thread package.json Outdated
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.27778% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.63%. Comparing base (fce77dd) to head (041bafa).
⚠️ Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
src/test/test-utils.jsx 50.00% 24 Missing ⚠️
src/components/Status.jsx 69.44% 11 Missing ⚠️
src/components/SwipeableView.jsx 80.64% 6 Missing ⚠️
src/sections/index.jsx 28.57% 5 Missing ⚠️
src/contexts/viewport.jsx 62.50% 3 Missing ⚠️
src/components/SocialMedia.jsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
+ Coverage   68.58%   71.63%   +3.05%     
==========================================
  Files          16       18       +2     
  Lines         226      342     +116     
  Branches       65      104      +39     
==========================================
+ Hits          155      245      +90     
- Misses         67       94      +27     
+ Partials        4        3       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ThatZiv and others added 3 commits June 9, 2026 18:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ThatZiv ThatZiv merged commit ab33c32 into master Jun 9, 2026
1 check failed
@ThatZiv ThatZiv deleted the refactor-migration branch June 9, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants