Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
e18774e6
U
uni-app
项目概览
DCloud
/
uni-app
6 个月 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e18774e6
编写于
4月 21, 2023
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
44346599
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
702 addition
and
52 deletion
+702
-52
packages/uni-app-uts/__tests__/codegen.spec.ts
packages/uni-app-uts/__tests__/codegen.spec.ts
+8
-0
packages/uni-app-uts/package.json
packages/uni-app-uts/package.json
+2
-0
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
+3
-5
packages/uni-app-uts/src/plugins/uvue/compiler/index.ts
packages/uni-app-uts/src/plugins/uvue/compiler/index.ts
+4
-0
packages/uni-app-uts/src/plugins/uvue/compiler/runtimeHelpers.ts
...s/uni-app-uts/src/plugins/uvue/compiler/runtimeHelpers.ts
+6
-0
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
+36
-0
packages/uni-app-uts/src/plugins/uvue/compiler/transforms/transformExpression.ts
...c/plugins/uvue/compiler/transforms/transformExpression.ts
+268
-0
packages/uni-app-uts/src/plugins/uvue/compiler/transforms/vIf.ts
...s/uni-app-uts/src/plugins/uvue/compiler/transforms/vIf.ts
+322
-0
packages/uni-mp-alipay/src/compiler/options.ts
packages/uni-mp-alipay/src/compiler/options.ts
+2
-1
packages/uni-mp-baidu/src/compiler/options.ts
packages/uni-mp-baidu/src/compiler/options.ts
+1
-1
packages/uni-mp-compiler/src/ast.ts
packages/uni-mp-compiler/src/ast.ts
+2
-2
packages/uni-mp-compiler/src/index.ts
packages/uni-mp-compiler/src/index.ts
+1
-2
packages/uni-mp-jd/src/compiler/options.ts
packages/uni-mp-jd/src/compiler/options.ts
+1
-1
packages/uni-mp-kuaishou/src/compiler/options.ts
packages/uni-mp-kuaishou/src/compiler/options.ts
+1
-1
packages/uni-mp-lark/dist/uni.compiler.js
packages/uni-mp-lark/dist/uni.compiler.js
+1
-1
packages/uni-mp-qq/src/compiler/options.ts
packages/uni-mp-qq/src/compiler/options.ts
+1
-1
packages/uni-mp-toutiao/src/compiler/options.ts
packages/uni-mp-toutiao/src/compiler/options.ts
+1
-1
packages/uni-mp-weixin/src/compiler/options.ts
packages/uni-mp-weixin/src/compiler/options.ts
+1
-1
packages/uni-quickapp-webview/package.json
packages/uni-quickapp-webview/package.json
+1
-1
packages/uni-quickapp-webview/src/compiler/options.ts
packages/uni-quickapp-webview/src/compiler/options.ts
+1
-1
pnpm-lock.yaml
pnpm-lock.yaml
+39
-33
未找到文件。
packages/uni-app-uts/__tests__/codegen.spec.ts
浏览文件 @
e18774e6
...
...
@@ -7,6 +7,14 @@ describe('compiler:codegen', () => {
`<view style="width:100px;height:100px;"/>`
,
`createElementVNode("view", new Map<string,any>([["style", "width:100px;height:100px;"]]))`
)
assert
(
`<text>{{msg}}</text>`
,
`createElementVNode("text", null, toDisplayString(_ctx.msg), 1 /* TEXT */)`
)
assert
(
`<view v-if="a"></view>`
,
`isTrue(_ctx.a)\n ? createElementVNode("view", new Map<string,any>([["key", 0]]))\n : createCommentVNode("v-if", true)`
)
})
test
(
`function:kotlin`
,
()
=>
{
assert
(
...
...
packages/uni-app-uts/package.json
浏览文件 @
e18774e6
...
...
@@ -19,6 +19,8 @@
},
"license"
:
"Apache-2.0"
,
"dependencies"
:
{
"@babel/parser"
:
"^7.16.4"
,
"@babel/types"
:
"^7.20.7"
,
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3071220230324001"
,
"@dcloudio/uni-nvue-styler"
:
"3.0.0-alpha-3071220230324001"
,
"@rollup/pluginutils"
:
"^4.2.0"
,
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
浏览文件 @
e18774e6
...
...
@@ -35,6 +35,7 @@ import {
import
{
CodegenOptions
,
CodegenResult
}
from
'
./options
'
import
{
isArray
,
isString
,
isSymbol
}
from
'
@vue/shared
'
import
{
genRenderFunctionDecl
}
from
'
./utils
'
import
{
IS_TRUE
}
from
'
./runtimeHelpers
'
type
CodegenNode
=
TemplateChildNode
|
JSChildNode
|
SSRCodegenNode
...
...
@@ -478,16 +479,13 @@ function genConditionalExpression(
)
{
const
{
test
,
consequent
,
alternate
,
newline
:
needNewline
}
=
node
const
{
push
,
indent
,
deindent
,
newline
}
=
context
push
(
`
${
context
.
helper
(
IS_TRUE
)}
(`
)
if
(
test
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
)
{
const
needsParens
=
!
isSimpleIdentifier
(
test
.
content
)
needsParens
&&
push
(
`(`
)
genExpression
(
test
,
context
)
needsParens
&&
push
(
`)`
)
}
else
{
push
(
`(`
)
genNode
(
test
,
context
)
push
(
`)`
)
}
push
(
`)`
)
needNewline
&&
indent
()
context
.
indentLevel
++
needNewline
||
push
(
` `
)
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/index.ts
浏览文件 @
e18774e6
...
...
@@ -10,9 +10,12 @@ import {
transformOn
,
}
from
'
@vue/compiler-core
'
import
'
./runtimeHelpers
'
import
{
CodegenResult
,
CompilerOptions
}
from
'
./options
'
import
{
generate
}
from
'
./codegen
'
import
{
DirectiveTransform
,
NodeTransform
,
transform
}
from
'
./transform
'
import
{
transformIf
}
from
'
./transforms/vIf
'
export
type
TransformPreset
=
[
NodeTransform
[],
...
...
@@ -24,6 +27,7 @@ export function getBaseTransformPreset(
):
TransformPreset
{
return
[
[
transformIf
,
// order is important
trackVForSlotScopes
,
transformExpression
,
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/runtimeHelpers.ts
0 → 100644
浏览文件 @
e18774e6
import
{
registerRuntimeHelpers
}
from
'
@vue/compiler-core
'
export
const
IS_TRUE
=
Symbol
(
`isTrue`
)
registerRuntimeHelpers
({
[
IS_TRUE
]:
'
isTrue
'
,
})
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
浏览文件 @
e18774e6
...
...
@@ -4,6 +4,7 @@ import {
ConstantTypes
,
DirectiveNode
,
ElementNode
,
ElementTypes
,
ExpressionNode
,
JSChildNode
,
NodeTypes
,
...
...
@@ -17,6 +18,7 @@ import {
createCacheExpression
,
helperNameMap
,
isSlotOutlet
,
isVSlot
,
makeBlock
,
}
from
'
@vue/compiler-core
'
import
{
NOOP
,
camelize
,
capitalize
,
isArray
,
isString
}
from
'
@vue/shared
'
...
...
@@ -379,3 +381,37 @@ export function traverseNode(
exitFns
[
i
]()
}
}
export
function
createStructuralDirectiveTransform
(
name
:
string
|
RegExp
,
fn
:
StructuralDirectiveTransform
):
NodeTransform
{
const
matches
=
isString
(
name
)
?
(
n
:
string
)
=>
n
===
name
:
(
n
:
string
)
=>
name
.
test
(
n
)
return
(
node
,
context
)
=>
{
if
(
node
.
type
===
NodeTypes
.
ELEMENT
)
{
const
{
props
}
=
node
// structural directive transforms are not concerned with slots
// as they are handled separately in vSlot.ts
if
(
node
.
tagType
===
ElementTypes
.
TEMPLATE
&&
props
.
some
(
isVSlot
))
{
return
}
const
exitFns
=
[]
for
(
let
i
=
0
;
i
<
props
.
length
;
i
++
)
{
const
prop
=
props
[
i
]
if
(
prop
.
type
===
NodeTypes
.
DIRECTIVE
&&
matches
(
prop
.
name
))
{
// structural directives are removed to avoid infinite recursion
// also we remove them *before* applying so that it can further
// traverse itself in case it moves the node around
props
.
splice
(
i
,
1
)
i
--
const
onExit
=
fn
(
node
,
prop
,
context
)
if
(
onExit
)
exitFns
.
push
(
onExit
)
}
}
return
exitFns
}
}
}
packages/uni-app-uts/src/plugins/uvue/compiler/transforms/transformExpression.ts
0 → 100644
浏览文件 @
e18774e6
// - Parse expressions in templates into compound expressions so that each
// identifier gets more accurate source-map locations.
//
// - Prefix identifiers with `_ctx.` or `$xxx` (for known binding types) so that
// they are accessed from the right source
//
// - This transform is only applied in non-browser builds because it relies on
// an additional JavaScript parser. In the browser, there is no source-map
// support and the code is wrapped in `with (this) { ... }`.
import
{
NodeTransform
,
TransformContext
}
from
'
../transform
'
import
{
isGloballyWhitelisted
,
makeMap
,
hasOwn
,
isString
}
from
'
@vue/shared
'
import
{
Node
,
Identifier
}
from
'
@babel/types
'
import
{
parse
}
from
'
@babel/parser
'
import
{
advancePositionWithClone
,
BindingTypes
,
CompoundExpressionNode
,
ConstantTypes
,
createCompoundExpression
,
createSimpleExpression
,
ExpressionNode
,
isSimpleIdentifier
,
isStaticProperty
,
isStaticPropertyKey
,
NodeTypes
,
SimpleExpressionNode
,
walkIdentifiers
,
}
from
'
@vue/compiler-core
'
import
{
createCompilerError
,
ErrorCodes
}
from
'
../errors
'
const
isLiteralWhitelisted
=
/*#__PURE__*/
makeMap
(
'
true,false,null,this
'
)
export
const
transformExpression
:
NodeTransform
=
(
node
,
context
)
=>
{
if
(
node
.
type
===
NodeTypes
.
INTERPOLATION
)
{
node
.
content
=
processExpression
(
node
.
content
as
SimpleExpressionNode
,
context
)
}
else
if
(
node
.
type
===
NodeTypes
.
ELEMENT
)
{
// handle directives on element
for
(
let
i
=
0
;
i
<
node
.
props
.
length
;
i
++
)
{
const
dir
=
node
.
props
[
i
]
// do not process for v-on & v-for since they are special handled
if
(
dir
.
type
===
NodeTypes
.
DIRECTIVE
&&
dir
.
name
!==
'
for
'
)
{
const
exp
=
dir
.
exp
const
arg
=
dir
.
arg
// do not process exp if this is v-on:arg - we need special handling
// for wrapping inline statements.
if
(
exp
&&
exp
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
&&
!
(
dir
.
name
===
'
on
'
&&
arg
)
)
{
dir
.
exp
=
processExpression
(
exp
,
context
,
// slot args must be processed as function params
dir
.
name
===
'
slot
'
)
}
if
(
arg
&&
arg
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
&&
!
arg
.
isStatic
)
{
dir
.
arg
=
processExpression
(
arg
,
context
)
}
}
}
}
}
interface
PrefixMeta
{
prefix
?:
string
isConstant
:
boolean
start
:
number
end
:
number
scopeIds
?:
Set
<
string
>
}
// Important: since this function uses Node.js only dependencies, it should
// always be used with a leading !__BROWSER__ check so that it can be
// tree-shaken from the browser build.
export
function
processExpression
(
node
:
SimpleExpressionNode
,
context
:
TransformContext
,
// some expressions like v-slot props & v-for aliases should be parsed as
// function params
asParams
=
false
,
// v-on handler values may contain multiple statements
asRawStatements
=
false
,
localVars
:
Record
<
string
,
number
>
=
Object
.
create
(
context
.
identifiers
)
):
ExpressionNode
{
if
(
!
context
.
prefixIdentifiers
||
!
node
.
content
.
trim
())
{
return
node
}
const
{
bindingMetadata
}
=
context
const
rewriteIdentifier
=
(
raw
:
string
,
parent
?:
Node
,
id
?:
Identifier
)
=>
{
const
type
=
hasOwn
(
bindingMetadata
,
raw
)
&&
bindingMetadata
[
raw
]
if
(
type
&&
type
.
startsWith
(
'
setup
'
))
{
// setup bindings in non-inline mode
return
`$setup.
${
raw
}
`
}
else
if
(
type
===
BindingTypes
.
PROPS_ALIASED
)
{
return
`$props['
${
bindingMetadata
.
__propsAliases
!
[
raw
]}
']`
}
else
if
(
type
)
{
return
`$
${
type
}
.
${
raw
}
`
}
// fallback to ctx
return
`_ctx.
${
raw
}
`
}
// fast path if expression is a simple identifier.
const
rawExp
=
node
.
content
// bail constant on parens (function invocation) and dot (member access)
const
bailConstant
=
rawExp
.
indexOf
(
`(`
)
>
-
1
||
rawExp
.
indexOf
(
'
.
'
)
>
0
if
(
isSimpleIdentifier
(
rawExp
))
{
const
isScopeVarReference
=
context
.
identifiers
[
rawExp
]
const
isAllowedGlobal
=
isGloballyWhitelisted
(
rawExp
)
const
isLiteral
=
isLiteralWhitelisted
(
rawExp
)
if
(
!
asParams
&&
!
isScopeVarReference
&&
!
isAllowedGlobal
&&
!
isLiteral
)
{
// const bindings exposed from setup can be skipped for patching but
// cannot be hoisted to module scope
if
(
bindingMetadata
[
node
.
content
]
===
BindingTypes
.
SETUP_CONST
)
{
node
.
constType
=
ConstantTypes
.
CAN_SKIP_PATCH
}
node
.
content
=
rewriteIdentifier
(
rawExp
)
}
else
if
(
!
isScopeVarReference
)
{
if
(
isLiteral
)
{
node
.
constType
=
ConstantTypes
.
CAN_STRINGIFY
}
else
{
node
.
constType
=
ConstantTypes
.
CAN_HOIST
}
}
return
node
}
let
ast
:
any
// exp needs to be parsed differently:
// 1. Multiple inline statements (v-on, with presence of `;`): parse as raw
// exp, but make sure to pad with spaces for consistent ranges
// 2. Expressions: wrap with parens (for e.g. object expressions)
// 3. Function arguments (v-for, v-slot): place in a function argument position
const
source
=
asRawStatements
?
`
${
rawExp
}
`
:
`(
${
rawExp
}
)
${
asParams
?
`=>{}`
:
``
}
`
try
{
ast
=
parse
(
source
,
{
// plugins: context.expressionPlugins
}).
program
}
catch
(
e
:
any
)
{
context
.
onError
(
createCompilerError
(
ErrorCodes
.
X_INVALID_EXPRESSION
,
node
.
loc
,
undefined
,
e
.
message
)
)
return
node
}
type
QualifiedId
=
Identifier
&
PrefixMeta
const
ids
:
QualifiedId
[]
=
[]
const
parentStack
:
Node
[]
=
[]
const
knownIds
:
Record
<
string
,
number
>
=
Object
.
create
(
context
.
identifiers
)
walkIdentifiers
(
ast
,
(
node
,
parent
,
_
,
isReferenced
,
isLocal
)
=>
{
if
(
isStaticPropertyKey
(
node
,
parent
!
))
{
return
}
const
needPrefix
=
isReferenced
&&
canPrefix
(
node
)
if
(
needPrefix
&&
!
isLocal
)
{
if
(
isStaticProperty
(
parent
!
)
&&
parent
.
shorthand
)
{
// property shorthand like { foo }, we need to add the key since
// we rewrite the value
;(
node
as
QualifiedId
).
prefix
=
`
${
node
.
name
}
: `
}
node
.
name
=
rewriteIdentifier
(
node
.
name
,
parent
,
node
)
ids
.
push
(
node
as
QualifiedId
)
}
else
{
// The identifier is considered constant unless it's pointing to a
// local scope variable (a v-for alias, or a v-slot prop)
if
(
!
(
needPrefix
&&
isLocal
)
&&
!
bailConstant
)
{
;(
node
as
QualifiedId
).
isConstant
=
true
}
// also generate sub-expressions for other identifiers for better
// source map support. (except for property keys which are static)
ids
.
push
(
node
as
QualifiedId
)
}
},
true
,
// invoke on ALL identifiers
parentStack
,
knownIds
)
// We break up the compound expression into an array of strings and sub
// expressions (for identifiers that have been prefixed). In codegen, if
// an ExpressionNode has the `.children` property, it will be used instead of
// `.content`.
const
children
:
CompoundExpressionNode
[
'
children
'
]
=
[]
ids
.
sort
((
a
,
b
)
=>
a
.
start
-
b
.
start
)
ids
.
forEach
((
id
,
i
)
=>
{
// range is offset by -1 due to the wrapping parens when parsed
const
start
=
id
.
start
-
1
const
end
=
id
.
end
-
1
const
last
=
ids
[
i
-
1
]
const
leadingText
=
rawExp
.
slice
(
last
?
last
.
end
-
1
:
0
,
start
)
if
(
leadingText
.
length
||
id
.
prefix
)
{
children
.
push
(
leadingText
+
(
id
.
prefix
||
``
))
}
const
source
=
rawExp
.
slice
(
start
,
end
)
children
.
push
(
createSimpleExpression
(
id
.
name
,
false
,
{
source
,
start
:
advancePositionWithClone
(
node
.
loc
.
start
,
source
,
start
),
end
:
advancePositionWithClone
(
node
.
loc
.
start
,
source
,
end
),
},
id
.
isConstant
?
ConstantTypes
.
CAN_STRINGIFY
:
ConstantTypes
.
NOT_CONSTANT
)
)
if
(
i
===
ids
.
length
-
1
&&
end
<
rawExp
.
length
)
{
children
.
push
(
rawExp
.
slice
(
end
))
}
})
let
ret
if
(
children
.
length
)
{
ret
=
createCompoundExpression
(
children
,
node
.
loc
)
}
else
{
ret
=
node
ret
.
constType
=
bailConstant
?
ConstantTypes
.
NOT_CONSTANT
:
ConstantTypes
.
CAN_STRINGIFY
}
ret
.
identifiers
=
Object
.
keys
(
knownIds
)
return
ret
}
function
canPrefix
(
id
:
Identifier
)
{
// skip whitelisted globals
if
(
isGloballyWhitelisted
(
id
.
name
))
{
return
false
}
// special case for webpack compilation
if
(
id
.
name
===
'
require
'
)
{
return
false
}
return
true
}
export
function
stringifyExpression
(
exp
:
ExpressionNode
|
string
):
string
{
if
(
isString
(
exp
))
{
return
exp
}
else
if
(
exp
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
)
{
return
exp
.
content
}
else
{
return
(
exp
.
children
as
(
ExpressionNode
|
string
)[])
.
map
(
stringifyExpression
)
.
join
(
''
)
}
}
packages/uni-app-uts/src/plugins/uvue/compiler/transforms/vIf.ts
0 → 100644
浏览文件 @
e18774e6
import
{
PatchFlags
,
PatchFlagNames
}
from
'
@vue/shared
'
import
{
AttributeNode
,
BlockCodegenNode
,
CREATE_COMMENT
,
CacheExpression
,
ConstantTypes
,
DirectiveNode
,
ElementNode
,
ElementTypes
,
FRAGMENT
,
IfBranchNode
,
IfConditionalExpression
,
IfNode
,
MemoExpression
,
NodeTypes
,
SimpleExpressionNode
,
createCallExpression
,
createConditionalExpression
,
createObjectExpression
,
createObjectProperty
,
createSimpleExpression
,
createVNodeCall
,
findDir
,
findProp
,
getMemoedVNodeCall
,
injectProp
,
locStub
,
makeBlock
,
}
from
'
@vue/compiler-core
'
import
{
TransformContext
,
createStructuralDirectiveTransform
,
traverseNode
,
}
from
'
../transform
'
import
{
createCompilerError
,
ErrorCodes
}
from
'
../errors
'
import
{
processExpression
}
from
'
./transformExpression
'
export
const
transformIf
=
createStructuralDirectiveTransform
(
/^
(
if|else|else-if
)
$/
,
(
node
,
dir
,
context
)
=>
{
return
processIf
(
node
,
dir
,
context
,
(
ifNode
,
branch
,
isRoot
)
=>
{
// #1587: We need to dynamically increment the key based on the current
// node's sibling nodes, since chained v-if/else branches are
// rendered at the same depth
const
siblings
=
context
.
parent
!
.
children
let
i
=
siblings
.
indexOf
(
ifNode
)
let
key
=
0
while
(
i
--
>=
0
)
{
const
sibling
=
siblings
[
i
]
if
(
sibling
&&
sibling
.
type
===
NodeTypes
.
IF
)
{
key
+=
sibling
.
branches
.
length
}
}
// Exit callback. Complete the codegenNode when all children have been
// transformed.
return
()
=>
{
if
(
isRoot
)
{
ifNode
.
codegenNode
=
createCodegenNodeForBranch
(
branch
,
key
,
context
)
as
IfConditionalExpression
}
else
{
// attach this branch's codegen node to the v-if root.
const
parentCondition
=
getParentCondition
(
ifNode
.
codegenNode
!
)
parentCondition
.
alternate
=
createCodegenNodeForBranch
(
branch
,
key
+
ifNode
.
branches
.
length
-
1
,
context
)
}
}
})
}
)
// target-agnostic transform used for both Client and SSR
export
function
processIf
(
node
:
ElementNode
,
dir
:
DirectiveNode
,
context
:
TransformContext
,
processCodegen
?:
(
node
:
IfNode
,
branch
:
IfBranchNode
,
isRoot
:
boolean
)
=>
(()
=>
void
)
|
undefined
)
{
if
(
dir
.
name
!==
'
else
'
&&
(
!
dir
.
exp
||
!
(
dir
.
exp
as
SimpleExpressionNode
).
content
.
trim
())
)
{
const
loc
=
dir
.
exp
?
dir
.
exp
.
loc
:
node
.
loc
context
.
onError
(
createCompilerError
(
ErrorCodes
.
X_V_IF_NO_EXPRESSION
,
dir
.
loc
)
)
dir
.
exp
=
createSimpleExpression
(
`true`
,
false
,
loc
)
}
if
(
context
.
prefixIdentifiers
&&
dir
.
exp
)
{
// dir.exp can only be simple expression because vIf transform is applied
// before expression transform.
dir
.
exp
=
processExpression
(
dir
.
exp
as
SimpleExpressionNode
,
context
)
}
if
(
dir
.
name
===
'
if
'
)
{
const
branch
=
createIfBranch
(
node
,
dir
)
const
ifNode
:
IfNode
=
{
type
:
NodeTypes
.
IF
,
loc
:
node
.
loc
,
branches
:
[
branch
],
}
context
.
replaceNode
(
ifNode
)
if
(
processCodegen
)
{
return
processCodegen
(
ifNode
,
branch
,
true
)
}
}
else
{
// locate the adjacent v-if
const
siblings
=
context
.
parent
!
.
children
let
i
=
siblings
.
indexOf
(
node
)
while
(
i
--
>=
-
1
)
{
const
sibling
=
siblings
[
i
]
if
(
sibling
&&
sibling
.
type
===
NodeTypes
.
COMMENT
)
{
context
.
removeNode
(
sibling
)
continue
}
if
(
sibling
&&
sibling
.
type
===
NodeTypes
.
TEXT
&&
!
sibling
.
content
.
trim
().
length
)
{
context
.
removeNode
(
sibling
)
continue
}
if
(
sibling
&&
sibling
.
type
===
NodeTypes
.
IF
)
{
// Check if v-else was followed by v-else-if
if
(
dir
.
name
===
'
else-if
'
&&
sibling
.
branches
[
sibling
.
branches
.
length
-
1
].
condition
===
undefined
)
{
context
.
onError
(
createCompilerError
(
ErrorCodes
.
X_V_ELSE_NO_ADJACENT_IF
,
node
.
loc
)
)
}
// move the node to the if node's branches
context
.
removeNode
()
const
branch
=
createIfBranch
(
node
,
dir
)
// check if user is forcing same key on different branches
const
key
=
branch
.
userKey
if
(
key
)
{
sibling
.
branches
.
forEach
(({
userKey
})
=>
{
if
(
isSameKey
(
userKey
,
key
))
{
context
.
onError
(
createCompilerError
(
ErrorCodes
.
X_V_IF_SAME_KEY
,
branch
.
userKey
!
.
loc
)
)
}
})
}
sibling
.
branches
.
push
(
branch
)
const
onExit
=
processCodegen
&&
processCodegen
(
sibling
,
branch
,
false
)
// since the branch was removed, it will not be traversed.
// make sure to traverse here.
traverseNode
(
branch
,
context
)
// call on exit
if
(
onExit
)
onExit
()
// make sure to reset currentNode after traversal to indicate this
// node has been removed.
context
.
currentNode
=
null
}
else
{
context
.
onError
(
createCompilerError
(
ErrorCodes
.
X_V_ELSE_NO_ADJACENT_IF
,
node
.
loc
)
)
}
break
}
}
}
function
createIfBranch
(
node
:
ElementNode
,
dir
:
DirectiveNode
):
IfBranchNode
{
const
isTemplateIf
=
node
.
tagType
===
ElementTypes
.
TEMPLATE
return
{
type
:
NodeTypes
.
IF_BRANCH
,
loc
:
node
.
loc
,
condition
:
dir
.
name
===
'
else
'
?
undefined
:
dir
.
exp
,
children
:
isTemplateIf
&&
!
findDir
(
node
,
'
for
'
)
?
node
.
children
:
[
node
],
userKey
:
findProp
(
node
,
`key`
),
isTemplateIf
,
}
}
function
createCodegenNodeForBranch
(
branch
:
IfBranchNode
,
keyIndex
:
number
,
context
:
TransformContext
):
IfConditionalExpression
|
BlockCodegenNode
|
MemoExpression
{
if
(
branch
.
condition
)
{
return
createConditionalExpression
(
branch
.
condition
,
createChildrenCodegenNode
(
branch
,
keyIndex
,
context
),
// make sure to pass in asBlock: true so that the comment node call
// closes the current block.
createCallExpression
(
context
.
helper
(
CREATE_COMMENT
),
[
'
"v-if"
'
,
'
true
'
])
)
as
IfConditionalExpression
}
else
{
return
createChildrenCodegenNode
(
branch
,
keyIndex
,
context
)
}
}
function
createChildrenCodegenNode
(
branch
:
IfBranchNode
,
keyIndex
:
number
,
context
:
TransformContext
):
BlockCodegenNode
|
MemoExpression
{
const
{
helper
}
=
context
const
keyProperty
=
createObjectProperty
(
`key`
,
createSimpleExpression
(
`
${
keyIndex
}
`
,
false
,
locStub
,
ConstantTypes
.
CAN_HOIST
)
)
const
{
children
}
=
branch
const
firstChild
=
children
[
0
]
const
needFragmentWrapper
=
children
.
length
!==
1
||
firstChild
.
type
!==
NodeTypes
.
ELEMENT
if
(
needFragmentWrapper
)
{
if
(
children
.
length
===
1
&&
firstChild
.
type
===
NodeTypes
.
FOR
)
{
// optimize away nested fragments when child is a ForNode
const
vnodeCall
=
firstChild
.
codegenNode
!
injectProp
(
vnodeCall
,
keyProperty
,
context
as
any
)
return
vnodeCall
}
else
{
let
patchFlag
=
PatchFlags
.
STABLE_FRAGMENT
let
patchFlagText
=
PatchFlagNames
[
PatchFlags
.
STABLE_FRAGMENT
]
// check if the fragment actually contains a single valid child with
// the rest being comments
return
createVNodeCall
(
context
as
any
,
helper
(
FRAGMENT
),
createObjectExpression
([
keyProperty
]),
children
,
patchFlag
+
` /*
${
patchFlagText
}
*/`
,
undefined
,
undefined
,
true
,
false
,
false
/* isComponent */
,
branch
.
loc
)
}
}
else
{
const
ret
=
(
firstChild
as
ElementNode
).
codegenNode
as
|
BlockCodegenNode
|
MemoExpression
const
vnodeCall
=
getMemoedVNodeCall
(
ret
)
// Change createVNode to createBlock.
if
(
vnodeCall
.
type
===
NodeTypes
.
VNODE_CALL
)
{
makeBlock
(
vnodeCall
,
context
as
any
)
}
// inject branch key
injectProp
(
vnodeCall
,
keyProperty
,
context
as
any
)
return
ret
}
}
function
isSameKey
(
a
:
AttributeNode
|
DirectiveNode
|
undefined
,
b
:
AttributeNode
|
DirectiveNode
):
boolean
{
if
(
!
a
||
a
.
type
!==
b
.
type
)
{
return
false
}
if
(
a
.
type
===
NodeTypes
.
ATTRIBUTE
)
{
if
(
a
.
value
!
.
content
!==
(
b
as
AttributeNode
).
value
!
.
content
)
{
return
false
}
}
else
{
// directive
const
exp
=
a
.
exp
!
const
branchExp
=
(
b
as
DirectiveNode
).
exp
!
if
(
exp
.
type
!==
branchExp
.
type
)
{
return
false
}
if
(
exp
.
type
!==
NodeTypes
.
SIMPLE_EXPRESSION
||
exp
.
isStatic
!==
(
branchExp
as
SimpleExpressionNode
).
isStatic
||
exp
.
content
!==
(
branchExp
as
SimpleExpressionNode
).
content
)
{
return
false
}
}
return
true
}
function
getParentCondition
(
node
:
IfConditionalExpression
|
CacheExpression
):
IfConditionalExpression
{
while
(
true
)
{
if
(
node
.
type
===
NodeTypes
.
JS_CONDITIONAL_EXPRESSION
)
{
if
(
node
.
alternate
.
type
===
NodeTypes
.
JS_CONDITIONAL_EXPRESSION
)
{
node
=
node
.
alternate
}
else
{
return
node
}
}
else
if
(
node
.
type
===
NodeTypes
.
JS_CACHE_EXPRESSION
)
{
node
=
node
.
value
as
IfConditionalExpression
}
}
}
packages/uni-mp-alipay/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
fs
from
'
fs
'
import
{
CompilerOptions
,
NodeTypes
}
from
'
@vue/compiler-core
'
import
{
NodeTypes
}
from
'
@vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@dcloudio/uni-mp-compiler
'
import
{
COMPONENT_ON_LINK
,
copyMiniProgramPluginJson
,
...
...
packages/uni-mp-baidu/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
MiniProgramCompilerOptions
,
transformMatchMedia
,
...
...
packages/uni-mp-compiler/src/ast.ts
浏览文件 @
e18774e6
import
{
isString
}
from
'
@vue/shared
'
import
{
parseExpression
}
from
'
@babel/parser
'
import
{
ParseResult
,
parseExpression
}
from
'
@babel/parser
'
import
{
identifier
,
objectProperty
,
...
...
@@ -83,7 +83,7 @@ export function parseExpr(
code
:
string
|
ExpressionNode
,
context
:
TransformContext
,
node
?:
ExpressionNode
)
{
)
:
ParseResult
<
Expression
>
|
undefined
{
if
(
!
isString
(
code
))
{
node
=
code
code
=
genExpr
(
code
)
...
...
packages/uni-mp-compiler/src/index.ts
浏览文件 @
e18774e6
...
...
@@ -9,10 +9,9 @@ import {
import
{
baseCompile
}
from
'
./compile
'
import
{
parserOptions
}
from
'
./parserOptions
'
import
{
CompilerOptions
}
from
'
./options
'
export
type
{
CompilerOptions
}
from
'
./options
'
export
{
findProp
}
from
'
@vue/compiler-core
'
export
type
{
CompilerOptions
,
DirectiveNode
,
NodeTransform
,
DirectiveTransform
,
...
...
packages/uni-mp-jd/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
COMPONENT_CUSTOM_HIDDEN_BIND
,
MiniProgramCompilerOptions
,
...
...
packages/uni-mp-kuaishou/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
MiniProgramCompilerOptions
,
transformComponentLink
,
...
...
packages/uni-mp-lark/dist/uni.compiler.js
浏览文件 @
e18774e6
...
...
@@ -62,7 +62,7 @@ function transformSwiper(node) {
}
}
const
customElements
=
[
'
aweme-data
'
,
'
consume-card
'
];
const
customElements
=
[
'
aweme-data
'
,
'
consume-card
'
,
'
pay-button
'
];
const
projectConfigFilename
=
'
project.config.json
'
;
const
nodeTransforms
=
[
uniCliShared
.
transformRef
,
...
...
packages/uni-mp-qq/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
COMPONENT_CUSTOM_HIDDEN
,
MiniProgramCompilerOptions
,
...
...
packages/uni-mp-toutiao/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
COMPONENT_CUSTOM_HIDDEN_BIND
,
MiniProgramCompilerOptions
,
...
...
packages/uni-mp-weixin/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
COMPONENT_CUSTOM_HIDDEN
,
copyMiniProgramPluginJson
,
...
...
packages/uni-quickapp-webview/package.json
浏览文件 @
e18774e6
...
...
@@ -26,7 +26,7 @@
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"devDependencies"
:
{
"@
vue/compiler-core"
:
"3.2.47
"
"@
dcloudio/uni-mp-compiler"
:
"3.0.0-alpha-3071220230324001
"
},
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3071220230324001"
,
...
...
packages/uni-quickapp-webview/src/compiler/options.ts
浏览文件 @
e18774e6
import
path
from
'
path
'
import
type
{
CompilerOptions
}
from
'
@
vue/compiler-core
'
import
type
{
CompilerOptions
}
from
'
@
dcloudio/uni-mp-compiler
'
import
{
MiniProgramCompilerOptions
,
transformComponentLink
,
...
...
pnpm-lock.yaml
浏览文件 @
e18774e6
...
...
@@ -354,6 +354,12 @@ importers:
packages/uni-app-uts
:
dependencies
:
'
@babel/parser'
:
specifier
:
^7.16.4
version
:
7.16.4
'
@babel/types'
:
specifier
:
^7.20.7
version
:
7.20.7
'
@dcloudio/uni-cli-shared'
:
specifier
:
3.0.0-alpha-3071220230324001
version
:
link:../uni-cli-shared
...
...
@@ -1208,9 +1214,9 @@ importers:
specifier
:
3.2.47
version
:
3.2.47
devDependencies
:
'
@
vue/compiler-core
'
:
specifier
:
3.
2.47
version
:
3.2.47
'
@
dcloudio/uni-mp-compiler
'
:
specifier
:
3.
0.0-alpha-3071220230324001
version
:
link:../uni-mp-compiler
packages/uni-shared
:
dependencies
:
...
...
@@ -1503,7 +1509,7 @@ packages:
resolution
:
{
integrity
:
sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@jridgewell/gen-mapping'
:
0.3.3
jsesc
:
2.5.2
...
...
@@ -1520,14 +1526,14 @@ packages:
resolution
:
{
integrity
:
sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-builder-binary-assignment-operator-visitor@7.18.9
:
resolution
:
{
integrity
:
sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/helper-explode-assignable-expression'
:
7.18.6
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-compilation-targets@7.21.4(@babel/core@7.21.0)
:
resolution
:
{
integrity
:
sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==
}
...
...
@@ -1593,7 +1599,7 @@ packages:
resolution
:
{
integrity
:
sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-function-name@7.21.0
:
resolution
:
{
integrity
:
sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==
}
...
...
@@ -1606,7 +1612,7 @@ packages:
resolution
:
{
integrity
:
sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-member-expression-to-functions@7.21.0
:
resolution
:
{
integrity
:
sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==
}
...
...
@@ -1639,7 +1645,7 @@ packages:
resolution
:
{
integrity
:
sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-plugin-utils@7.20.2
:
resolution
:
{
integrity
:
sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==
}
...
...
@@ -1655,7 +1661,7 @@ packages:
'
@babel/helper-annotate-as-pure'
:
7.18.6
'
@babel/helper-environment-visitor'
:
7.18.9
'
@babel/helper-wrap-function'
:
7.20.5
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
transitivePeerDependencies
:
-
supports-color
...
...
@@ -1668,7 +1674,7 @@ packages:
'
@babel/helper-optimise-call-expression'
:
7.18.6
'
@babel/template'
:
7.20.7
'
@babel/traverse'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
transitivePeerDependencies
:
-
supports-color
...
...
@@ -1676,19 +1682,19 @@ packages:
resolution
:
{
integrity
:
sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-skip-transparent-expression-wrappers@7.20.0
:
resolution
:
{
integrity
:
sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-split-export-declaration@7.18.6
:
resolution
:
{
integrity
:
sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==
}
engines
:
{
node
:
'
>=6.9.0'
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/helper-string-parser@7.19.4
:
resolution
:
{
integrity
:
sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
}
...
...
@@ -1709,7 +1715,7 @@ packages:
'
@babel/helper-function-name'
:
7.21.0
'
@babel/template'
:
7.20.7
'
@babel/traverse'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
transitivePeerDependencies
:
-
supports-color
...
...
@@ -1736,14 +1742,14 @@ packages:
engines
:
{
node
:
'
>=6.0.0'
}
hasBin
:
true
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/parser@7.21.4
:
resolution
:
{
integrity
:
sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==
}
engines
:
{
node
:
'
>=6.0.0'
}
hasBin
:
true
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.18.6(@babel/core@7.21.0)
:
resolution
:
{
integrity
:
sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==
}
...
...
@@ -2615,7 +2621,7 @@ packages:
'
@babel/helper-plugin-utils'
:
7.20.2
'
@babel/plugin-proposal-unicode-property-regex'
:
7.18.6(@babel/core@7.21.0)
'
@babel/plugin-transform-dotall-regex'
:
7.18.6(@babel/core@7.21.0)
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
esutils
:
2.0.3
/@babel/regjsgen@0.8.0
:
...
...
@@ -2633,7 +2639,7 @@ packages:
dependencies
:
'
@babel/code-frame'
:
7.21.4
'
@babel/parser'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@babel/traverse@7.21.4
:
resolution
:
{
integrity
:
sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==
}
...
...
@@ -4163,8 +4169,8 @@ packages:
/@types/babel__core@7.1.19
:
resolution
:
{
integrity
:
sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==
}
dependencies
:
'
@babel/parser'
:
7.
16
.4
'
@babel/types'
:
7.2
0.7
'
@babel/parser'
:
7.
21
.4
'
@babel/types'
:
7.2
1.4
'
@types/babel__generator'
:
7.6.4
'
@types/babel__template'
:
7.4.1
'
@types/babel__traverse'
:
7.18.3
...
...
@@ -4172,18 +4178,18 @@ packages:
/@types/babel__generator@7.6.4
:
resolution
:
{
integrity
:
sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@types/babel__template@7.4.1
:
resolution
:
{
integrity
:
sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==
}
dependencies
:
'
@babel/parser'
:
7.
16
.4
'
@babel/types'
:
7.2
0.7
'
@babel/parser'
:
7.
21
.4
'
@babel/types'
:
7.2
1.4
/@types/babel__traverse@7.18.3
:
resolution
:
{
integrity
:
sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==
}
dependencies
:
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
/@types/body-parser@1.19.2
:
resolution
:
{
integrity
:
sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==
}
...
...
@@ -4512,7 +4518,7 @@ packages:
'
@babel/plugin-syntax-jsx'
:
7.21.4(@babel/core@7.21.0)
'
@babel/template'
:
7.20.7
'
@babel/traverse'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@vue/babel-helper-vue-transform-on'
:
1.0.2
camelcase
:
6.3.0
html-tags
:
3.3.1
...
...
@@ -4524,7 +4530,7 @@ packages:
/@vue/compiler-core@3.2.47
:
resolution
:
{
integrity
:
sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==
}
dependencies
:
'
@babel/parser'
:
7.
16
.4
'
@babel/parser'
:
7.
21
.4
'
@vue/shared'
:
3.2.47
estree-walker
:
2.0.2
source-map
:
0.6.1
...
...
@@ -4561,7 +4567,7 @@ packages:
/@vue/reactivity-transform@3.2.47
:
resolution
:
{
integrity
:
sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==
}
dependencies
:
'
@babel/parser'
:
7.
16
.4
'
@babel/parser'
:
7.
21
.4
'
@vue/compiler-core'
:
3.2.47
'
@vue/shared'
:
3.2.47
estree-walker
:
2.0.2
...
...
@@ -4883,7 +4889,7 @@ packages:
engines
:
{
node
:
^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0
}
dependencies
:
'
@babel/template'
:
7.20.7
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@types/babel__core'
:
7.1.19
'
@types/babel__traverse'
:
7.18.3
dev
:
false
...
...
@@ -4893,7 +4899,7 @@ packages:
engines
:
{
node
:
^14.15.0 || ^16.10.0 || >=18.0.0
}
dependencies
:
'
@babel/template'
:
7.20.7
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@types/babel__core'
:
7.1.19
'
@types/babel__traverse'
:
7.18.3
dev
:
true
...
...
@@ -7064,7 +7070,7 @@ packages:
engines
:
{
node
:
'
>=8'
}
dependencies
:
'
@babel/core'
:
7.21.0
'
@babel/parser'
:
7.
16
.4
'
@babel/parser'
:
7.
21
.4
'
@istanbuljs/schema'
:
0.1.3
istanbul-lib-coverage
:
3.2.0
semver
:
6.3.0
...
...
@@ -7783,7 +7789,7 @@ packages:
'
@babel/generator'
:
7.20.5
'
@babel/plugin-syntax-typescript'
:
7.21.4(@babel/core@7.21.0)
'
@babel/traverse'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@jest/transform'
:
27.5.1
'
@jest/types'
:
27.5.1
'
@types/babel__traverse'
:
7.18.3
...
...
@@ -7814,7 +7820,7 @@ packages:
'
@babel/plugin-syntax-jsx'
:
7.21.4(@babel/core@7.21.0)
'
@babel/plugin-syntax-typescript'
:
7.21.4(@babel/core@7.21.0)
'
@babel/traverse'
:
7.21.4
'
@babel/types'
:
7.2
0.7
'
@babel/types'
:
7.2
1.4
'
@jest/expect-utils'
:
29.5.0
'
@jest/transform'
:
29.5.0
'
@jest/types'
:
29.5.0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录