chore(web): upgrade vinext and align Vite+ configuration (#43021)

This commit is contained in:
Stephen Zhou
2026-09-28 03:04:45 +00:00
committed by GitHub
parent d8ec14027e
commit fc5053edf0
7 changed files with 81 additions and 40 deletions

View File

@@ -58,7 +58,7 @@ jobs:
run: |
set -o pipefail
started=$SECONDS
pnpm exec vinext build 2>&1 | tee "$RUNNER_TEMP/vinext-build.log"
pnpm run build:vinext 2>&1 | tee "$RUNNER_TEMP/vinext-build.log"
printf 'Full Vinext build: **%s seconds**.\n' "$((SECONDS - started))" >> "$GITHUB_STEP_SUMMARY"
- name: Collect sizes

65
pnpm-lock.yaml generated
View File

@@ -750,8 +750,8 @@ catalogs:
specifier: 14.0.2
version: 14.0.2
vinext:
specifier: 1.0.0-beta.10
version: 1.0.0-beta.10
specifier: 1.0.0-beta.13
version: 1.0.0-beta.13
vite:
specifier: npm:@voidzero-dev/vite-plus-core@1.0.0-rc.1
version: 1.0.0-rc.1
@@ -1848,7 +1848,7 @@ importers:
version: 3.19.3
vinext:
specifier: 'catalog:'
version: 1.0.0-beta.10(@vitejs/plugin-react@6.1.1(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1)))(@vitejs/plugin-rsc@0.5.35(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0))(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(next@16.3.6(@babel/core@7.29.7(supports-color@11.0.0))(@playwright/test@1.62.1)(@types/node@25.9.7)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0)
version: 1.0.0-beta.13(@types/node@25.9.7)(@vitejs/plugin-react@6.1.1(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1)))(@vitejs/plugin-rsc@0.5.35(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0))(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(next@16.3.6(@babel/core@7.29.7(supports-color@11.0.0))(@playwright/test@1.62.1)(@types/node@25.9.7)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0)
vite:
specifier: 'catalog:'
version: '@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1)'
@@ -4177,8 +4177,8 @@ packages:
peerDependencies:
react: '>=18.2.0'
'@resvg/resvg-wasm@2.4.0':
resolution: {integrity: sha512-C7c51Nn4yTxXFKvgh2txJFNweaVcfUPQxwEUFw4aWsCmfiBDJsTSwviIF8EcwjQ6k8bPyMWCl1vw4BdxE569Cg==}
'@resvg/resvg-wasm@2.4.1':
resolution: {integrity: sha512-yi6R0HyHtsoWTRA06Col4WoDs7SvlXU3DLMNP2bdAgs7HK18dTEVl1weXgxRzi8gwLteGUbIg29zulxIB3GSdg==}
engines: {node: '>= 10'}
'@rolldown/pluginutils@1.0.1':
@@ -5215,9 +5215,9 @@ packages:
peerDependencies:
valibot: ^1.4.0
'@vercel/og@0.8.6':
resolution: {integrity: sha512-hBcWIOppZV14bi+eAmCZj8Elj8hVSUZJTpf1lgGBhVD85pervzQ1poM/qYfFUlPraYSZYP+ASg6To5BwYmUSGQ==}
engines: {node: '>=16'}
'@vercel/og@1.0.3':
resolution: {integrity: sha512-/iYJ34PDu4lty1TXdL86qHEw8viveHTllG1PWLuJX8tSFfqKL7kyVJeUORJmQ250bHB0h+alcalXUlza3c/NSA==}
engines: {node: '>=22'}
'@vinext/types@1.0.0-beta.2':
resolution: {integrity: sha512-kbKY/H1RWlf7yox4G6Vwk1JeM6x0Tv1EAv28f3tDYkK3brq+89vp5eZHbdw3L/pZMbAhG4oFyhT9C976y+jkhQ==}
@@ -6060,8 +6060,8 @@ packages:
resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==}
engines: {node: '>=4'}
css-gradient-parser@0.0.16:
resolution: {integrity: sha512-3O5QdqgFRUbXvK1x5INf1YkBz1UKSWqrd63vWsum8MNHDBYD5urm3QtxZbKU259OrEXNM26lP/MPY3d1IGkBgA==}
css-gradient-parser@0.0.17:
resolution: {integrity: sha512-w2Xy9UMMwlKtou0vlRnXvWglPAceXCTtcmVSo8ZBUvqCV5aXEFP/PC6d+I464810I9FT++UACwTD5511bmGPUg==}
engines: {node: '>=16'}
css-select@5.2.2:
@@ -6826,6 +6826,9 @@ packages:
picomatch:
optional: true
fflate@0.7.3:
resolution: {integrity: sha512-0Zz1jOzJWERhyhsimS54VTqOteCNwRtIlh8isdL0AXLo0g7xNTfTL7oWrkmCnPhZGocKIkWHBistBrrpoNH3aw==}
fflate@0.7.4:
resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==}
@@ -6984,6 +6987,9 @@ packages:
resolution: {integrity: sha512-x/RzkpWO40bTjIoT30iQtt64FLLmH/iRcUCN2X//bLx7H3ifkdfPXyqsro/OYtqzIAhiLMMA7mmiOR9C3NOKjQ==}
engines: {node: '>=20.0.0'}
harfbuzzjs@0.10.0:
resolution: {integrity: sha512-SN8LVwCOzvTq3OPNd0+EAghgXugItz56wst567D1vs7LnnKGWprhi3EG58aVOBwhN8HEbQxL4I9NDWkcXUutRw==}
has-ansi@6.0.2:
resolution: {integrity: sha512-vAyM+6+jAYwSwz0/M0jYKfU9AvAMCz0kH791RsUhvMKGUHXled/3FjcQB3YiQ4Astj5srHdb6B2FHGIfZkOQNg==}
engines: {node: '>=18'}
@@ -8701,8 +8707,8 @@ packages:
safe-json-stringify@1.2.0:
resolution: {integrity: sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==}
satori@0.16.0:
resolution: {integrity: sha512-ZvHN3ygzZ8FuxjSNB+mKBiF/NIoqHzlBGbD0MJiT+MvSsFOvotnWOhdTjxKzhHRT2wPC1QbhLzx2q/Y83VhfYQ==}
satori@0.33.5:
resolution: {integrity: sha512-PNW6ktrQ8SM6kk7u4aOuTkkUewkzyTOrj+QeEzXSsnNMAdff4ire9CAqIz8+4C3rCiBtK8QTELv52AZEd1PbRw==}
engines: {node: '>=16'}
sax@1.6.1:
@@ -9336,8 +9342,8 @@ packages:
vfile@6.0.3:
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
vinext@1.0.0-beta.10:
resolution: {integrity: sha512-FsMlcoA23D69EVDYfJSRUVJ8hjRbgzOo5KBy1/ImCWtTWch+OjJlIaEzrontyEnkAo5ntnwl+wm476rOQyHhrQ==}
vinext@1.0.0-beta.13:
resolution: {integrity: sha512-jxicf8ssc2CKO7cVHR1VTzk8fW4yaz3Oqi36yksZsSUNAwtff3gK7Bpt7MGSTsFkBaEQ7h0Nt4dWUh2HS0pjWg==}
engines: {node: '>=22'}
hasBin: true
peerDependencies:
@@ -11732,7 +11738,7 @@ snapshots:
dependencies:
react: 19.3.0
'@resvg/resvg-wasm@2.4.0': {}
'@resvg/resvg-wasm@2.4.1': {}
'@rolldown/pluginutils@1.0.1': {}
@@ -12695,10 +12701,14 @@ snapshots:
dependencies:
valibot: 1.4.2(@typescript/typescript6@6.0.2)
'@vercel/og@0.8.6':
'@vercel/og@1.0.3(@types/node@25.9.7)':
dependencies:
'@resvg/resvg-wasm': 2.4.0
satori: 0.16.0
'@resvg/resvg-wasm': 2.4.1
satori: 0.33.5
optionalDependencies:
sharp: 0.35.4(@types/node@25.9.7)
transitivePeerDependencies:
- '@types/node'
'@vinext/types@1.0.0-beta.2': {}
@@ -13513,7 +13523,7 @@ snapshots:
css-color-keywords@1.0.0: {}
css-gradient-parser@0.0.16: {}
css-gradient-parser@0.0.17: {}
css-select@5.2.2:
dependencies:
@@ -14460,6 +14470,8 @@ snapshots:
optionalDependencies:
picomatch: 4.0.7
fflate@0.7.3: {}
fflate@0.7.4: {}
fflate@0.8.3: {}
@@ -14600,6 +14612,8 @@ snapshots:
- bufferutil
- utf-8-validate
harfbuzzjs@0.10.0: {}
has-ansi@6.0.2:
dependencies:
ansi-regex: 6.2.2
@@ -16688,15 +16702,17 @@ snapshots:
safe-json-stringify@1.2.0: {}
satori@0.16.0:
satori@0.33.5:
dependencies:
'@shuding/opentype.js': 1.4.0-beta.0
css-background-parser: 0.1.0
css-box-shadow: 1.0.0-3
css-gradient-parser: 0.0.16
css-gradient-parser: 0.0.17
css-to-react-native: 3.2.0
emoji-regex-xs: 2.0.1
escape-html: 1.0.3
fflate: 0.7.3
harfbuzzjs: 0.10.0
linebreak: 1.1.0
parse-css-color: 0.2.1
postcss-value-parser: 4.2.0
@@ -17345,10 +17361,10 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
vinext@1.0.0-beta.10(@vitejs/plugin-react@6.1.1(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1)))(@vitejs/plugin-rsc@0.5.35(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0))(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(next@16.3.6(@babel/core@7.29.7(supports-color@11.0.0))(@playwright/test@1.62.1)(@types/node@25.9.7)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0):
vinext@1.0.0-beta.13(@types/node@25.9.7)(@vitejs/plugin-react@6.1.1(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1)))(@vitejs/plugin-rsc@0.5.35(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0))(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(next@16.3.6(@babel/core@7.29.7(supports-color@11.0.0))(@playwright/test@1.62.1)(@types/node@25.9.7)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0):
dependencies:
'@unpic/react': 1.0.2(next@16.3.6(@babel/core@7.29.7(supports-color@11.0.0))(@playwright/test@1.62.1)(@types/node@25.9.7)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
'@vercel/og': 0.8.6
'@vercel/og': 1.0.3(@types/node@25.9.7)
'@vinext/types': 1.0.0-beta.2
'@vitejs/plugin-react': 6.1.1(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))
ipaddr.js: 2.4.0
@@ -17362,6 +17378,7 @@ snapshots:
'@vitejs/plugin-rsc': 0.5.35(@voidzero-dev/vite-plus-core@1.0.0-rc.1(@types/node@25.9.7)(@typescript/typescript6@6.0.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.1))(react-dom@19.3.0(react@19.3.0))(react-server-dom-webpack@19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(react@19.3.0)
react-server-dom-webpack: 19.3.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
transitivePeerDependencies:
- '@types/node'
- next
vite-plugin-commonjs@0.10.4:
@@ -17979,7 +17996,7 @@ time:
unist-util-visit@5.1.0: '2026-01-22T19:02:58.977Z'
use-context-selector@2.0.0: '2024-05-06T11:23:59.259Z'
uuid@14.0.2: '2026-08-18T18:21:56.060Z'
vinext@1.0.0-beta.10: '2026-09-15T09:22:34.040Z'
vinext@1.0.0-beta.13: '2026-09-27T01:13:25.542Z'
vite-plugin-inspect@12.0.2: '2026-07-13T05:34:12.173Z'
vite-plus@1.0.0-rc.1: '2026-09-26T06:29:34.142Z'
vitest-browser-react@2.3.0: '2026-09-04T08:00:00.941Z'

View File

@@ -263,7 +263,7 @@ catalog:
unist-util-visit: 5.1.0
use-context-selector: 2.0.0
uuid: 14.0.2
vinext: 1.0.0-beta.10
vinext: 1.0.0-beta.13
vite: npm:@voidzero-dev/vite-plus-core@1.0.0-rc.1
vite-plugin-inspect: 12.0.2
vite-plus: 1.0.0-rc.1

View File

@@ -45,6 +45,24 @@ Open <http://localhost:3000> with your browser to see the result.
You can start editing the files under `web/app`.
The page auto-updates as you edit the file.
### Vinext toolchain
The workspace catalog pins vinext to `1.0.0-beta.13`. Following the
[versioned vinext guide], `dev:vinext` and `build:vinext` use the project-local
Vite+ CLI (`vp dev` / `vp build`); the vinext plugin owns the development and multi-environment build
lifecycle. Keep the Next.js scripts available for compatibility comparisons.
When upgrading, run the installed compatibility scanner and verify the application:
```bash
pnpm -C web exec vinext check
pnpm -C web run build:vinext
pnpm -C web run start:vinext
```
The scanner is a starting point; also check sign-in, redirects, and the workflows
affected by the upgrade. See the [vinext migration guide] for validation guidance.
## Deploy
### Deploy on server
@@ -73,6 +91,18 @@ If you want to customize the host and port:
pnpm -C web run start --port=3001 --host=0.0.0.0
```
### Vinext standalone Node server
`pnpm -C web run build:vinext` honors `output: 'standalone'` in `next.config.ts`
and emits `web/dist/standalone`. To run the self-contained production server:
```bash
HOST=0.0.0.0 PORT=3000 node web/dist/standalone/server.js
```
Vinext uses `HOST` for the bind address; Next.js standalone uses `HOSTNAME`.
Use `start:vinext` for local production testing. See [vinext Node deployment].
## Storybook
This project uses [Storybook] for UI component development.
@@ -120,4 +150,7 @@ The Dify community can be found on [Discord community], where you can ask questi
[Vite+]: https://viteplus.dev
[Vitest]: https://vitest.dev
[pnpm]: https://pnpm.io
[versioned vinext guide]: https://github.com/cloudflare/vinext/blob/vinext%401.0.0-beta.13/README.md
[vinext Node deployment]: https://vinext.dev/docs/deploying/other-platforms
[vinext migration guide]: https://vinext.dev/docs/getting-started/migrating
[vinext]: https://github.com/cloudflare/vinext

View File

@@ -3,7 +3,7 @@
The main CI calls **Web Bundle Analysis** when its Web style checks are required,
for both pull requests and merge queue entries. It builds the event's exact base
commit and the tested merge commit from `github.sha` in parallel. Both run the
complete existing `vinext build` pipeline, including the unused translations check.
complete `build:vinext` pipeline, including the unused translations check.
No SSR, reference-analysis, or standalone stage is skipped.
This replaces the separate Vinext build in Web Style. Static checks run alongside
@@ -64,7 +64,7 @@ Use it only in a disposable checkout, as CI does:
```sh
node web/scripts/bundle-analysis.ts instrument web
pnpm --dir web exec vinext build
pnpm --dir web run build:vinext
node web/scripts/bundle-analysis.ts collect web "$(git rev-parse HEAD)" /tmp/current.json
node web/scripts/bundle-analysis.ts compare /tmp/base.json /tmp/current.json /tmp/report.md
```

View File

@@ -12,11 +12,11 @@
"scripts": {
"analyze": "next experimental-analyze",
"build": "next build",
"build:vinext": "vinext build",
"build:vinext": "vp build",
"dev": "next dev",
"dev:inspect": "next dev --inspect",
"dev:proxy": "dev-proxy --config ./dev-proxy.config.ts --env-file ./.env.local",
"dev:vinext": "vinext dev",
"dev:vinext": "vp dev",
"gen-doc-paths": "node ./scripts/gen-doc-paths.ts && vp fmt types/doc-paths.ts",
"gen-icons": "pnpm --filter @dify/iconify-collections generate",
"gen-provider-initials": "node ./scripts/generate-provider-initials.ts",

View File

@@ -63,16 +63,6 @@ export default defineConfig(({ command, mode, isPreview }) => {
tailwindcss(),
react(),
vinext({ react: false }),
{
name: 'dify-css-asset-alias',
enforce: 'post',
// Prepend after Vinext's tsconfig aliases, which skip CSS resolution.
config: () => ({
resolve: {
alias: [{ find: '~@', replacement: projectRoot }],
},
}),
},
customI18nHmrPlugin({ injectTarget: rootClientInjectTarget }),
// reactGrabOpenFilePlugin({
// injectTarget: rootClientInjectTarget,
@@ -83,6 +73,7 @@ export default defineConfig(({ command, mode, isPreview }) => {
resolve: {
tsconfigPaths: true,
alias: [
{ find: '~@', replacement: projectRoot },
// Use the base64 build in Vite-based pipelines (vinext/vitest) to avoid wasm loader incompatibilities.
{ find: /^loro-crdt$/, replacement: 'loro-crdt/base64' },
],