Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
bbad2d68
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看板
提交
bbad2d68
编写于
4月 19, 2023
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
de241521
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
19 addition
and
7 deletion
+19
-7
packages/uni-app-uts/__tests__/codegen.spec.ts
packages/uni-app-uts/__tests__/codegen.spec.ts
+1
-1
packages/uni-app-uts/src/plugins/pagesJson.ts
packages/uni-app-uts/src/plugins/pagesJson.ts
+1
-1
packages/uni-app-uts/src/plugins/uvue/code/script.ts
packages/uni-app-uts/src/plugins/uvue/code/script.ts
+2
-2
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
+3
-1
packages/uni-app-uts/src/plugins/uvue/compiler/options.ts
packages/uni-app-uts/src/plugins/uvue/compiler/options.ts
+6
-1
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
+1
-0
packages/uni-app-uts/src/plugins/uvue/compiler/utils.ts
packages/uni-app-uts/src/plugins/uvue/compiler/utils.ts
+1
-1
packages/uni-app-uts/src/plugins/uvue/index.ts
packages/uni-app-uts/src/plugins/uvue/index.ts
+1
-0
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+2
-0
packages/uni-uts-v1/src/uvue/index.ts
packages/uni-uts-v1/src/uvue/index.ts
+1
-0
packages/uts-darwin-arm64/uts.darwin-arm64.node
packages/uts-darwin-arm64/uts.darwin-arm64.node
+0
-0
packages/uts-darwin-x64/uts.darwin-x64.node
packages/uts-darwin-x64/uts.darwin-x64.node
+0
-0
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
+0
-0
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
+0
-0
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
+0
-0
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
+0
-0
未找到文件。
packages/uni-app-uts/__tests__/codegen.spec.ts
浏览文件 @
bbad2d68
...
...
@@ -11,7 +11,7 @@ describe('compiler:codegen', () => {
test
(
`function:kotlin`
,
()
=>
{
assert
(
`<view/>`
,
`@Suppress("UNUSED_PARAMETER") function PagesIndexIndexRender(ctx: PagesIndexIndex): VNode | null {\n return createElementVNode("view")\n}`
,
`@Suppress("UNUSED_PARAMETER") function PagesIndexIndexRender(
_
ctx: PagesIndexIndex): VNode | null {\n return createElementVNode("view")\n}`
,
{
targetLanguage
:
'
kotlin
'
,
mode
:
'
function
'
,
...
...
packages/uni-app-uts/src/plugins/pagesJson.ts
浏览文件 @
bbad2d68
...
...
@@ -56,7 +56,7 @@ export default 'pages.json'`
${
imports
.
map
((
p
)
=>
{
const
className
=
genClassName
(
p
)
return
`import
${
className
}
Class
from './
${
p
}
.uvue'`
return
`import
{
${
className
}
Class }
from './
${
p
}
.uvue'`
})
.
join
(
'
\n
'
)}
const __uniRoutes = [
${
routes
.
join
(
'
,
\n
'
)}
]
...
...
packages/uni-app-uts/src/plugins/uvue/code/script.ts
浏览文件 @
bbad2d68
...
...
@@ -15,7 +15,7 @@ class ${filename} extends ${parentClass} {
return
${
filename
}
Render(ctx)
}
}
export
default
UTSAndroid.getKotlinClass(
${
filename
}
)
export
const
${
filename
}
Class =
UTSAndroid.getKotlinClass(
${
filename
}
)
`
}
return
(
...
...
@@ -29,7 +29,7 @@ class ${filename} extends ${parentClass} {
}
}
export
default
UTSAndroid.getKotlinClass(
${
filename
}
)
export
const
${
filename
}
Class =
UTSAndroid.getKotlinClass(
${
filename
}
)
`
)
}
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/codegen.ts
浏览文件 @
bbad2d68
...
...
@@ -59,6 +59,7 @@ function createCodegenContext(
targetLanguage
,
mode
=
'
default
'
,
prefixIdentifiers
=
false
,
bindingMetadata
=
{},
sourceMap
=
false
,
filename
=
''
,
}:
CodegenOptions
...
...
@@ -67,6 +68,7 @@ function createCodegenContext(
targetLanguage
,
mode
,
prefixIdentifiers
,
bindingMetadata
,
sourceMap
,
filename
,
source
:
ast
.
loc
.
source
,
...
...
@@ -84,7 +86,7 @@ function createCodegenContext(
if
(
context
.
map
)
{
if
(
node
)
{
let
name
if
(
node
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
&&
!
node
.
isStatic
)
{
if
(
node
.
type
===
NodeTypes
.
SIMPLE_EXPRESSION
)
{
const
content
=
node
.
content
.
replace
(
/^_ctx
\.
/
,
''
)
if
(
content
!==
node
.
content
&&
isSimpleIdentifier
(
content
))
{
name
=
content
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/options.ts
浏览文件 @
bbad2d68
import
{
CompilerError
}
from
'
@vue/compiler-core
'
import
{
BindingMetadata
,
CompilerError
}
from
'
@vue/compiler-core
'
import
{
RawSourceMap
}
from
'
source-map
'
import
{
DirectiveTransform
,
NodeTransform
}
from
'
./transform
'
...
...
@@ -9,6 +9,11 @@ interface SharedTransformCodegenOptions {
* @default false
*/
prefixIdentifiers
?:
boolean
/**
* Optional binding metadata analyzed from script - used to optimize
* binding access when `prefixIdentifiers` is enabled.
*/
bindingMetadata
?:
BindingMetadata
/**
* Filename for source map generation.
* Also used for self-recursive reference in templates
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/transform.ts
浏览文件 @
bbad2d68
...
...
@@ -117,6 +117,7 @@ export function createTransformContext(
targetLanguage
,
selfName
:
nameMatch
&&
capitalize
(
camelize
(
nameMatch
[
1
])),
prefixIdentifiers
,
bindingMetadata
:
{},
nodeTransforms
,
directiveTransforms
,
isBuiltInComponent
,
...
...
packages/uni-app-uts/src/plugins/uvue/compiler/utils.ts
浏览文件 @
bbad2d68
...
...
@@ -6,5 +6,5 @@ export function genRenderFunctionDecl({
}:
CompilerOptions
):
string
{
return
`
${
targetLanguage
===
'
kotlin
'
?
'
@Suppress("UNUSED_PARAMETER")
'
:
''
}
function
${
filename
}
Render(ctx:
${
filename
}
): VNode | null`
}
function
${
filename
}
Render(
_
ctx:
${
filename
}
): VNode | null`
}
packages/uni-app-uts/src/plugins/uvue/index.ts
浏览文件 @
bbad2d68
...
...
@@ -74,6 +74,7 @@ export function uniAppUVuePlugin(): Plugin {
|
'
swift
'
,
mode
:
'
function
'
,
filename
:
className
,
prefixIdentifiers
:
true
,
})
:
''
),
})
...
...
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
bbad2d68
...
...
@@ -1268,7 +1268,9 @@ var shims = /*#__PURE__*/Object.freeze({
const
compressImage
=
{
args
(
fromArgs
,
toArgs
)
{
// https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
// @ts-expect-error
if
(
fromArgs
.
compressedHeight
&&
!
toArgs
.
compressHeight
)
{
// @ts-expect-error
toArgs
.
compressHeight
=
fromArgs
.
compressedHeight
;
}
// @ts-expect-error
...
...
packages/uni-uts-v1/src/uvue/index.ts
浏览文件 @
bbad2d68
...
...
@@ -19,6 +19,7 @@ const DEFAULT_IMPORTS = [
'
io.dcloud.uts.*
'
,
'
io.dcloud.uts.framework.*
'
,
'
io.dcloud.uts.vue.*
'
,
'
io.dcloud.uts.vue.shared.*
'
,
'
io.dcloud.uts.vue.reactivity.*
'
,
]
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
bbad2d68
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
bbad2d68
无法预览此类型文件
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
浏览文件 @
bbad2d68
无法预览此类型文件
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
浏览文件 @
bbad2d68
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
bbad2d68
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
bbad2d68
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录