[WIP] Eliminating 43 npm vulnerabilities: react-scripts to Vite, ESLint 9, react-redux hooks, dependency cleanup, bugfixes#350
Conversation
|
This PR builds on the CRA-to-Vite migration draft started by the architect (commit fe37065e0), but goes significantly further — to a complete solution. |
|
I took another look at my draft and noticed a small difference in // Your draft
export const baseURL = import.meta.env.MODE === 'development' ? testServer : '';
// What I'd suggest
export const baseURL = (import.meta.env.DEV && import.meta.env.MODE !== 'test') ? testServer : '';This is the approach used by many Vite projects in the wild — for example Streamlit (https://github.com/streamlit/streamlit/blob/ccad0dd74215ef0738f81d08ce629c7045b0fd95/frontend/connection/src/constants.ts#L81) (44.5k★). |
|
One difference between our drafts caught my eye: |
|
As a follow-up to the |
|
One more note from my draft: |
|
One thing we noticed in your draft: TypeScript is still at |
|
For the changes to |
|
For better readability I'm writing the documentation in HTML — Markdown can't really produce a truly visual page. The draft page for |
|
and for |
|
Just wanted to share what I've been working on while reviewing the remaining files for this PR — it's taking a bit longer than expected because I'm being thorough with the verification. In parallel, I've started building comprehensive documentation for the entire ProjectForge codebase — all 4,321 source files — using LLMs to help me understand the project's architecture faster. The docs are 1:1 with
You can browse them here: https://maureranton.github.io/projectforge/file-index.html — it's a collapsible tree with a searchable flat table and lazy-loaded realtime line counts. This has already helped me uncover several things I wouldn't have noticed otherwise — like the CardDAV PROPFIND handler evolution, the transaction refactoring history, and which old Wicket modules were migrated to Kotlin vs. just deleted. This week I'll switch back to fixing the remaining issues in the PR. The docs are on a separate branch ( |
⚠ Work in progress! This is a large PR that changes many things. Before merging I need to thoroughly verify and document everything. I will add changes gradually and notify when it's ready for review. I also plan to write extensive details in the PR discussion. A draft version is already working and shows good results, but I'm not confident about all aspects yet — I don't want to rush, but rather draw conclusions step by step. By opening this PR I'm showing that I'm ready to share code and add more every day. This PR will change about 60 files in the project in its final form.
Changes
Create React App (CRA) → Vite. The project used
react-scripts^5.0.1(line 59 ofpackage.json) — the npm package that provides CRA's build tooling. It was the last stable release of Create React App (April 2022). CRA was officially deprecated in February 2025. The React docs now recommend Vite as the first build tool for new projects, and major frameworks (Nuxt, SvelteKit, Astro, React Router, SolidStart) have adopted Vite as their foundation.ESLint 8 → ESLint 9. The project was using
^8.57.1(line 98 ofpackage.json), the final ESLint 8 release from September 2024 (end of life). The migration follows the official guide. At the time of creating this WIP PR,.eslintrchas already been deleted; I will sendeslint.config.jsas a replacement shortly. If possible, I will migrate directly to ESLint 10; if not, I will lay the groundwork for a future upgrade.react-redux connect() → useSelector/useDispatch. The React Redux docs recommend hooks as the default: "The existing
connectAPI still works, but the hooks API is simpler and works better with TypeScript." This is especially fitting as TypeScript will be pulled up alongside this change. For example,connect(mapStateToProps)(Formatter)atFormatter.jsx:130.Dependency cleanup. Removed some unnecessary packages from the dependency list and specified the remaining ones more precisely.
Bug fixes. Improved the project's interaction with the runtime environment and embedded database.
Frontend tests
I built the frontend tests using Vitest and also implemented things that weren't covered by the previous tests. For example, I started thinking about improving the tests after noticing the TODO in
authentication.test.jsat line 211.Outlook
This PR has the potential to systematically resolve most of the project's open pull requests.
What's next
To make sure the code is clean, I decided to rewrite the PR based on the draft rather than uploading the draft directly. Going forward I will reference the draft repeatedly — for instance, I managed to make the project work with Vite 6 (Vite 5 is unlikely), while the current release is Vite 8. In the coming days I will publish the full changelog and description of all changes.
Closes #346.