@adonisjs/inertia 4.1.0 → 4.1.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.
@@ -1,4 +1,4 @@
1
- import { n as ServerRenderer, r as Inertia } from "../inertia_manager-Ra2dhBKa.js";
1
+ import { n as ServerRenderer, r as Inertia } from "../inertia_manager-BGHA4cDP.js";
2
2
  import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
3
3
  import "../debug-CBMTuPUm.js";
4
4
  import { t as defineConfig } from "../define_config-Du2hAFGX.js";
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-Ra2dhBKa.js";
1
+ import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-BGHA4cDP.js";
2
2
  import { t as InertiaHeaders } from "./headers-DafWEpBh.js";
3
3
  import "./debug-CBMTuPUm.js";
4
4
  import { n as indexPages, t as defineConfig } from "./define_config-Du2hAFGX.js";
@@ -369,6 +369,7 @@ var Inertia = class {
369
369
  };
370
370
  var ServerRenderer = class {
371
371
  #runtime;
372
+ #ssrEnvironment;
372
373
  #config;
373
374
  #vite;
374
375
  constructor(config, vite) {
@@ -377,8 +378,15 @@ var ServerRenderer = class {
377
378
  }
378
379
  async render(pageObject) {
379
380
  let render;
380
- if (this.#vite.getDevServer()) {
381
+ const devServer = this.#vite.getDevServer();
382
+ if (devServer) {
381
383
  debug_default("creating SSR bundle using dev-server");
384
+ const currentSsrEnv = devServer.environments.ssr;
385
+ if (this.#ssrEnvironment !== currentSsrEnv) {
386
+ if (this.#runtime) await this.#runtime.close();
387
+ this.#runtime = void 0;
388
+ this.#ssrEnvironment = currentSsrEnv;
389
+ }
382
390
  this.#runtime ??= await this.#vite.createModuleRunner();
383
391
  this.#runtime.clearCache();
384
392
  render = await this.#runtime.import(this.#config.ssr.entrypoint);
@@ -1,4 +1,4 @@
1
- import { t as InertiaManager } from "../inertia_manager-Ra2dhBKa.js";
1
+ import { t as InertiaManager } from "../inertia_manager-BGHA4cDP.js";
2
2
  import "../headers-DafWEpBh.js";
3
3
  import "../debug-CBMTuPUm.js";
4
4
  import { BriskRoute } from "@adonisjs/core/http";
@@ -1,4 +1,4 @@
1
- import { t as InertiaManager } from "../inertia_manager-Ra2dhBKa.js";
1
+ import { t as InertiaManager } from "../inertia_manager-BGHA4cDP.js";
2
2
  import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
3
3
  import { t as debug_default } from "../debug-CBMTuPUm.js";
4
4
  const MUTATION_METHODS = [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/inertia",
3
3
  "description": "Official Inertia.js adapter for AdonisJS",
4
- "version": "4.1.0",
4
+ "version": "4.1.1",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },