Skip to content

Vite Release#284

Merged
mayansharma merged 118 commits into
mainfrom
feat/mweb
Jul 15, 2026
Merged

Vite Release#284
mayansharma merged 118 commits into
mainfrom
feat/mweb

Conversation

@mayansharma

@mayansharma mayansharma commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

Migrates Catalyst Core’s web runtime from the old webpack/@tata1mg/router stack to a Vite-first SSR pipeline, with updated routing, split rendering, asset extraction, template support, and test coverage.

Core Runtime

  • Replaces webpack SSR/client build flow with Vite server/client builds.
  • Adds Vite configs for shared, client, and server builds.
  • Adds a custom Node ESM loader for aliases, extension resolution, JSX, CJS interop, and legacy require() compatibility.
  • Moves Catalyst entrypoint to index.jsx and re-exports React Router plus Catalyst web-router helpers.
  • Removes old webpack Babel configs, remove-client/remove-ssr plugins, and legacy webpack server startup paths.
  • Adds preServerInit to preload app config/hooks before Express starts.

SSR, Routing, And Data

  • Adds Catalyst-owned web-router layer: RouterDataProvider, MetaTag, route data fetching, metadata merging, router context, and typed declarations.
  • Updates ClientRouter and ServerRouter to use the new prepared route structure.
  • Fixes production route matching to use req.originalUrl.
  • Adds optional store fallback so apps without Redux store files still run.
  • Moves renderer files to JSX and splits document rendering into Head, Body, render, and handler.

Vite Split And Asset Pipeline

  • Adds split() and hydrationReady() as the Vite replacement for @loadable/component.
  • Adds SplitInview for visibility-gated loading and per-instance fallback support.
  • Adds cache-key injection for split() calls.
  • Adds categorized asset manifest generation for ssrTrue, ssrFalse, essential, and orphan chunks.
  • Adds chunk extraction for critical/deferred JS and CSS.
  • Preloads critical assets, inlines critical CSS, and scopes deferred asset caching by route.
  • Fixes split statics propagation so serverFetcher, clientFetcher, and setMetaData remain available after lazy loading.
  • Fixes production static serving for Vite assets under PUBLIC_STATIC_ASSET_PATH/client/assets.

Server Runtime

  • Reworks Express server startup for Vite SSR.
  • Preloads production render module once at startup.
  • Adds build manifest cache so manifests are read once instead of per request.
  • Adds CJS bridge helper for ESM server files.
  • Supports custom Vite config loading.
  • Adds serve:inspect.
  • Improves env loading and client env define handling.

Templates And Fixture App

  • Updates create-catalyst-app templates to import router/runtime APIs from catalyst-core instead of @tata1mg/router.
  • Removes @loadable/component from templates and switches client hydration to hydrationReady().
  • Converts template and fixture server middleware files to ESM.
  • Updates the Catalyst fixture app to use split() routes, native React Router index route shape, and Vite-compatible env reads.
  • Syncs fixture catalyst-core package metadata and bin during test setup.

Observability, Bots, And Security

  • Makes OpenTelemetry opt-in via OTEL_ENABLE.
  • Adds response compression/flush spans and bot attribution.
  • Adds bot detection middleware and AI crawler/StatusCake user-agent detection.
  • Externalizes optional OTEL dependencies from SSR build.
  • Includes npm audit/Semgrep-related dependency and security fixes.
  • Includes Vite CVE fix.

Build And Release

  • Updates Catalyst package scripts and dependency set for Vite, React, Sass, SVGR, and native build handling.
  • Adds native Babel config and native package metadata support.
  • Updates release metadata, changelog, lockfile, and MCP package dependency metadata.
  • Updates scripts/test-catalyst-core.sh to replace built dist, bin, and package metadata in the fixture before running checks.

Uttkarsh-Srivastava and others added 5 commits June 5, 2026 13:21
- Add botDetectionMiddleware that sets res.locals.is_bot and injects
  the value into the OTEL context via IS_BOT_KEY when tracing is enabled
- Export IS_BOT_KEY from otel.js and read it in withObservability /
  withSyncObservability to stamp http.response.is_bot on all spans
