Skip to content

Commit aff3706

Browse files
authored
Merge branch 'main' into fix-initialize-compiler-correctly
2 parents 851d8a1 + 59946d3 commit aff3706

32 files changed

+2172
-1869
lines changed

.github/workflows/release-continuous.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ jobs:
99
- name: Checkout code
1010
uses: actions/checkout@v4
1111

12-
- run: corepack enable
12+
- name: Install pnpm
13+
uses: pnpm/[email protected]
14+
1315
- uses: actions/setup-node@v4
1416
with:
1517
node-version: lts/*

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,34 @@
3636
"ci-publish": "tsx scripts/publishCI.ts"
3737
},
3838
"devDependencies": {
39-
"@babel/types": "^7.26.0",
40-
"@eslint/js": "^9.14.0",
39+
"@babel/types": "^7.26.7",
40+
"@eslint/js": "^9.19.0",
4141
"@types/babel__core": "^7.20.5",
4242
"@types/convert-source-map": "^2.0.3",
4343
"@types/debug": "^4.1.12",
4444
"@types/fs-extra": "^11.0.4",
45-
"@types/node": "^22.9.0",
46-
"@vitejs/release-scripts": "^1.3.2",
45+
"@types/node": "^22.13.1",
46+
"@vitejs/release-scripts": "^1.3.3",
4747
"conventional-changelog-cli": "^5.0.0",
48-
"eslint": "^9.14.0",
49-
"eslint-plugin-import-x": "^4.4.0",
50-
"eslint-plugin-n": "^17.13.1",
51-
"eslint-plugin-regexp": "^2.6.0",
52-
"execa": "^9.5.1",
53-
"fs-extra": "^11.2.0",
54-
"lint-staged": "^15.2.10",
55-
"npm-run-all2": "^7.0.1",
48+
"eslint": "^9.19.0",
49+
"eslint-plugin-import-x": "^4.6.1",
50+
"eslint-plugin-n": "^17.15.1",
51+
"eslint-plugin-regexp": "^2.7.0",
52+
"execa": "^9.5.2",
53+
"fs-extra": "^11.3.0",
54+
"lint-staged": "^15.4.3",
55+
"npm-run-all2": "^7.0.2",
5656
"picocolors": "^1.1.1",
57-
"playwright-chromium": "^1.48.2",
58-
"prettier": "3.3.3",
59-
"rollup": "^4.25.0",
57+
"playwright-chromium": "^1.50.1",
58+
"prettier": "3.4.2",
59+
"rollup": "^4.34.9",
6060
"simple-git-hooks": "^2.11.1",
6161
"tsx": "^4.19.2",
62-
"typescript": "^5.6.3",
63-
"typescript-eslint": "^8.13.0",
64-
"unbuild": "2.0.0",
62+
"typescript": "^5.7.3",
63+
"typescript-eslint": "^8.23.0",
64+
"unbuild": "3.3.1",
6565
"vite": "catalog:",
66-
"vitest": "^2.1.4",
66+
"vitest": "^2.1.9",
6767
"vue": "catalog:"
6868
},
6969
"simple-git-hooks": {
@@ -83,7 +83,7 @@
8383
"eslint --cache --fix"
8484
]
8585
},
86-
"packageManager": "pnpm@9.12.3",
86+
"packageManager": "pnpm@9.15.5",
8787
"pnpm": {
8888
"overrides": {
8989
"@vitejs/plugin-vue": "workspace:*"

packages/plugin-vue-jsx/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## <small>4.1.1 (2024-11-26)</small>
2+
3+
* chore: add vite 6 peer dep (#481) ([4288652](https://github.com/vitejs/vite-plugin-vue/commit/4288652)), closes [#481](https://github.com/vitejs/vite-plugin-vue/issues/481)
4+
5+
6+
17
## 4.1.0 (2024-11-11)
28

39
* feat: support tsPluginOptions (#445) ([fdb3590](https://github.com/vitejs/vite-plugin-vue/commit/fdb3590)), closes [#445](https://github.com/vitejs/vite-plugin-vue/issues/445)

packages/plugin-vue-jsx/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-vue-jsx",
3-
"version": "4.1.0",
3+
"version": "4.1.1",
44
"type": "commonjs",
55
"license": "MIT",
66
"author": "Evan You",
@@ -35,15 +35,15 @@
3535
},
3636
"homepage": "https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx#readme",
3737
"dependencies": {
38-
"@babel/core": "^7.26.0",
39-
"@babel/plugin-transform-typescript": "^7.25.9",
38+
"@babel/core": "^7.26.7",
39+
"@babel/plugin-transform-typescript": "^7.26.7",
4040
"@vue/babel-plugin-jsx": "^1.2.5"
4141
},
4242
"devDependencies": {
4343
"vite": "catalog:"
4444
},
4545
"peerDependencies": {
46-
"vite": "^5.0.0",
46+
"vite": "^5.0.0 || ^6.0.0",
4747
"vue": "^3.0.0"
4848
}
4949
}

packages/plugin-vue/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## <small>5.2.1 (2024-11-26)</small>
2+
3+
* chore: add vite 6 peer dep (#481) ([4288652](https://github.com/vitejs/vite-plugin-vue/commit/4288652)), closes [#481](https://github.com/vitejs/vite-plugin-vue/issues/481)
4+
* chore: fix lint ([378aea3](https://github.com/vitejs/vite-plugin-vue/commit/378aea3))
5+
* chore(deps): update dependency rollup to ^4.27.2 (#476) ([b2df95e](https://github.com/vitejs/vite-plugin-vue/commit/b2df95e)), closes [#476](https://github.com/vitejs/vite-plugin-vue/issues/476)
6+
7+
8+
19
## 5.2.0 (2024-11-13)
210

311
* feat: add a feature option to support custom component id generator (#461) ([7a1fc4c](https://github.com/vitejs/vite-plugin-vue/commit/7a1fc4c)), closes [#461](https://github.com/vitejs/vite-plugin-vue/issues/461)

packages/plugin-vue/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-vue",
3-
"version": "5.2.0",
3+
"version": "5.2.1",
44
"type": "commonjs",
55
"license": "MIT",
66
"author": "Evan You",
@@ -35,14 +35,14 @@
3535
},
3636
"homepage": "https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#readme",
3737
"peerDependencies": {
38-
"vite": "^5.0.0",
38+
"vite": "^5.0.0 || ^6.0.0",
3939
"vue": "^3.2.25"
4040
},
4141
"devDependencies": {
42-
"@jridgewell/gen-mapping": "^0.3.5",
42+
"@jridgewell/gen-mapping": "^0.3.8",
4343
"@jridgewell/trace-mapping": "^0.3.25",
44-
"debug": "^4.3.7",
45-
"rollup": "^4.25.0",
44+
"debug": "^4.4.0",
45+
"rollup": "^4.34.9",
4646
"slash": "^5.1.0",
4747
"source-map-js": "^1.2.1",
4848
"vite": "catalog:",

packages/plugin-vue/src/index.ts

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,18 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
242242
dedupe: config.build?.ssr ? [] : ['vue'],
243243
},
244244
define: {
245-
__VUE_OPTIONS_API__: !!(
246-
(options.value.features?.optionsAPI ?? true) ||
247-
config.define?.__VUE_OPTIONS_API__
248-
),
249-
__VUE_PROD_DEVTOOLS__: !!(
250-
options.value.features?.prodDevtools ||
251-
config.define?.__VUE_PROD_DEVTOOLS__
252-
),
253-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: !!(
254-
options.value.features?.prodHydrationMismatchDetails ||
255-
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
256-
),
245+
__VUE_OPTIONS_API__:
246+
options.value.features?.optionsAPI ??
247+
config.define?.__VUE_OPTIONS_API__ ??
248+
true,
249+
__VUE_PROD_DEVTOOLS__:
250+
(options.value.features?.prodDevtools ||
251+
config.define?.__VUE_PROD_DEVTOOLS__) ??
252+
false,
253+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
254+
(options.value.features?.prodHydrationMismatchDetails ||
255+
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__) ??
256+
false,
257257
},
258258
ssr: {
259259
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
@@ -279,6 +279,20 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
279279
!config.isProduction
280280
),
281281
}
282+
283+
// #507 suppress warnings for non-recognized pseudo selectors from lightningcss
284+
const _warn = config.logger.warn
285+
config.logger.warn = (...args) => {
286+
const msg = args[0]
287+
if (
288+
msg.match(
289+
/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/,
290+
)
291+
) {
292+
return
293+
}
294+
_warn(...args)
295+
}
282296
},
283297

284298
configureServer(server) {
@@ -307,11 +321,12 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
307321
},
308322

309323
load(id, opt) {
310-
const ssr = opt?.ssr === true
311324
if (id === EXPORT_HELPER_ID) {
312325
return helperCode
313326
}
314327

328+
const ssr = opt?.ssr === true
329+
315330
const { filename, query } = parseVueRequest(id)
316331

317332
// select corresponding block for sub-part virtual modules
@@ -374,6 +389,10 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
374389
getTempSrcDescriptor(filename, query)
375390
: getDescriptor(filename, options.value)!
376391

392+
if (query.src) {
393+
this.addWatchFile(filename)
394+
}
395+
377396
if (query.type === 'template') {
378397
return transformTemplateAsModule(
379398
code,

packages/plugin-vue/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ async function genScriptCode(
345345
code: string
346346
map: RawSourceMap | undefined
347347
}> {
348-
let scriptCode = `const ${scriptIdentifier} = {}`
348+
// @ts-expect-error TODO remove when 3.6 is out
349+
const vaporFlag = descriptor.vapor ? '__vapor: true' : ''
350+
let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`
349351
let map: RawSourceMap | undefined
350352

351353
const script = resolveScript(descriptor, options, ssr, customElement)

packages/plugin-vue/src/script.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ export function resolveScript(
6969
return cached
7070
}
7171

72-
let resolved: SFCScriptBlock | null = null
73-
74-
resolved = options.compiler.compileScript(descriptor, {
72+
const resolved: SFCScriptBlock = options.compiler.compileScript(descriptor, {
7573
...options.script,
7674
id: descriptor.id,
7775
isProd: options.isProduction,

packages/plugin-vue/src/template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ export function resolveTemplateCompilerOptions(
187187

188188
return {
189189
...options.template,
190+
// @ts-expect-error TODO remove when 3.6 is out
191+
vapor: descriptor.vapor,
190192
id,
191193
ast: canReuseAST(options.compiler.version)
192194
? descriptor.template?.ast

0 commit comments

Comments
 (0)