Skip to content

Commit f8ef733

Browse files
Merge branch 'main' into fix-11427-0
2 parents ccf75e9 + 7c75cc3 commit f8ef733

File tree

22 files changed

+233
-42
lines changed

22 files changed

+233
-42
lines changed

.github/workflows/release-tag.yml renamed to .github/workflows/release-gh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
tags:
44
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
55

6-
name: Create Release
6+
name: Create GH Release for Tag
77

88
permissions: {}
99
jobs:

.github/workflows/release.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to publish'
8+
required: true
9+
default: 'main'
10+
type: choice
11+
options:
12+
- main
13+
- minor
14+
bump:
15+
description: 'Bump version'
16+
required: true
17+
default: 'patch'
18+
type: choice
19+
options:
20+
- patch
21+
- minor
22+
- prepatch
23+
- preminor
24+
- custom
25+
custom_version:
26+
description: 'Custom version'
27+
required: false
28+
default: ''
29+
type: string
30+
31+
jobs:
32+
release:
33+
# prevents this action from running on forks
34+
if: github.repository == 'vuejs/core'
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write
38+
id-token: write
39+
# Use Release environment for deployment protection
40+
environment: Release
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
with:
45+
ref: ${{ inputs.branch }}
46+
47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v4
49+
50+
- name: Install Node.js
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version-file: '.node-version'
54+
registry-url: 'https://registry.npmjs.org'
55+
cache: 'pnpm'
56+
57+
- name: Install deps
58+
run: pnpm install
59+
60+
- name: Configure git user as vue bot
61+
run: |
62+
git config user.name "vue-bot"
63+
git config user.email "<[email protected]>"
64+
65+
- name: Import GPG key
66+
uses: crazy-max/ghaction-import-gpg@v6
67+
with:
68+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
69+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
70+
git_user_signingkey: true
71+
git_commit_gpgsign: true
72+
73+
- name: Run release script
74+
id: release
75+
run: |
76+
pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts
77+
RELEASE_TAG=$(git describe --tags --abbrev=0)
78+
echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
82+
- name: Push tags
83+
run: git push -u origin ${{ inputs.branch }} --follow-tags
84+
85+
- name: Create Release for Tag
86+
id: release_tag
87+
uses: yyx990803/release-tag@master
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
with:
91+
tag_name: ${{ steps.release.outputs.tag }}
92+
body: |
93+
For stable releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details.
94+
For pre-releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/minor/CHANGELOG.md) of the `minor` branch.

.github/workflows/size-data.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- minor
78
pull_request:
89
branches:
910
- main

