Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ The dev server supports hot reload for:
- Styles

### Node Version
Requires Node.js 18+ or 20+
Requires Node.js >= 22.12 (Vite 8 + unplugin-vue-markdown@32; Node 18/20 dropped in v1.0)

## Testing Strategy

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Refer to the Nginx section for the `nginx.conf` configuration and place it in th
::: details Dockerfile

```Dockerfile [Dockerfile]
FROM node:20-alpine as build-stage
FROM node:22-alpine as build-stage
Comment thread
YunYouJun marked this conversation as resolved.
Outdated

WORKDIR /app
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can use [StackBlitz](https://stackblitz.com/edit/valaxy) to try Valaxy onlin

::: danger Compatibility Note

Vite@7 requires [Node.js](https://nodejs.org/en/) version `^20.19.0 || >=22.12.0`. Valaxy also requires you to upgrade Node.js after version `20.19.0`.
Valaxy requires [Node.js](https://nodejs.org/en/) version `>=22.12.0` (Vite 8 and `unplugin-vue-markdown@32` no longer support Node 18/20). Please upgrade Node.js to `22.12.0` or later.
Comment thread
YunYouJun marked this conversation as resolved.
Outdated

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/zh/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ server {
::: details Dockerfile

```Dockerfile [Dockerfile]
FROM node:20-alpine as build-stage
FROM node:22-alpine as build-stage
Comment thread
YunYouJun marked this conversation as resolved.
Outdated

WORKDIR /app
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/zh/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ top: 100

::: danger 兼容

由于 Vite@7 要求 [Node.js](https://nodejs.org/en/) 的版本为 `^20.19.0 || >=22.12.0`,Valaxy 同样需要你将 Node.js 升级至 `20.19.0` 版本之后
由于 Vite 8 与 `unplugin-vue-markdown@32` 不再支持 Node 18/20,Valaxy 要求 [Node.js](https://nodejs.org/en/) 的版本为 `>=22.12.0`,请将 Node.js 升级至 `22.12.0` 或更高版本
Comment thread
YunYouJun marked this conversation as resolved.
Outdated

:::

Expand Down
9 changes: 5 additions & 4 deletions e2e/docs/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ test.describe('docs search', () => {
warnings.push(msg.text())
})

await page.goto('/', { waitUntil: 'networkidle' })
// Ensure the Vue app has mounted (async mount chain in main.ts can finish
// after networkidle), so the search component's listeners are registered.
await page.goto('/', { waitUntil: 'domcontentloaded' })
// Ensure the Vue app has mounted (the async mount chain in main.ts is the
// real readiness signal, not the network going idle), so the search
// component's listeners are registered. See e2e/utils/hydration.ts.
await waitForHydration(page)

// Search button should be visible
Expand All @@ -42,7 +43,7 @@ test.describe('docs search', () => {
})

test('Cmd/Ctrl+K opens search', async ({ page }) => {
await page.goto('/', { waitUntil: 'networkidle' })
await page.goto('/', { waitUntil: 'domcontentloaded' })
// The Cmd/Ctrl+K handler is an `onKeyStroke` registered during the search
// component's setup, which only runs after `app.mount()`. Wait for the app
// to finish mounting/hydrating before pressing, otherwise the keystroke is
Expand Down
26 changes: 17 additions & 9 deletions e2e/utils/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@ import type { Page } from '@playwright/test'
/**
* Wait until the Valaxy Vue app has finished mounting / hydrating.
*
* `page.goto(..., { waitUntil: 'networkidle' })` is NOT enough: the client
* mount in `packages/valaxy/client/main.ts` is gated behind an async chain
* (`await import('@unhead/vue/client')` + `await router.isReady()`) before
* `app.mount('#app')` runs. With cached chunks there can be zero network
* requests, so `networkidle` may fire BEFORE that async mount resolves —
* meaning component `setup()` (and any window-level listeners they register,
* e.g. the Cmd/Ctrl+K `onKeyStroke` in `PressNavBarSearch.vue`) is not yet
* attached.
* Prefer `page.goto(url, { waitUntil: 'domcontentloaded' })` followed by
* `waitForHydration(page)` over `waitUntil: 'networkidle'`:
*
* 1. `networkidle` is unreliable for *readiness*. The client mount in
* `packages/valaxy/client/main.ts` is gated behind an async chain
* (`await import('@unhead/vue/client')` + `await router.isReady()`) before
* `app.mount('#app')` runs. With cached chunks there can be zero network
* requests, so `networkidle` may fire BEFORE that async mount resolves —
* meaning component `setup()` (and any window-level listeners they register,
* e.g. the Cmd/Ctrl+K `onKeyStroke` in `PressNavBarSearch.vue`) is not yet
* attached.
* 2. `networkidle` is also *flaky*: against the Vite dev server, background
* activity (HMR, UnoCSS dev updates, the git-log addon's API calls, async
* DocSearch chunks) can keep the network busy so it never idles for 500ms,
* making `page.goto` itself time out. This is a documented Playwright
* anti-pattern.
*
* Vue's runtime-dom sets the `data-v-app` attribute on the mount container
* synchronously right after `app.mount()` returns (for both client render and
* hydration). Waiting for it is a deterministic "app is interactive" signal —
* no arbitrary timeouts.
* no arbitrary timeouts, no dependence on the network ever going quiet.
*/
export async function waitForHydration(page: Page, selector = '#app'): Promise<void> {
await page.locator(`${selector}[data-v-app]`).waitFor({ state: 'attached' })
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"blog"
],
"engines": {
"node": "^18.0.0 || >=20.0.0"
"node": ">=22.12.0"
},
"scripts": {
"api:dev": "pnpm -C api run dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-valaxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"template-*/**/*"
],
"engines": {
"node": "^18.0.0 || >=20.0.0"
"node": ">=22.12.0"
},
"scripts": {
"clean": "rimraf dist",
Expand Down
1 change: 1 addition & 0 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@types/body-parser": "catalog:",
"@types/splitpanes": "catalog:",
"@types/wicg-file-system-access": "catalog:",
"@unocss/reset": "catalog:",
"gray-matter": "catalog:",
Comment thread
YunYouJun marked this conversation as resolved.
"reka-ui": "catalog:frontend",
"splitpanes": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/valaxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"types"
],
"engines": {
"node": "^18.0.0 || >=20.0.0"
"node": ">=22.12.0"
},
"scripts": {
"clean": "rimraf dist",
Expand Down
Loading
Loading