Skip to content

Commit e80b7ed

Browse files
authored
Merge branch 'main' into perf/regex-group
2 parents 1779b63 + 347ef1d commit e80b7ed

File tree

6 files changed

+326
-318
lines changed

6 files changed

+326
-318
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@rollup/plugin-json": "^6.1.0",
7070
"@rollup/plugin-node-resolve": "^16.0.1",
7171
"@rollup/plugin-replace": "5.0.4",
72-
"@swc/core": "^1.12.9",
72+
"@swc/core": "^1.12.11",
7373
"@types/hash-sum": "^1.0.2",
7474
"@types/node": "^22.16.0",
7575
"@types/semver": "^7.7.0",
@@ -79,7 +79,7 @@
7979
"@vue/consolidate": "1.0.0",
8080
"conventional-changelog-cli": "^5.0.0",
8181
"enquirer": "^2.4.1",
82-
"esbuild": "^0.25.5",
82+
"esbuild": "^0.25.6",
8383
"esbuild-plugin-polyfill-node": "^0.3.0",
8484
"eslint": "^9.27.0",
8585
"eslint-plugin-import-x": "^4.13.1",
@@ -97,7 +97,7 @@
9797
"pug": "^3.0.3",
9898
"puppeteer": "~24.9.0",
9999
"rimraf": "^6.0.1",
100-
"rollup": "^4.44.1",
100+
"rollup": "^4.44.2",
101101
"rollup-plugin-dts": "^6.2.1",
102102
"rollup-plugin-esbuild": "^6.2.1",
103103
"rollup-plugin-polyfill-node": "^0.13.0",

packages/compiler-sfc/src/compileScript.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type {
1818
Declaration,
1919
ExportSpecifier,
2020
Identifier,
21+
LVal,
2122
Node,
2223
ObjectPattern,
2324
Statement,
@@ -540,18 +541,18 @@ export function compileScript(
540541
}
541542

542543
// defineProps
543-
const isDefineProps = processDefineProps(ctx, init, decl.id)
544+
const isDefineProps = processDefineProps(ctx, init, decl.id as LVal)
544545
if (ctx.propsDestructureRestId) {
545546
setupBindings[ctx.propsDestructureRestId] =
546547
BindingTypes.SETUP_REACTIVE_CONST
547548
}
548549

549550
// defineEmits
550551
const isDefineEmits =
551-
!isDefineProps && processDefineEmits(ctx, init, decl.id)
552+
!isDefineProps && processDefineEmits(ctx, init, decl.id as LVal)
552553
!isDefineEmits &&
553-
(processDefineSlots(ctx, init, decl.id) ||
554-
processDefineModel(ctx, init, decl.id))
554+
(processDefineSlots(ctx, init, decl.id as LVal) ||
555+
processDefineModel(ctx, init, decl.id as LVal))
555556

556557
if (
557558
isDefineProps &&

packages/compiler-sfc/src/style/pluginScoped.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { warn } from '../warn'
1010

1111
const animationNameRE = /^(?:-\w+-)?animation-name$/
1212
const animationRE = /^(?:-\w+-)?animation$/
13+
const keyframesRE = /^(?:-\w+-)?keyframes$/
1314

1415
const scopedPlugin: PluginCreator<string> = (id = '') => {
1516
const keyframes = Object.create(null)
@@ -21,10 +22,7 @@ const scopedPlugin: PluginCreator<string> = (id = '') => {
2122
processRule(id, rule)
2223
},
2324
AtRule(node) {
24-
if (
25-
/-?keyframes$/.test(node.name) &&
26-
!node.params.endsWith(`-${shortId}`)
27-
) {
25+
if (keyframesRE.test(node.name) && !node.params.endsWith(`-${shortId}`)) {
2826
// register keyframes
2927
keyframes[node.params] = node.params = node.params + '-' + shortId
3028
}
@@ -72,7 +70,7 @@ function processRule(id: string, rule: Rule) {
7270
processedRules.has(rule) ||
7371
(rule.parent &&
7472
rule.parent.type === 'atrule' &&
75-
/-?keyframes$/.test((rule.parent as AtRule).name))
73+
keyframesRE.test((rule.parent as AtRule).name))
7674
) {
7775
return
7876
}

packages/runtime-core/src/apiInject.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { isFunction } from '@vue/shared'
2-
import { currentInstance } from './component'
3-
import { currentRenderingInstance } from './componentRenderContext'
2+
import { currentInstance, getCurrentInstance } from './component'
43
import { currentApp } from './apiCreateApp'
54
import { warn } from './warning'
65

@@ -51,7 +50,7 @@ export function inject(
5150
) {
5251
// fallback to `currentRenderingInstance` so that this can be called in
5352
// a functional component
54-
const instance = currentInstance || currentRenderingInstance
53+
const instance = getCurrentInstance()
5554

5655
// also support looking up from app-level provides w/ `app.runWithContext()`
5756
if (instance || currentApp) {
@@ -90,5 +89,5 @@ export function inject(
9089
* user. One example is `useRoute()` in `vue-router`.
9190
*/
9291
export function hasInjectionContext(): boolean {
93-
return !!(currentInstance || currentRenderingInstance || currentApp)
92+
return !!(getCurrentInstance() || currentApp)
9493
}

0 commit comments

Comments
 (0)