Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web UI: Migrate from CRA to Vite #566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Scc33
Copy link

@Scc33 Scc33 commented Jun 7, 2024

Note

IF YOU SEE A LOT OF FORMATTING RELATED MERGE CONFLICTS
PLEASE MAKE SURE THAT YOU ARE USING OUR CODE FORMATTER.
Please see our development guide.

Reference Issues/PRs

Fixes #565

What does this implement/fix? Explain your changes.

High Level

  • Migrated from CRA to Vite
  • Updates the Web UI to use Vite as the frontend tooling

Technicals

  • Moved the index.html to the top level of the frontend directory (also updated the page title to SWE-agent :))
  • Added Vite and the Vite React plugin to the package.json and updated the start script to use Vite
  • Created a Vite config
    • Vite is configured to start on the 3000 port (same as the UI port from before)
    • All the React files were .js so I had to explicitly tell Vite that those .js files should be treated as jsx

@Scc33 Scc33 changed the title Migrate from CRA to Vite Web UI: Migrate from CRA to Vite Jun 7, 2024
@klieret
Copy link
Member

klieret commented Jun 11, 2024

Thank you for the PR, I wasn't aware that react-scripts is deprecated. However, I'm getting the following error when I run this:

  at decodeURI (<anonymous>)
    at viteTransformMiddleware (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:64834:19)
    at call (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:43006:7)
    at next (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:42950:5)
    at viteServePublicMiddleware (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:54721:20)
    at call (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:43006:7)
    at next (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:42950:5)
    at viteHMRPingMiddleware (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:66223:13)
    at call (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:43006:7)
    at next (file:///Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/frontend/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:42950:5
image

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.

Migrate off of deprecated react-scripts
2 participants