Skip to content

Conversation

ViolanteCodes
Copy link
Collaborator

@ViolanteCodes ViolanteCodes commented Mar 13, 2025

PR Summary: Migrate from Create React App to Vite

Major Changes:

  1. Build System Migration: Converted from Create React App to Vite
    - Added vite.config.js with React plugin configuration
    - Updated build scripts in package.json to use Vite commands
    - Moved index.html from public/ to project root as required by Vite
    - Added JSConfig for better TypeScript support
  2. React Router Upgrade:
    - Updated from React Router v5 to v6.22.3
    - Replaced Switch with Routes component
    - Improved route handling with proper nesting
    - Fixed NoApiKey page routing by ensuring it's wrapped in Router
    context
  3. React 18 Upgrade:
    - Updated to React 18.2.0
    - Replaced ReactDOM.render with createRoot API
    - Added StrictMode wrapper for better development experience
  4. File Extensions:
    - Renamed all React component files from .js to .jsx for better Vite
    integration
    - Updated imports accordingly throughout the project
  5. Environment Variables:
    - Updated from process.env to import.meta.env for environment variables
    - Fixed API token handling in buttercmssdk.js
  6. Component Improvements:
    - Enhanced Layout component with better scroll behavior
    - Improved blog navigation handling
    - Fixed 404 page to use NotFoundSection component
  7. Dependencies:
    - Updated ButterCMS SDK to version 3.0.0
    - Updated all testing libraries
    - Added Vite-related dependencies
  8. Documentation:
    - Updated README with new information about the Vite migration
    - Added section describing recent updates

Benefits:

  • Faster build and dev server times with Vite
  • Modern React patterns with React 18 and React Router 6
  • Improved error handling and user experience
  • Better routing system with consistent behavior

Testing Notes:

  • Verified that the app works with and without an API token
  • Confirmed all routes function correctly with the new Router
    implementation
  • Tested blog navigation and category functionality

Copy link

vercel bot commented Mar 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-starter-buttercms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 0:11am

@marcin-pece
Copy link
Collaborator

@ViolanteCodes I added a fix for scrolling. Could you check if it works correctly on your end?

  PR Summary: Migrate from Create React App to Vite

  Major Changes:

  1. Build System Migration: Converted from Create React App to Vite
    - Added vite.config.js with React plugin configuration
    - Updated build scripts in package.json to use Vite commands
    - Moved index.html from public/ to project root as required by Vite
    - Added JSConfig for better TypeScript support
  2. React Router Upgrade:
    - Updated from React Router v5 to v6.22.3
    - Replaced Switch with Routes component
    - Improved route handling with proper nesting
    - Fixed NoApiKey page routing by ensuring it's wrapped in Router
  context
  3. React 18 Upgrade:
    - Updated to React 18.2.0
    - Replaced ReactDOM.render with createRoot API
    - Added StrictMode wrapper for better development experience
  4. File Extensions:
    - Renamed all React component files from .js to .jsx for better Vite
  integration
    - Updated imports accordingly throughout the project
  5. Environment Variables:
    - Updated from process.env to import.meta.env for environment variables
    - Fixed API token handling in buttercmssdk.js
  6. Component Improvements:
    - Enhanced Layout component with better scroll behavior
    - Improved blog navigation handling
    - Fixed 404 page to use NotFoundSection component
  7. Dependencies:
    - Updated ButterCMS SDK to version 3.0.0
    - Updated all testing libraries
    - Added Vite-related dependencies
  8. Documentation:
    - Updated README with new information about the Vite migration
    - Added section describing recent updates

  Benefits:

  - Faster build and dev server times with Vite
  - Modern React patterns with React 18 and React Router 6
  - Improved error handling and user experience
  - Better routing system with consistent behavior

  Testing Notes:

  - Verified that the app works with and without an API token
  - Confirmed all routes function correctly with the new Router
  implementation
  - Tested blog navigation and category functionality
Copy link
Collaborator

@marcin-pece marcin-pece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few cosmetic changes we can provide

Good job 🎉

@ViolanteCodes
Copy link
Collaborator Author

@marcin-pece added a bunch of returns and newlines :)

Copy link
Collaborator

@marcin-pece marcin-pece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@ViolanteCodes
Copy link
Collaborator Author

@LenardMarcin This is ready for QA :)

@LenardMarcin LenardMarcin merged commit 3cf9938 into main Apr 28, 2025
2 checks passed
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.

3 participants