Skip to content

Conversation

@satyawaniaman
Copy link

Pull Request

Related issue

Fixes #630

What does this PR do?

  • Migrates from Create React App to Vite: Replaces the entire CRA build system with Vite for faster development and build times
  • Updates build configuration: Adds vite.config.js with React SWC plugin, TypeScript path resolution, and SVGR support
  • Renames JS files to JSX: Converts all React component files from .js to .jsx extension for better tooling and clarity
  • Updates package.json scripts: Replaces react-scripts commands with Vite equivalents (vite --host, vite build)
  • Removes Create React App dependencies: Eliminates react-scripts and related CRA-specific packages
  • Fixes ESLint configuration: Adds storybook-static/ to .eslintignore to prevent linting of generated build files
  • Maintains existing functionality: Preserves all existing features including Storybook, Cypress tests, and environment variable handling
  • Updates development workflow: Maintains the same development experience with improved performance

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@satyawaniaman
Copy link
Author

This pull request introduces several changes to migrate the project from react-scripts (Create React App) to Vite as the build tool, improve ESLint configuration, and update Storybook to use Vite. Additionally, minor adjustments were made to file paths and dependencies to align with the new setup.

Migration to Vite:

  • Replaced react-scripts with vite in package.json scripts (start, start:ci, build) and added Vite-specific plugins such as vite-plugin-svgr and vite-tsconfig-paths. [1] [2]
  • Updated index.html to remove %PUBLIC_URL% placeholders and added a <script> tag to include the Vite entry point. [1] [2]

Storybook Updates:

  • Migrated Storybook to use Vite by replacing @storybook/react-webpack5 with @storybook/react-vite in .storybook/main.mjs.
  • Renamed .storybook/main.js to .storybook/main.mjs and .storybook/preview.js to .storybook/preview.jsx to align with ES module conventions. [1] [2]
  • Updated imports in .storybook/preview.jsx to use relative paths for theme and global styles.

ESLint Configuration Enhancements:

  • Replaced react-app ESLint configuration with plugin:react/recommended and plugin:react-hooks/recommended. Added eslint-plugin-react-hooks to plugins.
  • Added a rule to allow devDependencies in specific file patterns such as *.config.js, *.stories.jsx, and *.test.js.

Dependency Updates:

  • Updated Storybook and its addons to the latest compatible versions and removed @storybook/preset-create-react-app.
  • Added new dependencies for Vite and ESLint plugins.

Miscellaneous Changes:

  • Updated .eslintignore to include storybook-static/.
  • Removed react-scripts from dependencies in package.json.

@curquiza
Copy link
Member

curquiza commented Aug 4, 2025

hello @satyawaniaman
thank you very much for the PR

  • Can you remove the merge conflict?
  • Also, can you fix the CIs? Most of the tests are failing. I will be easier to review once we are sure the PR does not breaki any tests

Thank you very much again for your time

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.

Get rid of react-script

2 participants