@mandujs/core 0.39.0 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/core",
3
- "version": "0.39.0",
3
+ "version": "0.39.1",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -3785,13 +3785,22 @@ async function handleRequestInternal(
3785
3785
  // Must run BEFORE static-file serving and route dispatch so that
3786
3786
  // `mandu build`-emitted HTML short-circuits SSR. No-op if the
3787
3787
  // feature is disabled or the path wasn't prerendered.
3788
- const prerendered = await tryServePrerendered(pathname, settings, req.method, req);
3789
- if (prerendered) {
3790
- if (settings.cors && isCorsRequest(req)) {
3791
- const corsOptions: CorsOptions = typeof settings.cors === 'object' ? settings.cors : {};
3792
- return ok(applyCorsToResponse(prerendered, req, corsOptions));
3788
+ //
3789
+ // #232 — In dev mode we SKIP the prerender cache entirely. The cache is
3790
+ // populated by `mandu build` and never invalidated during `mandu dev`, so
3791
+ // keeping it in the dev path causes the browser to see stale HTML after
3792
+ // HMR signals "full reload" — user saves a file, reloads, and the old
3793
+ // prerendered output wins. Production `mandu start` always runs with
3794
+ // `isDev: false`, so prod behavior is unchanged.
3795
+ if (!settings.isDev) {
3796
+ const prerendered = await tryServePrerendered(pathname, settings, req.method, req);
3797
+ if (prerendered) {
3798
+ if (settings.cors && isCorsRequest(req)) {
3799
+ const corsOptions: CorsOptions = typeof settings.cors === 'object' ? settings.cors : {};
3800
+ return ok(applyCorsToResponse(prerendered, req, corsOptions));
3801
+ }
3802
+ return ok(prerendered);
3793
3803
  }
3794
- return ok(prerendered);
3795
3804
  }
3796
3805
 
3797
3806
  // ─── Phase 18.μ — i18n dispatch ─────────────────────────────────────────