Repository navigation
Conversation
|
Review notes. I merged this branch locally with current develop ( 1. Conflicts with develop
Please merge develop into this branch rather than rebasing it. Then propagate the result down the stack (1037 into #1038, #1038 into #1040, #1040 into #1041), so the later PRs don't carry the conflicts again. In #1041 the same 2. Windows:
|
react-scripts, jest and all frontend tests die; env vars move to VITE_API_URL; ModelIcon uses a curated icon map.
fcde958 to
8380efb
Compare
Summary
Moves the frontend build from Create React App to Vite. CRA is unmaintained and its webpack build was slow and produced a single large bundle. Vite gives a faster dev server and build, and is the base the upcoming modular frontend work needs.
The frontend jest suite is removed together with CRA, since jest was wired through
react-scripts.yarn buildis now the frontend check, locally and in CI.No behaviour change is intended for users. Routes, pages and the backend are untouched.
Type of Change
Changes (by file)
DashAI/front/vite.config.mjs: new Vite config. Output stays inbuild/, soFRONT_BUILD_PATH, the Dockerfiles,MANIFEST.inanddashai.specneed no change. A small plugin compiles the.jsfiles undersrcas JSX, because many of them contain JSX. The config is an ES module to avoid Vite's deprecated CJS Node API.DashAI/front/index.html: moved frompublic/to the frontend root, as Vite expects.DashAI/front/package.json,yarn.lock:react-scripts, jest and testing-library removed;viteand@vitejs/plugin-reactadded. Scripts are nowstart,build,preview,lint,typecheck.DashAI/front/.env.development,.env.production,src/api/api.ts,src/utils/urlUtils.js,src/hooks/useHardwareMonitor.js,src/components/models/LiveMetricsChart.jsx:REACT_APP_API_URLrenamed toVITE_API_URLand read throughimport.meta.env.DashAI/front/src/components/models/model/ModelIcon.jsx: the wildcard import of every MUI icon is replaced by a curated icon map, so the bundle no longer carries the whole icon set.DashAI/front/src/components/models/SessionInfoContent.jsx: removed a duplicatedtask_nameprop type key that esbuild reports.DashAI/front/src/**/*.test.*,setupTests.js,test-utils/: deleted (81 test files)..github/workflows/build-test.yaml,.github/workflows/publish.yml: removed theyarn teststep.update-server.sh: writes and readsVITE_API_URLin.env.production.local.CONTRIBUTING.rst: frontend commands updated.Testing (optional)
yarn installthenyarn buildinDashAI/frontcompletes without errors.yarn startserves the app on port 3000 against a running backend.http://localhost:8000: the built app loads and deep links such as/app/modelsstill resolve.Notes (optional)
.env.production.localor.env.development.localmust renameREACT_APP_API_URLtoVITE_API_URL. Servers deployed withupdate-server.shneed--setuprun once.