Skip to content

Reliability & dev server memory improvements#199

Open
Uttkarsh-Srivastava wants to merge 9 commits intofeature/fix-memory-usagefrom
fix/hot-reload
Open

Reliability & dev server memory improvements#199
Uttkarsh-Srivastava wants to merge 9 commits intofeature/fix-memory-usagefrom
fix/hot-reload

Conversation

@Uttkarsh-Srivastava
Copy link
Copy Markdown
Collaborator

Summary

  • Decoupled SSR compiler from client dev server — removed the in-process SSR webpack watcher from development.client.babel.js; SSR now runs in a separate process for better memory isolation
  • Chokidar-based hot-reloadstartServer.js now watches loadable-stats.json (webpack signal) and the app /server directory; on change it selectively clears the require cache (clearServerCache) and restarts the Express server
  • Safe server restartrestartServer() nulls serverInstance before close() to prevent EADDRINUSE race conditions when multiple watcher events fire simultaneously
  • Port availability pre-check — both the webpack dev server and Node server now verify the port is free before binding, with a clear error on conflict
  • Webpack filesystem cache — added cache: { type: "filesystem" } in base.babel.js to reduce memory pressure and speed up incremental rebuilds
  • Devtool downgrade — switched inline-source-mapeval-cheap-module-source-map for lower memory footprint in dev
  • React Fast Refresh — added react-refresh/babel plugin to babel.config.client.js for the development env
  • Removed css-hot-loader — dropped from SCSS and CSS rules (superseded by React Fast Refresh + HMR)
  • Unified cross-platform hot-reload — removed --watch-path flags on Windows; file watching is now handled by chokidar uniformly across platforms
  • Renderer simplificationrenderer/index.js always requires ./handler directly; dev/prod branching removed since the cache-clear strategy handles freshness

utkarsh-1mg and others added 9 commits January 13, 2026 16:32
…ross platforms

Replaced Node.js native --watch-path flags on Windows with chokidar-based
watching (already used on Mac/Linux), eliminating the double-trigger bug
where a single /server file change caused both a process-level restart and
an in-process Express restart simultaneously.

Also fixes EADDRINUSE race condition by introducing restartServer() which
nulls serverInstance before close(), preventing concurrent chokidar events
from each queuing independent startServer() callbacks on the same socket.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@deputydev-agent
Copy link
Copy Markdown

DeputyDev will no longer review pull requests automatically.To request a review, simply comment #review on your pull request—this will trigger an on-demand review whenever you need it.

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.

2 participants