Skip to content

Commit bc74137

Browse files
authored
Merge branch 'main' into feat-computed-side-effect-warn
2 parents 43e2ea8 + b99ac93 commit bc74137

File tree

8 files changed

+52
-57
lines changed

8 files changed

+52
-57
lines changed

.github/renovate.json5

+4
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,9 @@
4646

4747
// ESM only
4848
'estree-walker',
49+
50+
// pinned
51+
// https://github.com/vuejs/core/issues/10300#issuecomment-1940855364
52+
'lru-cache'
4953
],
5054
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"markdown-table": "^3.0.3",
9494
"marked": "^11.2.0",
9595
"minimist": "^1.2.8",
96-
"npm-run-all2": "^5.0.2",
96+
"npm-run-all2": "^6.1.2",
9797
"picocolors": "^1.0.0",
9898
"prettier": "^3.2.2",
9999
"pretty-bytes": "^6.1.1",

packages/compiler-sfc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@babel/types": "^7.23.9",
5757
"@vue/consolidate": "^0.17.3",
5858
"hash-sum": "^2.0.0",
59-
"lru-cache": "^10.2.0",
59+
"lru-cache": "10.1.0",
6060
"merge-source-map": "^1.1.0",
6161
"minimatch": "^9.0.3",
6262
"postcss-modules": "^6.0.0",

packages/runtime-core/src/componentProps.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,23 @@ function validatePropName(key: string) {
597597
// use function string name to check type constructors
598598
// so that it works across vms / iframes.
599599
function getType(ctor: Prop<any>): string {
600-
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/)
601-
return match ? match[2] : ctor === null ? 'null' : ''
600+
// Early return for null to avoid unnecessary computations
601+
if (ctor === null) {
602+
return 'null'
603+
}
604+
605+
// Avoid using regex for common cases by checking the type directly
606+
if (typeof ctor === 'function') {
607+
// Using name property to avoid converting function to string
608+
return ctor.name || ''
609+
} else if (typeof ctor === 'object') {
610+
// Attempting to directly access constructor name if possible
611+
const name = ctor.constructor && ctor.constructor.name
612+
return name || ''
613+
}
614+
615+
// Fallback for other types (though they're less likely to have meaningful names here)
616+
return ''
602617
}
603618

604619
function isSameType(a: Prop<any>, b: Prop<any>): boolean {

packages/runtime-core/src/errorHandling.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ export function callWithErrorHandling(
6666
type: ErrorTypes,
6767
args?: unknown[],
6868
) {
69-
let res
7069
try {
71-
res = args ? fn(...args) : fn()
70+
return args ? fn(...args) : fn()
7271
} catch (err) {
7372
handleError(err, instance, type)
7473
}
75-
return res
7674
}
7775

7876
export function callWithAsyncErrorHandling(

packages/runtime-dom/src/directives/vShow.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export const vShow: ObjectDirective<VShowElement> & { name?: 'show' } = {
2222
}
2323
},
2424
updated(el, { value, oldValue }, { transition }) {
25-
if (!value === !oldValue && el.style.display === el[vShowOldKey]) return
25+
if (
26+
!value === !oldValue &&
27+
(el.style.display === el[vShowOldKey] || !value)
28+
)
29+
return
2630
if (transition) {
2731
if (value) {
2832
transition.beforeEnter(el)

pnpm-lock.yaml

+22-48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/release.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ async function main() {
239239
if (!skipTests) {
240240
step('\nRunning tests...')
241241
if (!isDryRun) {
242-
await run('pnpm', ['run', 'test'])
242+
await run('pnpm', ['run', 'test', '--run'])
243243
} else {
244244
console.log(`Skipped (dry run)`)
245245
}

0 commit comments

Comments
 (0)