Skip to content

Migrate to vite#74

Open
pawiecz wants to merge 19 commits intomainfrom
migrate-to-vite
Open

Migrate to vite#74
pawiecz wants to merge 19 commits intomainfrom
migrate-to-vite

Conversation

@pawiecz
Copy link
Contributor

@pawiecz pawiecz commented Feb 20, 2026

Context & Requests for Reviewers

Fixes: #40

Tests

Standard instance setup steps remain unchanged and produce the same results (changes are hidden under npm scripts abstractions).

(Optional) Rollout Plan

Updated dev environments may seem slow on the first start (hence a note in the README Getting started section).

@cassidyjames
Copy link
Member

Significant change in how the client is used after the migration; no longer dependent on webpack bundling, so there’s a change to performance in how it’s used; should performance optimizations be part of this migration before the task is considered completed, or should it be a second step after the Vite migration?

Document potential performance impact, do the migration, then address performance as second issue

@pawiecz pawiecz marked this pull request as ready for review March 3, 2026 14:56
Copy link
Member

@juanmrad juanmrad left a comment

Choose a reason for hiding this comment

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

Tested locally -- both server and client start and work correctly. Vite dev server starts in ~235ms and the proxy to the backend works as expected. Production build also completes successfully in ~7s. Nice migration!

A few cleanup items below, but the core migration is solid.

Also to note. The build produces a 3MB Dashboard chunk. Agree with @cassidyjames that performance optimization should be a follow-up issue -- Vite's build.rollupOptions.output.manualChunks could help split this up.

Comment on lines 136 to 141
"react-scripts": {
"typescript": "^5"
},
"react-dev-utils": {
"fork-ts-checker-webpack-plugin": "^6.5.3"
},
Copy link
Member

Choose a reason for hiding this comment

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

The jest config block and the overrides for react-scripts/react-dev-utils are still here. Since we've moved to vitest (configured in vite.config.ts), these are now dead config. Can we clean them up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dropped Jest config block but left the react-scripts-related overrides - detailed explanation below in the Storybook thread.

"@storybook/addon-interactions": "^8.2.6",
"@storybook/addon-links": "^8.2.6",
"@storybook/blocks": "^8.2.6",
"@storybook/preset-create-react-app": "^8.2.6",
Copy link
Member

Choose a reason for hiding this comment

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

@storybook/preset-create-react-app is still listed.
does Storybook still work with Vite, or does this need to be swapped for @storybook/builder-vite?

Copy link
Contributor Author

@pawiecz pawiecz Mar 17, 2026

Choose a reason for hiding this comment

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

Storybook is currently non-operational (scripts build-storybook and storybook fail on current main branch). Issue that causes build failure (handlebars unavailability) shouldn't affect upgraded Storybook.

Swapping just the builder causes conflicts: recent @storybook/builder-vite conflicts with the rest of the current setup and installing compatible version (^8.2.6) works only with Vite <=v6.

If that would be OK with you I'll fix and upgrade Storybook setup in a separate PR (using Vite-specific builder). Also, @storybook/preset-create-react-app pulls react-dev-utils and react-scripts. I would drop them together with their overrides during that upgrade.

pawiecz added 15 commits March 16, 2026 14:14
Version selection was delegated to ".nvmrc" file where applicable.

Fixes: #111
Variable "NODE_ENV" is no longer used in client. It's been replaced with
Vite-specific "MODE" which can be adjusted with "--mode" command line argument
and defaults to:
- "development" for plain "vite" call
- "production" for "build" and "preview" calls

Even though server still uses "GOOGLE_PLACES_API_KEY" variable, client now uses
"VITE_GOOGLE_PLACES_API_KEY" ("VITE_"-prefixed). This way Vite can access this
information.
@pawiecz pawiecz changed the base branch from main to lock-node-24.14.0 March 17, 2026 12:00
@pawiecz
Copy link
Contributor Author

pawiecz commented Mar 17, 2026

I'm unable to reproduce vite build failure locally (it finishes successfully) while it continues to fail in the CI job.

Copy link
Member

@juanmrad juanmrad left a comment

Choose a reason for hiding this comment

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

👍🏻

Base automatically changed from lock-node-24.14.0 to main March 17, 2026 16:13
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.

Replace Craco with Vite

3 participants