- Mount botDetectionMiddleware in expressServer before the catch-all handler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
upgrades vite from 6.3.5 to 6.4.3 for resolving "CVE-2026-53571" and
"CVE-2026-53632"
@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.

Comment thread packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx Dismissed
Comment thread packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx Dismissed
Comment thread packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx Dismissed
Comment thread packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx Dismissed
Comment thread packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx Dismissed
# Conflicts:
#	package-lock.json
#	packages/catalyst-core/package.json
#	packages/catalyst-core/src/server/renderer/handler.js
#	packages/catalyst-core/src/server/utils/userAgentUtil.js
@mayansharma mayansharma changed the title Syncing mweb branch with main Vite Release Jun 30, 2026
mayansharma and others added 14 commits July 3, 2026 01:16
# Conflicts:
#	.release-meta.json
#	apps/catalyst-core-test/package.json
#	apps/catalyst-core-test/server/server.js
#	apps/catalyst-core-test/src/js/pages/BreedDetails/BreedDetails.js
#	apps/catalyst-core-test/src/js/pages/Home/Home.js
#	package-lock.json
#	packages/catalyst-core/package.json
#	packages/catalyst-core/src/scripts/build.js
#	packages/catalyst-core/src/scripts/devBuild.js
#	packages/catalyst-core/src/scripts/loadEnvironmentVariables.js
#	packages/catalyst-core/src/scripts/start.js
#	packages/catalyst-core/src/server/expressServer.js
#	packages/catalyst-core/src/server/renderer/document/Body.jsx
#	packages/catalyst-core/src/server/renderer/document/Head.js
#	packages/catalyst-core/src/server/renderer/extract.js
#	packages/catalyst-core/src/server/renderer/handler.js
#	packages/catalyst-core/src/server/renderer/index.js
#	packages/catalyst-core/src/server/startServer.js
#	packages/catalyst-core/src/webpack/babel-plugins/remove-client.plugin.js
#	packages/catalyst-core/src/webpack/babel-plugins/remove-ssr.plugin.js
#	packages/catalyst-core/src/webpack/babel.config.client.js
#	packages/catalyst-core/src/webpack/babel.config.ssr.js
#	packages/catalyst-core/src/webpack/base.babel.js
#	packages/catalyst-core/src/webpack/development.client.babel.js
#	packages/catalyst-core/src/webpack/production.client.babel.js
#	packages/create-catalyst-app/templates/none-js/package.json
#	packages/create-catalyst-app/templates/none-ts/package.json
#	packages/create-catalyst-app/templates/redux-js/package.json
#	packages/create-catalyst-app/templates/redux-ts/package.json
#	packages/create-catalyst-app/templates/rtk-js/package.json
#	packages/create-catalyst-app/templates/rtk-ts/package.json
#	scripts/test-catalyst-core.sh
Comment thread packages/catalyst-core/src/server/expressServer.js Dismissed
@mayansharma
mayansharma merged commit d572187 into main Jul 15, 2026
7 checks passed
Uttkarsh-Srivastava added a commit that referenced this pull request Jul 22, 2026
renderToPipeableStream's pipe(res) in onShellReady and the handler's
own res.write()/res.end() in onAllReady were two independent
completion paths racing to close the same response. Whichever lost
was silently dropped (no error listener on res), truncating every
response: missing closing tags on react-dom 19.x, or lost deferred
asset scripts on 18.x, with Suspense fallbacks stuck permanently on
some documents.

Route React's output through a Transform ("tail") instead. React
auto-ends tail exactly like it auto-ended res before, but tail's
flush() hook is guaranteed to run once, appending the deferred asset
tags, before a plain tail.pipe(res) is allowed to end res. There is
now exactly one caller of res.end().

Rebased onto main post the Vite Release merge (#284), which replaced
the old webpack packages/catalyst-core/src/server/renderer/handler.js
with this handler.jsx (same defect, new location) and added safe-area
handling (cleanupSafeArea) that this fix preserves.

Fixes #320

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

6 participants