Skip to content

Commit

Permalink
chore: migrate to vite 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Dec 14, 2024
1 parent 699e3fe commit 0c9f022
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@adonisjs/prettier-config": "^1.4.0",
"@adonisjs/session": "7.5.0",
"@adonisjs/tsconfig": "^1.4.0",
"@adonisjs/vite": "^3.0.0",
"@adonisjs/vite": "4.0.0-beta.0",
"@japa/api-client": "^2.0.3",
"@japa/assert": "3.0.0",
"@japa/expect-type": "^2.0.2",
Expand All @@ -57,8 +57,8 @@
"@types/node": "^22.7.4",
"@types/qs": "^6.9.16",
"@types/supertest": "^6.0.2",
"@vavite/multibuild": "^4.1.3",
"c8": "^10.1.2",
"@vavite/multibuild": "^5.1.0",
"c8": "^10.1.3",
"copyfiles": "^2.4.1",
"del-cli": "^5.1.0",
"edge-parser": "^9.0.3",
Expand All @@ -71,7 +71,7 @@
"ts-node-maintained": "^10.9.4",
"tsup": "^8.3.0",
"typescript": "~5.6.2",
"vite": "^5.4.8"
"vite": "^6.0.3"
},
"dependencies": {
"@poppinss/utils": "^6.8.3",
Expand All @@ -85,7 +85,7 @@
"peerDependencies": {
"@adonisjs/core": "^6.9.1",
"@adonisjs/session": "^7.4.0",
"@adonisjs/vite": "^3.0.0",
"@adonisjs/vite": "4.0.0-beta.0",
"@japa/api-client": "^2.0.0",
"edge.js": "^6.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/server_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Vite } from '@adonisjs/vite'

import { pathToFileURL } from 'node:url'
import type { PageObject, RenderInertiaSsrApp, ResolvedConfig } from './types.js'
import type { ViteRuntime } from 'vite/runtime'
import type { ModuleRunner } from 'vite/module-runner'

/**
* Responsible for rendering page on the server
Expand All @@ -21,7 +21,7 @@ import type { ViteRuntime } from 'vite/runtime'
* bundle generated by Vite
*/
export class ServerRenderer {
static runtime: ViteRuntime
static runtime: ModuleRunner

constructor(
protected config: ResolvedConfig,
Expand All @@ -43,9 +43,9 @@ export class ServerRenderer {
* if we are in development mode
*/
if (devServer) {
ServerRenderer.runtime ??= await this.vite!.createRuntime()
ServerRenderer.runtime ??= await this.vite!.createModuleRunner()
ServerRenderer.runtime.clearCache()
render = await ServerRenderer.runtime.executeEntrypoint(this.config.ssr.entrypoint!)
render = await ServerRenderer.runtime.import(this.config.ssr.entrypoint!)
} else {
/**
* Otherwise, just import the SSR bundle
Expand Down

0 comments on commit 0c9f022

Please sign in to comment.