.github/workflows/size-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Download Previous Size Data
5959
uses: dawidd6/action-download-artifact@v6
6060
with:
61-
branch: main
61+
branch: ${{ github.base_ref }}
6262
workflow: size-data.yml
6363
event: push
6464
name: size-data

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [3.4.36](https://github.com/vuejs/core/compare/v3.4.35...v3.4.36) (2024-08-06)
2+
3+
### Bug Fixes
4+
5+
* **compiler-core:** fix expression transform for try...catch block params ([077a1ae](https://github.com/vuejs/core/commit/077a1aeb3c222b729a7e190f46864656ecc65325)), closes [#11465](https://github.com/vuejs/core/issues/11465) [#11467](https://github.com/vuejs/core/issues/11467)
6+
* **compiler-core:** properly handle for loop variable declarations in expression transforms ([67bb820](https://github.com/vuejs/core/commit/67bb820904d53480fa37536fc3cb4109a4c6d3e2)), ref [#11467](https://github.com/vuejs/core/issues/11467)
7+
* **compiler-ssr:** don't render v-if comments in TransitionGroup + static tag ([#11515](https://github.com/vuejs/core/issues/11515)) ([275354c](https://github.com/vuejs/core/commit/275354caba295a6fb50695b70e97888a33c504e0)), closes [#11514](https://github.com/vuejs/core/issues/11514)
8+
* **hydration:** force hydrate custom element dynamic props ([7d473b7](https://github.com/vuejs/core/commit/7d473b7721b423050dba62823b16f3d39e640567)), closes [#7203](https://github.com/vuejs/core/issues/7203) [#8038](https://github.com/vuejs/core/issues/8038)
9+
* **ssr:** respect textContent/innerHTML from getSSRProps in optimized SSR output ([79602f9](https://github.com/vuejs/core/commit/79602f9ecd9559954f844774a90286305b13e056)), closes [#8112](https://github.com/vuejs/core/issues/8112)
10+
* **types/withDefaults:** ensure default values of type `any` do not include `undefined` ([#11490](https://github.com/vuejs/core/issues/11490)) ([4592b63](https://github.com/vuejs/core/commit/4592b63c6a8a3d69bfe4ac1f9458b4a86a9676a4))
11+
12+
13+
114
## [3.4.35](https://github.com/vuejs/core/compare/v3.4.34...v3.4.35) (2024-07-31)
215

316

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"packageManager": "[email protected]",
55
"type": "module",
66
"scripts": {

packages/compiler-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

packages/compiler-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-sfc",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/compiler-sfc",
55
"main": "dist/compiler-sfc.cjs.js",
66
"module": "dist/compiler-sfc.esm-browser.js",

packages/compiler-ssr/__tests__/ssrElement.spec.ts

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -288,55 +288,78 @@ describe('ssr: element', () => {
288288
}></div>\`"
289289
`)
290290
})
291+
})
291292

292-
test('custom dir', () => {
293+
describe('custom directives', () => {
294+
// #8112 should respect textContent / innerHTML from directive getSSRProps
295+
// if the element has no children
296+
test('custom dir without children', () => {
293297
expect(getCompiledString(`<div v-xxx:x.y="z" />`)).toMatchInlineSnapshot(`
298+
"\`<div\${
299+
_ssrRenderAttrs(_temp0 = _ssrGetDirectiveProps(_ctx, _directive_xxx, _ctx.z, "x", { y: true }))
300+
}>\${
301+
("textContent" in _temp0) ? _ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ''
302+
}</div>\`"
303+
`)
304+
})
305+
306+
test('custom dir with children', () => {
307+
expect(getCompiledString(`<div v-xxx:x.y="z">hello</div>`))
308+
.toMatchInlineSnapshot(`
294309
"\`<div\${
295310
_ssrRenderAttrs(_ssrGetDirectiveProps(_ctx, _directive_xxx, _ctx.z, "x", { y: true }))
296-
}></div>\`"
311+
}>hello</div>\`"
297312
`)
298313
})
299314

300315
test('custom dir with normal attrs', () => {
301316
expect(getCompiledString(`<div class="foo" v-xxx />`))
302317
.toMatchInlineSnapshot(`
303318
"\`<div\${
304-
_ssrRenderAttrs(_mergeProps({ class: "foo" }, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
305-
}></div>\`"
319+
_ssrRenderAttrs(_temp0 = _mergeProps({ class: "foo" }, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
320+
}>\${
321+
("textContent" in _temp0) ? _ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ''
322+
}</div>\`"
306323
`)
307324
})
308325

309326
test('custom dir with v-bind', () => {
310327
expect(getCompiledString(`<div :title="foo" :class="bar" v-xxx />`))
311328
.toMatchInlineSnapshot(`
312-
"\`<div\${
313-
_ssrRenderAttrs(_mergeProps({
314-
title: _ctx.foo,
315-
class: _ctx.bar
316-
}, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
317-
}></div>\`"
318-
`)
329+
"\`<div\${
330+
_ssrRenderAttrs(_temp0 = _mergeProps({
331+
title: _ctx.foo,
332+
class: _ctx.bar
333+
}, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
334+
}>\${
335+
("textContent" in _temp0) ? _ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ''
336+
}</div>\`"
337+
`)
319338
})
320339

321340
test('custom dir with object v-bind', () => {
322341
expect(getCompiledString(`<div v-bind="x" v-xxx />`))
323342
.toMatchInlineSnapshot(`
324-
"\`<div\${
325-
_ssrRenderAttrs(_mergeProps(_ctx.x, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
326-
}></div>\`"
327-
`)
343+
"\`<div\${
344+
_ssrRenderAttrs(_temp0 = _mergeProps(_ctx.x, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
345+
}>\${
346+
("textContent" in _temp0) ? _ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ''
347+
}</div>\`"
348+
`)
328349
})
329350

330351
test('custom dir with object v-bind + normal bindings', () => {
331352
expect(
332353
getCompiledString(`<div v-bind="x" class="foo" v-xxx title="bar" />`),
333354
).toMatchInlineSnapshot(`
334355
"\`<div\${
335-
_ssrRenderAttrs(_mergeProps(_ctx.x, {
356+
_ssrRenderAttrs(_temp0 = _mergeProps(_ctx.x, {
336357
class: "foo",
337358
title: "bar"
338359
}, _ssrGetDirectiveProps(_ctx, _directive_xxx)))
339-
}></div>\`"
360+
}>\${
361+
("textContent" in _temp0) ? _ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ''
362+
}</div>\`"
340363
`)
341364
})
342365
})

packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ describe('transition-group', () => {
3838
`)
3939
})
4040

41+
// #11514
42+
test('with static tag + comment', () => {
43+
expect(
44+
compile(
45+
`<transition-group tag="ul"><div v-for="i in list"/><div v-if="false"></div></transition-group>`,
46+
).code,
47+
).toMatchInlineSnapshot(`
48+
"const { ssrRenderAttrs: _ssrRenderAttrs, ssrRenderList: _ssrRenderList } = require("vue/server-renderer")
49+
50+
return function ssrRender(_ctx, _push, _parent, _attrs) {
51+
_push(\`<ul\${_ssrRenderAttrs(_attrs)}>\`)
52+
_ssrRenderList(_ctx.list, (i) => {
53+
_push(\`<div></div>\`)
54+
})
55+
if (false) {
56+
_push(\`<div></div>\`)
57+
}
58+
_push(\`</ul>\`)
59+
}"
60+
`)
61+
})
62+
4163
test('with dynamic tag', () => {
4264
expect(
4365
compile(

packages/compiler-ssr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-ssr",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/compiler-ssr",
55
"main": "dist/compiler-ssr.cjs.js",
66
"types": "dist/compiler-ssr.d.ts",

packages/compiler-ssr/src/transforms/ssrTransformElement.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,25 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
163163
]),
164164
]
165165
}
166+
} else if (directives.length && !node.children.length) {
167+
const tempId = `_temp${context.temps++}`
168+
propsExp.arguments = [
169+
createAssignmentExpression(
170+
createSimpleExpression(tempId, false),
171+
mergedProps,
172+
),
173+
]
174+
rawChildrenMap.set(
175+
node,
176+
createConditionalExpression(
177+
createSimpleExpression(`"textContent" in ${tempId}`, false),
178+
createCallExpression(context.helper(SSR_INTERPOLATE), [
179+
createSimpleExpression(`${tempId}.textContent`, false),
180+
]),
181+
createSimpleExpression(`${tempId}.innerHTML ?? ''`, false),
182+
false,
183+
),
184+
)
166185
}
167186

168187
if (needTagForRuntime) {

packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function ssrProcessTransitionGroup(
108108
context.pushStringPart(` ${scopeId}`)
109109
}
110110
context.pushStringPart(`>`)
111-
processChildren(node, context, false, true)
111+
processChildren(node, context, false, true, true)
112112
context.pushStringPart(`</${tag.value!.content}>`)
113113
}
114114
} else {

packages/reactivity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/reactivity",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/reactivity",
55
"main": "index.js",
66
"module": "dist/reactivity.esm-bundler.js",

packages/runtime-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/runtime-core",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/runtime-core",
55
"main": "index.js",
66
"module": "dist/runtime-core.esm-bundler.js",

packages/runtime-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/runtime-dom",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/runtime-dom",
55
"main": "index.js",
66
"module": "dist/runtime-dom.esm-bundler.js",

packages/server-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/server-renderer",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "@vue/server-renderer",
55
"main": "index.js",
66
"module": "dist/server-renderer.esm-bundler.js",

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/shared",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "internal utils shared across @vue packages",
55
"main": "index.js",
66
"module": "dist/shared.esm-bundler.js",

packages/vue-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compat",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "Vue 3 compatibility build for Vue 2",
55
"main": "index.js",
66
"module": "dist/vue.runtime.esm-bundler.js",

packages/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "3.4.35",
3+
"version": "3.4.36",
44
"description": "The progressive JavaScript framework for building modern web UI.",
55
"main": "index.js",
66
"module": "dist/vue.runtime.esm-bundler.js",

0 commit comments

Comments
 (0)