Skip to content

Commit 49df7e0

Browse files
authored
Merge branch 'main' into fix-slots-level
2 parents 7688d05 + 4be49b2 commit 49df7e0

File tree

27 files changed

+640
-402
lines changed

27 files changed

+640
-402
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [3.4.30](https://github.com/vuejs/core/compare/v3.4.29...v3.4.30) (2024-06-22)
2+
3+
4+
### Bug Fixes
5+
6+
* **compiler-core:** should not remove slot node with `v-else` ([#11150](https://github.com/vuejs/core/issues/11150)) ([e102670](https://github.com/vuejs/core/commit/e102670bde00417c3a5b0262c855b297c0e4169e))
7+
* **hydration:** fix css vars hydration mismatch false positive on attr-fallthrough ([#11190](https://github.com/vuejs/core/issues/11190)) ([7ad67ce](https://github.com/vuejs/core/commit/7ad67ced26e5f53a47cb42f4834496e4958cb53b)), closes [#11188](https://github.com/vuejs/core/issues/11188)
8+
* **hydration:** skip prop mismatch check for directives that mutate DOM in created ([3169c91](https://github.com/vuejs/core/commit/3169c914939d02a013b2938aff30dac8525923f8)), closes [#11189](https://github.com/vuejs/core/issues/11189)
9+
* **reactivity:** fix side effect computed dirty level ([#11183](https://github.com/vuejs/core/issues/11183)) ([3bd79e3](https://github.com/vuejs/core/commit/3bd79e3e5ed960fc42cbf77bc61a97d2c03557c0)), closes [#11181](https://github.com/vuejs/core/issues/11181) [#11169](https://github.com/vuejs/core/issues/11169)
10+
* **runtime-core:** ensure unmount dynamic components in optimized mode ([#11171](https://github.com/vuejs/core/issues/11171)) ([220fe24](https://github.com/vuejs/core/commit/220fe247484209e62c7f4991902c5335e29c5007)), closes [#11168](https://github.com/vuejs/core/issues/11168)
11+
* **runtime-core:** update devtool __vnode on patch, avoid memory leak during dev ([a959781](https://github.com/vuejs/core/commit/a959781dd6f609dcb6f16dd7fa47d3b16895e5ca)), closes [#11192](https://github.com/vuejs/core/issues/11192)
12+
* **runtime-dom:** ensure only symbols are explicitly stringified during attribute patching ([#11182](https://github.com/vuejs/core/issues/11182)) ([a2e35d6](https://github.com/vuejs/core/commit/a2e35d682db15a592f4270bb0cde70a0e7bdc4a6)), closes [#11177](https://github.com/vuejs/core/issues/11177)
13+
* **runtime-dom:** prevent setting state as attribute for custom elements ([#11165](https://github.com/vuejs/core/issues/11165)) ([8ae4c29](https://github.com/vuejs/core/commit/8ae4c293adcec28f18114cb6016230a86787e6a9)), closes [#11163](https://github.com/vuejs/core/issues/11163)
14+
15+
16+
### Performance Improvements
17+
18+
* **reactivity:** cache tracking value ([#11145](https://github.com/vuejs/core/issues/11145)) ([7936dae](https://github.com/vuejs/core/commit/7936daebceab2ae9461c3b8f256e51020fb7d3ed))
19+
20+
21+
122
## [3.4.29](https://github.com/vuejs/core/compare/v3.4.28...v3.4.29) (2024-06-14)
223

324

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"version": "3.0.0-vapor",
4-
"packageManager": "pnpm@9.2.0",
4+
"packageManager": "pnpm@9.3.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js vue vue-vapor",
@@ -67,36 +67,36 @@
6767
"@rollup/plugin-json": "^6.1.0",
6868
"@rollup/plugin-node-resolve": "^15.2.3",
6969
"@rollup/plugin-replace": "5.0.4",
70-
"@rollup/plugin-terser": "^0.4.4",
70+
"@swc/core": "^1.6.1",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
7373
"@types/node": "^20.14.2",
7474
"@types/semver": "^7.5.8",
75-
"@vitest/coverage-istanbul": "^1.5.2",
76-
"@vitest/ui": "^1.5.2",
75+
"@vitest/coverage-istanbul": "^1.6.0",
76+
"@vitest/ui": "^1.6.0",
7777
"@vue/consolidate": "1.0.0",
7878
"conventional-changelog-cli": "^4.1.0",
7979
"enquirer": "^2.4.1",
8080
"esbuild": "^0.21.5",
8181
"esbuild-plugin-polyfill-node": "^0.3.0",
82-
"eslint": "^9.4.0",
82+
"eslint": "^9.5.0",
8383
"eslint-plugin-import-x": "^0.5.1",
8484
"eslint-plugin-vitest": "^0.5.4",
8585
"estree-walker": "^2.0.2",
8686
"execa": "^9.2.0",
87-
"jsdom": "^24.0.0",
88-
"lint-staged": "^15.2.5",
87+
"jsdom": "^24.1.0",
88+
"lint-staged": "^15.2.7",
8989
"lodash": "^4.17.21",
9090
"magic-string": "^0.30.10",
9191
"markdown-table": "^3.0.3",
9292
"marked": "^12.0.2",
9393
"minimist": "^1.2.8",
9494
"npm-run-all2": "^6.2.0",
9595
"picocolors": "^1.0.1",
96-
"prettier": "^3.3.1",
96+
"prettier": "^3.3.2",
9797
"pretty-bytes": "^6.1.1",
9898
"pug": "^3.0.3",
99-
"puppeteer": "~22.7.1",
99+
"puppeteer": "~22.11.0",
100100
"rimraf": "^5.0.7",
101101
"rollup": "^4.18.0",
102102
"rollup-plugin-dts": "^6.1.1",
@@ -108,11 +108,11 @@
108108
"terser": "^5.31.1",
109109
"todomvc-app-css": "^2.4.3",
110110
"tslib": "^2.6.3",
111-
"tsx": "^4.15.1",
111+
"tsx": "^4.15.5",
112112
"typescript": "~5.4.5",
113-
"typescript-eslint": "^7.12.0",
114-
"vite": "^5.2.13",
115-
"vitest": "^1.5.2"
113+
"typescript-eslint": "^7.13.0",
114+
"vite": "^5.3.1",
115+
"vitest": "^1.6.0"
116116
},
117117
"pnpm": {
118118
"peerDependencyRules": {

packages/compiler-core/__tests__/transforms/vSlot.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ describe('compiler: transform component slots', () => {
696696
expect((root as any).children[0].codegenNode.patchFlag).toMatch(
697697
PatchFlags.DYNAMIC_SLOTS + '',
698698
)
699+
expect((root as any).children[0].children.length).toBe(3)
699700
expect(generate(root).code).toMatchSnapshot()
700701
})
701702

packages/compiler-core/src/compat/transformFilter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ export const transformFilter: NodeTransform = (node, context) => {
2525
// filter rewrite is applied before expression transform so only
2626
// simple expressions are possible at this stage
2727
rewriteFilter(node.content, context)
28-
}
29-
30-
if (node.type === NodeTypes.ELEMENT) {
28+
} else if (node.type === NodeTypes.ELEMENT) {
3129
node.props.forEach((prop: AttributeNode | DirectiveNode) => {
3230
if (
3331
prop.type === NodeTypes.DIRECTIVE &&

packages/compiler-core/src/transforms/vSlot.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ export function buildSlots(
226226
break
227227
}
228228
}
229-
if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
230-
// remove node
231-
children.splice(i, 1)
232-
i--
229+
if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
233230
__TEST__ && assert(dynamicSlots.length > 0)
234231
// attach this slot to previous conditional
235232
let conditional = dynamicSlots[

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@
6363
"postcss-modules": "^6.0.0",
6464
"postcss-selector-parser": "^6.1.0",
6565
"pug": "^3.0.3",
66-
"sass": "^1.77.4"
66+
"sass": "^1.77.5"
6767
}
6868
}

packages/reactivity/__tests__/computed.spec.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,57 @@ describe('reactivity/computed', () => {
853853
expect(calls).toMatchObject(['b eval', 'mounted', 'b eval'])
854854
})
855855

856+
it('should chained computeds keep reactivity when computed effect happens', async () => {
857+
const v = ref('Hello')
858+
const c = computed(() => {
859+
v.value += ' World'
860+
return v.value
861+
})
862+
const d = computed(() => c.value)
863+
const e = computed(() => d.value)
864+
const Comp = {
865+
setup: () => {
866+
return () => d.value + ' | ' + e.value
867+
},
868+
}
869+
const root = nodeOps.createElement('div')
870+
871+
render(h(Comp), root)
872+
await nextTick()
873+
expect(serializeInner(root)).toBe('Hello World | Hello World')
874+
875+
v.value += ' World'
876+
await nextTick()
877+
expect(serializeInner(root)).toBe(
878+
'Hello World World World | Hello World World World',
879+
)
880+
})
881+
882+
it('should keep dirty level when side effect computed value changed', () => {
883+
const v = ref(0)
884+
const c = computed(() => {
885+
v.value += 1
886+
return v.value
887+
})
888+
const d = computed(() => {
889+
return { d: c.value }
890+
})
891+
892+
const Comp = {
893+
setup: () => {
894+
return () => {
895+
return [d.value.d, d.value.d]
896+
}
897+
},
898+
}
899+
900+
const root = nodeOps.createElement('div')
901+
render(h(Comp), root)
902+
903+
expect(d.value.d).toBe(1)
904+
expect(serializeInner(root)).toBe('11')
905+
})
906+
856907
it('debug: onTrigger (ref)', () => {
857908
let events: DebuggerEvent[] = []
858909
const onTrigger = vi.fn((e: DebuggerEvent) => {

packages/runtime-core/__tests__/apiInject.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
} from '../src/index'
1414
import { createApp, nodeOps, render, serialize } from '@vue/runtime-test'
1515

16-
// reference: https://vue-composition-api-rfc.netlify.com/api.html#provide-inject
1716
describe('api: provide/inject', () => {
1817
it('string keys', () => {
1918
const Provider = {

packages/runtime-core/__tests__/apiLifecycle.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import {
2424
TriggerOpTypes,
2525
} from '@vue/reactivity'
2626

27-
// reference: https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks
28-
2927
describe('api: lifecycle hooks', () => {
3028
it('onBeforeMount', () => {
3129
const root = nodeOps.createElement('div')

packages/runtime-core/__tests__/apiSetupContext.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {
1212
watchEffect,
1313
} from '@vue/runtime-test'
1414

15-
// reference: https://vue-composition-api-rfc.netlify.com/api.html#setup
16-
1715
describe('api: setup context', () => {
1816
it('should expose return values to template render context', () => {
1917
const Comp = defineComponent({

0 commit comments

Comments
 (0)