From 221a8d947de4ef76fc6d3bd4a76ea547b613ad45 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 1 Jul 2025 19:37:54 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix(@tarojs/components):=20=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-components/package.json | 2 -- packages/taro-components/virtual-list/index.d.ts | 4 ---- packages/taro-components/virtual-list/index.js | 4 ---- pnpm-lock.yaml | 3 --- 4 files changed, 13 deletions(-) delete mode 100644 packages/taro-components/virtual-list/index.d.ts delete mode 100644 packages/taro-components/virtual-list/index.js diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index b7a1f0d513f6..ceba23621e0a 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -17,7 +17,6 @@ "loader", "mini", "types", - "virtual-list", "vue3.d.ts", "global.css" ], @@ -61,7 +60,6 @@ "hammerjs": "^2.0.8", "@tarojs/runtime": "workspace:*", "@tarojs/shared": "workspace:*", - "@tarojs/components-advanced": "workspace:*", "@tarojs/taro": "workspace:*", "classnames": "^2.2.5", "hls.js": "^1.1.5", diff --git a/packages/taro-components/virtual-list/index.d.ts b/packages/taro-components/virtual-list/index.d.ts deleted file mode 100644 index 848fb9737c9a..000000000000 --- a/packages/taro-components/virtual-list/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import VirtualList from '@tarojs/components-advanced/dist/components/virtual-list/index' - -export * from '@tarojs/components-advanced/dist/components/virtual-list/index' -export default VirtualList diff --git a/packages/taro-components/virtual-list/index.js b/packages/taro-components/virtual-list/index.js deleted file mode 100644 index 2ec06cfb4645..000000000000 --- a/packages/taro-components/virtual-list/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const VirtualList = require('@tarojs/components-advanced/dist/components/virtual-list/index.js') - -module.exports = VirtualList.default -module.exports.default = module.exports diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d959e38b6e27..e211016993b1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -740,9 +740,6 @@ importers: '@stencil/core': specifier: 2.22.3 version: 2.22.3(ts-node@10.9.2(@swc/core@1.3.96)(@types/node@20.5.1)(typescript@5.4.5)) - '@tarojs/components-advanced': - specifier: workspace:* - version: link:../taro-components-advanced '@tarojs/runtime': specifier: workspace:* version: link:../taro-runtime From 9906e13531ff45fe73a67e01d7be7667acca4e03 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 1 Jul 2025 22:04:00 +0800 Subject: [PATCH 2/9] =?UTF-8?q?fix(@tarojs/components):=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/virtual-list/index.ts | 103 +----------------- 1 file changed, 3 insertions(+), 100 deletions(-) diff --git a/packages/taro-components-advanced/src/components/virtual-list/index.ts b/packages/taro-components-advanced/src/components/virtual-list/index.ts index a929ffd41c95..56962690682b 100644 --- a/packages/taro-components-advanced/src/components/virtual-list/index.ts +++ b/packages/taro-components-advanced/src/components/virtual-list/index.ts @@ -28,7 +28,7 @@ interface VirtualListProps extends Omit { * > - 非 unlimitedSize 模式下如果传入函数,为避免性能问题,每个节点只会调用一次用于设置初始值 */ itemSize: number | ((index?: number, itemData?: T[]) => number) - /** 解开高度列表单项大小限制,默认值使用: itemSize。 + /** 解开高度列表单项大小限制,默认值使用:itemSize。 * * > Note: 通过 itemSize 设置的初始高度与子节点实际高度差异过大会导致隐患,建议将单页大小设置接近于现实高度,在该模式下可以提升用户体验。 * @default false @@ -56,7 +56,7 @@ interface VirtualListProps extends Omit { * @default 50 */ lowerThreshold?: number - /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder) 时比较有用。 */ + /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder)时比较有用。 */ useIsScrolling?: boolean /** 通过 ScrollViewContext 优化组件滚动性能 * @default false @@ -106,7 +106,7 @@ declare namespace VirtualListProps { } interface IVirtualListEvent extends BaseEventOrig { - /** 滚动方向,可能值为 forward 往前, backward 往后。 */ + /** 滚动方向,可能值为 forward 往前,backward 往后。 */ scrollDirection: 'forward' | 'backward' /** 滚动距离 */ scrollOffset: number @@ -117,103 +117,6 @@ declare namespace VirtualListProps { } } -/** 虚拟列表 - * @classification viewContainer - * @supported weapp, swan, alipay, tt, qq, jd, h5 - * @example_react - * ```tsx - * import VirtualList from `@tarojs/components/virtual-list` - * - * function buildData (offset = 0) { - * return Array(100).fill(0).map((_, i) => i + offset); - * } - * - * const Row = React.memo(({ id, index, data }) => { - * return ( - * - * Row {index} - * - * ); - * }) - * - * export default class Index extends Component { - * state = { - * data: buildData(0), - * } - * - * render() { - * const { data } = this.state - * const dataLen = data.length - * return ( - * - * ); - * } - * } - * ``` - * @example_vue - * ```js - * // app.js 入口文件 - * import Vue from 'vue' - * import VirtualList from '@tarojs/components/virtual-list' - * - * Vue.use(VirtualList) - * ``` - * ```js - * - * - * - * - * ``` - * ```js - * - * - * - * - * ``` - * @see https://taro-docs.jd.com/docs/virtual-list - */ declare class VirtualListComponent extends Component { /** * 滚动到指定的地点。 From ffc02f35292da671cf1252d861ccd3f3b9caff5c Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 2 Jul 2025 10:40:56 +0800 Subject: [PATCH 3/9] =?UTF-8?q?docs:=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/virtual-list/index.ts | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/packages/taro-components-advanced/src/components/virtual-list/index.ts b/packages/taro-components-advanced/src/components/virtual-list/index.ts index 56962690682b..78ada1ef5cd3 100644 --- a/packages/taro-components-advanced/src/components/virtual-list/index.ts +++ b/packages/taro-components-advanced/src/components/virtual-list/index.ts @@ -117,6 +117,104 @@ declare namespace VirtualListProps { } } +/** 虚拟列表 + * @classification viewContainer + * @supported weapp, swan, alipay, tt, qq, jd, h5 + * @example_react + * ```tsx + * import VirtualList from `@tarojs/components-advanced` + * + * function buildData (offset = 0) { + * return Array(100).fill(0).map((_, i) => i + offset); + * } + * + * const Row = React.memo(({ id, index, data }) => { + * return ( + * + * Row {index} + * + * ); + * }) + * + * export default class Index extends Component { + * state = { + * data: buildData(0), + * } + * + * render() { + * const { data } = this.state + * const dataLen = data.length + * return ( + * + * ); + * } + * } + * ``` + * @example_vue + * ```js + * // app.js 入口文件 + * import Vue from 'vue' + * import VirtualList from '@tarojs/components-advanced' + * + * Vue.use(VirtualList) + * ``` + * ```js + * + * + * + * + * ``` + * ```js + * + * + * + * + * ``` + * @see https://taro-docs.jd.com/docs/virtual-list + */ + declare class VirtualListComponent extends Component { /** * 滚动到指定的地点。 From 41268863426607c449891c14cf1d21757778868a Mon Sep 17 00:00:00 2001 From: Yiheng Date: Wed, 2 Jul 2025 10:44:49 +0800 Subject: [PATCH 4/9] Update packages/taro-components-advanced/src/components/virtual-list/index.ts Co-authored-by: Amumu --- .../src/components/virtual-list/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-components-advanced/src/components/virtual-list/index.ts b/packages/taro-components-advanced/src/components/virtual-list/index.ts index 78ada1ef5cd3..920f90917799 100644 --- a/packages/taro-components-advanced/src/components/virtual-list/index.ts +++ b/packages/taro-components-advanced/src/components/virtual-list/index.ts @@ -161,7 +161,7 @@ declare namespace VirtualListProps { * ```js * // app.js 入口文件 * import Vue from 'vue' - * import VirtualList from '@tarojs/components-advanced' + * import { VirtualList } from '@tarojs/components-advanced' * * Vue.use(VirtualList) * ``` From 576d5296a573dabfe3aaeeb87131daf8116b2ab0 Mon Sep 17 00:00:00 2001 From: Yiheng Date: Wed, 2 Jul 2025 10:46:23 +0800 Subject: [PATCH 5/9] Update index.ts --- .../src/components/virtual-list/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-components-advanced/src/components/virtual-list/index.ts b/packages/taro-components-advanced/src/components/virtual-list/index.ts index 920f90917799..397e1c081c9a 100644 --- a/packages/taro-components-advanced/src/components/virtual-list/index.ts +++ b/packages/taro-components-advanced/src/components/virtual-list/index.ts @@ -122,7 +122,7 @@ declare namespace VirtualListProps { * @supported weapp, swan, alipay, tt, qq, jd, h5 * @example_react * ```tsx - * import VirtualList from `@tarojs/components-advanced` + * import { VirtualList } from `@tarojs/components-advanced` * * function buildData (offset = 0) { * return Array(100).fill(0).map((_, i) => i + offset); From e2b453a4a9bbd82c9955ba76a723d1d92c571f51 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 2 Jul 2025 11:59:35 +0800 Subject: [PATCH 6/9] fix(taroize): buildImportStatement --- packages/taroize/src/script.ts | 43 ++++++----- packages/taroize/src/utils.ts | 18 ++--- packages/taroize/src/wxml.ts | 126 +++++++++++++++++---------------- 3 files changed, 100 insertions(+), 87 deletions(-) diff --git a/packages/taroize/src/script.ts b/packages/taroize/src/script.ts index 3c0298b871bc..2e74b2e7bfa5 100644 --- a/packages/taroize/src/script.ts +++ b/packages/taroize/src/script.ts @@ -31,7 +31,7 @@ export function replaceIdentifier (callee: NodePath) { } } -// babel 6升级babel 7适配 +// babel 6 升级 babel 7 适配 export function replaceMemberExpression (callee: NodePath) { if (callee.isMemberExpression()) { const object = callee.get('object') as NodePath @@ -55,7 +55,7 @@ function replacePluginUrl (node, pluginInfo) { const urlProperty = urlNode.properties.find((property) => property.key.name === 'url') if (urlProperty) { if (!t.isStringLiteral(urlProperty.value)) { - // navigateFunc的url如果是动态化则不转换 + // navigateFunc 的 url 如果是动态化则不转换 updateLogFileContent(`WARN [taroize] replacePluginUrl - navigateFunc 的 url 是动态的 ${getLineBreak()}`) return } @@ -71,7 +71,7 @@ function replacePluginUrl (node, pluginInfo) { return } - // 将跳转的插件页面url替换为子包的url + // 将跳转的插件页面 url 替换为子包的 url // 捕获插件名 const pluginName = matchPluginUrl[1] // 捕获页面名 @@ -112,19 +112,19 @@ export function parseScript ( let ast = parseCode(script, scriptPath as string) let classDecl!: t.ClassDeclaration let foundWXInstance = false - const vistor: Visitor = { + const visitor: Visitor = { BlockStatement (path) { - updateLogFileContent(`INFO [taroize] parseScript - 解析BlockStatement ${getLineBreak()}${path} ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] parseScript - 解析 BlockStatement ${getLineBreak()}${path} ${getLineBreak()}`) path.scope.rename('wx', 'Taro') }, Identifier (path) { - updateLogFileContent(`INFO [taroize] parseScript - 解析Identifier ${getLineBreak()}${path} ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] parseScript - 解析 Identifier ${getLineBreak()}${path} ${getLineBreak()}`) if (path.isReferenced() && path.node.name === 'wx') { path.replaceWith(t.identifier('Taro')) } }, CallExpression (path) { - updateLogFileContent(`INFO [taroize] parseScript - 解析CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] parseScript - 解析 CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) const callee = path.get('callee') replaceIdentifier(callee as NodePath) replaceMemberExpression(callee as NodePath) @@ -140,7 +140,7 @@ export function parseScript ( // 将类组件进行导出 if (isCommonjsModule(ast.program.body)) { - // 组件导出格式为module.exports = + // 组件导出格式为 module.exports = ast.program.body.push( classDecl, t.expressionStatement( @@ -152,7 +152,7 @@ export function parseScript ( ) ) } else { - // 组件导出格式为export default + // 组件导出格式为 export default ast.program.body.push( classDecl, t.exportDefaultDeclaration(t.identifier(componentType !== 'App' ? defaultClassName : 'App')) @@ -162,19 +162,22 @@ export function parseScript ( }, } - traverse(ast, vistor) + traverse(ast, visitor) if (!foundWXInstance) { ast = parseCode(script + ';Component({})') - traverse(ast, vistor) + traverse(ast, visitor) } - const requirewithWeapp = t.variableDeclaration('const', [ + const requireWithWeapp = t.variableDeclaration('const', [ t.variableDeclarator( t.objectPattern([t.objectProperty(t.identifier('default'), t.identifier('withWeapp'), false, true)]), t.callExpression(t.identifier('require'), [t.stringLiteral('@tarojs/with-weapp')]) ), ]) + + const useVirtualList = usedComponents.delete('VirtualList') + if (isCommonjsModule(ast.program.body)) { const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents], '', true) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro', true) @@ -183,11 +186,14 @@ export function parseScript ( taroComponentsImport, reactImport, taroImport, - requirewithWeapp, + requireWithWeapp, ...wxses .filter((wxs) => !wxs.src.startsWith('./wxs__')) .map((wxs) => buildImportStatement(wxs.src, [], wxs.module, true)) ) + if (useVirtualList) { + ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'], '', true)) + } } else { const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents]) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro') @@ -196,11 +202,14 @@ export function parseScript ( taroComponentsImport, reactImport, taroImport, - requirewithWeapp, + requireWithWeapp, ...wxses .filter((wxs) => !wxs.src.startsWith('./wxs__')) .map((wxs) => buildImportStatement(wxs.src, [], wxs.module)) ) + if (useVirtualList) { + ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'])) + } } return ast @@ -219,7 +228,7 @@ function parsePage ( const stateKeys: string[] = [] pagePath.traverse({ CallExpression (path) { - updateLogFileContent(`INFO [taroize] parsePage - 解析CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] parsePage - 解析 CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) const callee = path.get('callee') replaceIdentifier(callee as NodePath) replaceMemberExpression(callee as NodePath) @@ -254,11 +263,11 @@ function parsePage ( ) // @withWeapp 通过调用 cacheOptions.getOptionsFromCache() 获取 options - const withWeappArgmentNode = t.callExpression( + const withWeappArgumentNode = t.callExpression( t.memberExpression(t.identifier('cacheOptions'), t.identifier('getOptionsFromCache')), [] ) - classDecl.decorators = [buildDecorator(withWeappArgmentNode, isApp)] + classDecl.decorators = [buildDecorator(withWeappArgumentNode, isApp)] return classDecl } diff --git a/packages/taroize/src/utils.ts b/packages/taroize/src/utils.ts index 40119beba16b..046877a2f61e 100644 --- a/packages/taroize/src/utils.ts +++ b/packages/taroize/src/utils.ts @@ -27,7 +27,7 @@ const prettierJSConfig: prettier.Options = { /** * 标准化传入路径 * - * @param path 如D:\\admin格式路径 + * @param path 如 D:\\admin 格式路径 * @returns 替换\\返回标准路径 */ export function normalizePath (path) { @@ -95,14 +95,14 @@ export function parseCode (code: string, scriptPath?: string) { // 结尾注释会引起 parseCode 报错,因此收录到报告中 if (error.message.includes('Unterminated comment')) { throw new IReportError( - 'WXML代码解析失败, 代码中存在不完整的注释', + 'WXML 代码解析失败,代码中存在不完整的注释', 'UnterminatedComment', 'WXML_FILE', code || '' ) } } - // 移除Flow类型注释 + // 移除 Flow 类型注释 traverse(ast, { TypeAnnotation (path) { path.remove() @@ -117,11 +117,11 @@ export const buildTemplate = (str: string) => { let ast if (hasPlaceholder) { - // 如果存在占位符,则使用模板创建AST + // 如果存在占位符,则使用模板创建 AST const astTemplate = template(str) ast = astTemplate({}) } else { - // 否则直接解析字符串为AST + // 否则直接解析字符串为 AST ast = parse(str).program.body[0] } if (t.isExpressionStatement(ast)) { @@ -205,7 +205,7 @@ export function buildImportStatement ( if (isCommonjsModule) { if (defaultSpec && specifiers.length > 0) { throw new Error( - `commomjs模块不支持同时引入default和非default模块,default:${defaultSpec}, 非default:${specifiers}` + `commonjs 模块不支持同时引入 default 和非 default 模块,default:${defaultSpec}, 非 default:${specifiers}` ) } return t.variableDeclaration('const', [ @@ -304,7 +304,7 @@ export const DEFAULT_Component_SET = new Set([ ]) /** - * 根据关键字exports判断是否为commonjs模块 + * 根据关键字 exports 判断是否为 commonjs 模块 * * @param {} bodyNode * @returns {boolean} @@ -347,7 +347,7 @@ export function getLineBreak () { } /** - * 记录数据到logFileContent中 + * 记录数据到 logFileContent 中 * * @param data 日志数据 */ @@ -455,7 +455,7 @@ export class IReportError extends Error { } /** - * 将oldElement的position信息赋值给newElement的position属性 + * 将 oldElement 的 position 信息赋值给 newElement 的 position 属性 * * @param newElement 新节点 * @param oldElement 旧节点 diff --git a/packages/taroize/src/wxml.ts b/packages/taroize/src/wxml.ts index a61c4c39c954..302c8a2451cf 100644 --- a/packages/taroize/src/wxml.ts +++ b/packages/taroize/src/wxml.ts @@ -87,13 +87,13 @@ export interface Imports { ast: t.File name: string wxs?: boolean - // 模板处理事件的function + // 模板处理事件的 function funcs?: Set tmplName?: string } /** - * wxml界面下的template模板信息 + * wxml 界面下的 template 模板信息 * * @param { any[] } funcs 模板所用方法集 * @param { any[] } applyTemplates 套用模板集 @@ -130,18 +130,18 @@ function buildElement (name: string, children: Node[] = [], attributes: Attribut } } -// 将 style 属性中属性名转小驼峰格式 并且将 {{}} 转为 ${}格式生成对应ast节点 +// 将 style 属性中属性名转小驼峰格式 并且将 {{}} 转为 ${}格式生成对应 ast 节点 function convertStyleAttrs (styleAttrsMap: any[]) { updateLogFileContent(`INFO [taroize] convertStyleAttrs - 进入函数 ${getLineBreak()}`) styleAttrsMap.forEach((attr) => { attr.attrName = toCamelCase(attr.attrName.trim()) // 匹配 {{}} 内部以及左右两边值 const attrValueReg = /([^{}]*)\{\{([^{}]*)\}\}([^{}]*)/ - const matchs = attrValueReg.exec(attr.value) - if (matchs !== null) { - const tempLeftValue = matchs[1] || '' - const tempMidValue = matchs[2] || '' - const tempRightValue = matchs[3] || '' + const matches = attrValueReg.exec(attr.value) + if (matches !== null) { + const tempLeftValue = matches[1] || '' + const tempMidValue = matches[2] || '' + const tempRightValue = matches[3] || '' // 将模版中的内容转换为 ast 节点 const tempMidValueAst = parseFile(tempMidValue).program.body[0] as any attr.value = t.templateLiteral( @@ -166,9 +166,9 @@ function parseStyleAttrs (styleAttrsMap: any[], attrKeyValueMap: any[]) { if (attr) { // 对含三元运算符的写法 style="width:{{ xx ? xx : xx }}" 匹配第一个 : 避免匹配三元表达式中的 : 运算符 const reg = /([^:]+):\s*([^;]+)/ - const matchs = attr.match(reg) - const attrName = matchs[1] - const value = matchs[2] + const matches = attr.match(reg) + const attrName = matches[1] + const value = matches[2] if (attrName) { attrKeyValueMap.push({ attrName, value }) } @@ -178,9 +178,9 @@ function parseStyleAttrs (styleAttrsMap: any[], attrKeyValueMap: any[]) { export function convertStyleUnit (value: string) { let tempValue = value - // 尺寸单位转换 都转为rem : 1rpx 转为 1/40rem,,1px 转为 1/20rem + // 尺寸单位转换 都转为 rem : 1rpx 转为 1/40rem,,1px 转为 1/20rem if (tempValue.indexOf('px') !== -1) { - // 把 xxx="...[数字]rpx/px" 的尺寸单位都转为 rem, 转换方法类似postcss-taro-unit-transform + // 把 xxx="...[数字]rpx/px" 的尺寸单位都转为 rem, 转换方法类似 postcss-taro-unit-transform try { tempValue = tempValue .replace(/\s*-?([0-9.]+)(px)\b/gi, function (match, size, unit) { @@ -195,10 +195,10 @@ export function convertStyleUnit (value: string) { } return match.replace(size, parseFloat(size) / 40 + '').replace(unit, 'rem') }) - // 把 xx="...{{参数}}rpx/px"的尺寸单位都转为rem,比如"{{参数}}rpx" -> "{{参数/40}}rem" + // 把 xx="...{{参数}}rpx/px"的尺寸单位都转为 rem,比如"{{参数}}rpx" -> "{{参数/40}}rem" tempValue = tempValue .replace(/\{\{([^{}]*)\}\}(px)/gi, function (match, size, unit) { - // 判断{{}}是否包含加减乘除算式和三元表达式, 是的话得加括号 + // 判断{{}}是否包含加减乘除算式和三元表达式,是的话得加括号 if (match.match(/[+\-*/?]/g)) { return match.replace(size, '(' + size + ')/20').replace(unit, 'rem') } @@ -213,13 +213,13 @@ export function convertStyleUnit (value: string) { } catch (error) { createErrorCodeMsg( 'WxmlUnitConversionError', - `wxml内px/rpx单位转换失败: ${error}`, + `wxml 内 px/rpx 单位转换失败:${error}`, tempValue, globals.currentParseFile ) - printLog(processTypeEnum.ERROR, `wxml内px/rpx单位转换失败: ${error}`) + printLog(processTypeEnum.ERROR, `wxml 内 px/rpx 单位转换失败:${error}`) updateLogFileContent( - `WARN [taroize] convertStyleUnit - wxml内px/rpx单位转换异常 ${getLineBreak()}${error} ${getLineBreak()}` + `WARN [taroize] convertStyleUnit - wxml 内 px/rpx 单位转换异常 ${getLineBreak()}${error} ${getLineBreak()}` ) } } @@ -227,16 +227,16 @@ export function convertStyleUnit (value: string) { } /** - * 预解析,收集wxml所有的模板信息 + * 预解析,收集 wxml 所有的模板信息 * - * @param { any[] } templates wxml页面下的模板信息 + * @param { any[] } templates wxml 页面下的模板信息 * @returns Visitor */ export const createPreWxmlVistor = (templates: Map) => { updateLogFileContent( `INFO [taroize] createPreWxmlVistor - 入参 ${getLineBreak()}templates: ${templates} ${getLineBreak()}` ) - // const Applys = new Map() + // const Appls = new Map() return { JSXElement: { enter (path: NodePath) { @@ -262,13 +262,13 @@ export const createPreWxmlVistor = (templates: Map) => { } /** - * 根据template中使用的wxs组装需要导入的wxs语句 - * 如: import xxx from '../xxx.wxs.js' + * 根据 template 中使用的 wxs 组装需要导入的 wxs 语句 + * 如:import xxx from '../xxx.wxs.js' * - * @param templateFileName template模版文件名 - * @param usedWxses template中使用的变量是wxs模块的集合 + * @param templateFileName template 模版文件名 + * @param usedWxses template 中使用的变量是 wxs 模块的集合 * @param dirPath 当前解析文件的路径 - * @returns 需要导入的wxs语句集合 + * @returns 需要导入的 wxs 语句集合 */ export function getWxsImports (templateFileName, usedWxses, dirPath) { const templatePath = path.join(globals.rootPath, 'imports', `${templateFileName}.js`) @@ -293,7 +293,7 @@ export const createWxmlVistor = ( const jsxAttrVisitor = (path: NodePath) => { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` ) const name = path.node.name as t.JSXIdentifier const jsx = path.findParent((p) => p.isJSXElement()) as NodePath @@ -308,7 +308,7 @@ export const createWxmlVistor = ( } } - // 当设置图片mode="",则改为默认值(且taro不支持mode空值) + // 当设置图片 mode="",则改为默认值 (且 taro 不支持 mode 空值) if (name.name === 'mode' && path.node.value === null) { path.set('value', t.stringLiteral('scaleToFill')) } @@ -339,26 +339,26 @@ export const createWxmlVistor = ( const renameJSXKey = (path: NodePath) => { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` ) const nodeName = path.node.name if (path.parentPath.isJSXAttribute()) { const cacheNode = cloneDeep(path.parentPath.parentPath.parent) as any if (nodeName === WX_SHOW) { - path.replaceWith(t.jSXIdentifier(WX_IF)) // wx:show转换后不支持,不频繁切换的话wx:if可替代 + path.replaceWith(t.jSXIdentifier(WX_IF)) // wx:show 转换后不支持,不频繁切换的话 wx:if 可替代 const position = { col: cacheNode.position?.start.column || 0, row: cacheNode.position?.start.line || 0 } createErrorCodeMsg( 'uncompilableAttribute', - `属性 ${nodeName}不能编译,会被替换为wx:if`, + `属性 ${nodeName}不能编译,会被替换为 wx:if`, astToCode(cacheNode) || '', globals.currentParseFile, position ) // eslint-disable-next-line no-console - console.log(`属性 ${nodeName}不能编译,会被替换为wx:if`) + console.log(`属性 ${nodeName}不能编译,会被替换为 wx:if`) updateLogFileContent( `WARN [taroize] createWxmlVistor - ${nodeName} 属性不能编译,会被替换为 wx:if ${getLineBreak()}` ) @@ -377,7 +377,7 @@ export const createWxmlVistor = ( // eslint-disable-next-line no-console console.log(`未知 wx 作用域属性: ${nodeName},该属性会被移除掉。`) updateLogFileContent( - `WARN [taroize] createWxmlVistor - 未知 wx 作用域属性: ${nodeName},该属性会被移除掉 ${getLineBreak()}` + `WARN [taroize] createWxmlVistor - 未知 wx 作用域属性:${nodeName},该属性会被移除掉 ${getLineBreak()}` ) path.parentPath.remove() } @@ -390,7 +390,7 @@ export const createWxmlVistor = ( Identifier: { enter (path: NodePath) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析Identifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 Identifier ${getLineBreak()}${path} ${getLineBreak()}` ) if (!path.isReferencedIdentifier()) { return @@ -407,7 +407,7 @@ export const createWxmlVistor = ( JSXElement: { enter (path: NodePath) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析JSXElement ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 JSXElement ${getLineBreak()}${path} ${getLineBreak()}` ) const openingElement = path.get('openingElement') const jsxName = openingElement.get('name') @@ -444,7 +444,7 @@ export const createWxmlVistor = ( path.remove() } } else { - // 当元素设置slot标签且值为空串时,移除slot属性 + // 当元素设置 slot 标签且值为空串时,移除 slot 属性 slotAttr.remove() } } @@ -501,6 +501,7 @@ export const createWxmlVistor = ( let funcs = new Set() const { ast: classDecl, name, tmplName, usedWxses } = template const wxsImports = getWxsImports(name, usedWxses, dirPath) + const useVirtualList = usedComponents.delete('VirtualList') const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents]) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro') const reactImport = buildImportStatement('react', [], 'React') @@ -516,8 +517,11 @@ export const createWxmlVistor = ( classDecl, t.exportDefaultDeclaration(t.identifier(name)) ) + if (useVirtualList) { + ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'])) + } const usedTemplate = new Set() - // funcs的值首先来源于预解析结果 + // funcs 的值首先来源于预解析结果 if (templates) { const applyFuncs = templates.get(name)?.funcs if (applyFuncs) { @@ -528,7 +532,7 @@ export const createWxmlVistor = ( traverse(ast, { JSXIdentifier (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` ) const node = path.node if (node.name.endsWith('Tmpl') && node.name.length > 4 && path.parentPath.isJSXOpeningElement()) { @@ -550,7 +554,7 @@ export const createWxmlVistor = ( templateFuncs.forEach((templateFunc) => { const value = t.jsxExpressionContainer(t.identifier(templateFunc)) const name = t.jsxIdentifier(templateFunc) - // 传递的方法插入到Tmpl标签属性中 + // 传递的方法插入到 Tmpl 标签属性中 attributes.push(t.jsxAttribute(name, value)) if (!funcs.has(templateFunc)) { funcs.add(templateFunc) @@ -561,9 +565,9 @@ export const createWxmlVistor = ( }, JSXAttribute (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` ) - // 识别template使用到的处理事件的func + // 识别 template 使用到的处理事件的 func const node = path.node if ( t.isJSXExpressionContainer(node.value) && @@ -572,22 +576,22 @@ export const createWxmlVistor = ( t.isIdentifier(node.value.expression.property) ) { const funcName = node.value.expression.property.name - // func的调用形式 this.func --> func + // func 的调用形式 this.func --> func path.replaceWith(t.jsxAttribute(node.name, t.jsxExpressionContainer(t.identifier(funcName)))) } }, }) traverse(ast, { - // 将使用到的处理事件的func写入到props + // 将使用到的处理事件的 func 写入到 props BlockStatement (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析BlockStatement ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVistor - 解析 BlockStatement ${getLineBreak()}${path} ${getLineBreak()}` ) if (funcs.size > 0) { const body = path.node.body if (t.isVariableDeclaration(body[0])) { - // 如果已经定义了props + // 如果已经定义了 props const declarator = body[0].declarations[0] if (t.isObjectPattern(declarator.id)) { const properties = declarator.id.properties @@ -735,7 +739,7 @@ export function parseWXML (dirPath: string, wxml?: string, parseImport?: boolean } } } catch (error) { - updateLogFileContent(`WARN [taroize] parseWXML - wxml代码格式化异常 ${getLineBreak()}${error} ${getLineBreak()}`) + updateLogFileContent(`WARN [taroize] parseWXML - wxml 代码格式化异常 ${getLineBreak()}${error} ${getLineBreak()}`) // } @@ -767,10 +771,10 @@ export function parseWXML (dirPath: string, wxml?: string, parseImport?: boolean if (parseResult) { return parseResult } - // 在解析wxml页面前,先进行预解析 + // 在解析 wxml 页面前,先进行预解析 // 当前预解析主要为了抽取页面下的模板信息 traverse(ast, createPreWxmlVistor(templates)) - // 获取template调用后,需要通过遍历,获取某个模板完整的调用关系 + // 获取 template 调用后,需要通过遍历,获取某个模板完整的调用关系 templateBfs(templates) traverse(ast, createWxmlVistor(loopIds, refIds, dirPath, wxses, imports, templates)) @@ -854,8 +858,8 @@ function getWXS (attrs: t.JSXAttribute[], path: NodePath, imports: const ast = parseCode(script.value) traverse(ast, { CallExpression (path) { - updateLogFileContent(`INFO [taroize] getWXS - 解析CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) - // wxs标签中getRegExp转换为new RegExp + updateLogFileContent(`INFO [taroize] getWXS - 解析 CallExpression ${getLineBreak()}${path} ${getLineBreak()}`) + // wxs 标签中 getRegExp 转换为 new RegExp if (t.isIdentifier(path.node.callee, { name: 'getRegExp' })) { // 根据正则表达式是否定义了正则匹配修饰符,有则不变,没有就用默认 if (path.node.arguments.length > 1) { @@ -941,7 +945,7 @@ function getWXS (attrs: t.JSXAttribute[], path: NodePath, imports: } } - // wxs标签中getDate()转换为new Date() + // wxs 标签中 getDate() 转换为 new Date() if (t.isIdentifier(path.node.callee, { name: 'getDate' })) { let argument: any = [] let newDate: t.NewExpression @@ -1079,7 +1083,7 @@ function transformLoop (name: string, attr: NodePath, jsx: NodeP if (node.value.value === '*this') { node.value = t.jSXExpressionContainer(t.identifier(item.value)) } else if (node.value.value === 'index') { - // index表示item在数组里的下标, 并不是item的某个property, 单独抽出来处理 + // index 表示 item 在数组里的下标,并不是 item 的某个 property, 单独抽出来处理 node.value = t.jSXExpressionContainer(t.identifier(node.value.value)) } else { node.value = t.jSXExpressionContainer( @@ -1103,10 +1107,10 @@ function transformLoop (name: string, attr: NodePath, jsx: NodeP jsx.replaceWith(ifBlock) } catch (error) { updateLogFileContent( - `WARN [taroize] transformLoop - wx:if和wx:for合用时父组件使用wx:if导致使用replaceWith异常 ${getLineBreak()}${error} ${getLineBreak()}` + `WARN [taroize] transformLoop - wx:if 和 wx:for 合用时父组件使用 wx:if 导致使用 replaceWith 异常 ${getLineBreak()}${error} ${getLineBreak()}` ) - // jsx外层是wx:if的转换,替换(replaceWith)时会抛出异常 - // catch异常后,正常替换 + // jsx 外层是 wx:if 的转换,替换(replaceWith)时会抛出异常 + // catch 异常后,正常替换 } p.remove() } @@ -1148,7 +1152,7 @@ function transformIf (name: string, attr: NodePath, jsx: NodePat if (jsx.node.openingElement.attributes.some((a) => t.isJSXAttribute(a) && a.name.name === 'slot')) { return } - // 考虑到wx:if和wx:for的优先级,如果同时使用,先解析wx:for + // 考虑到 wx:if 和 wx:for 的优先级,如果同时使用,先解析 wx:for if ( jsx.node.openingElement.attributes.some( (a) => t.isJSXAttribute(a) && (a.name.name === 'wx:for' || a.name.name === 'wx:for-items') @@ -1477,7 +1481,7 @@ function isAllKeyValueFormat (styleAttrsMap: any[]): boolean { } /** - * 解析内联style属性 + * 解析内联 style 属性 * * @param key 内联属性的类型 * @param value 内联属性的值 @@ -1488,7 +1492,7 @@ export function parseStyle (key: string, value: string) { `INFO [taroize] parseStyle - 入参 ${getLineBreak()}key: ${key} ${getLineBreak()}value: ${value} ${getLineBreak()}` ) const styleAttrs = value.trim().split(';') - // 针对attrName: attrValue 格式做转换处理, 其他类型采用'+'连接符 + // 针对 attrName: attrValue 格式做转换处理,其他类型采用'+'连接符 if (isAllKeyValueFormat(styleAttrs)) { const attrKeyValueMap: any[] = [] parseStyleAttrs(styleAttrs, attrKeyValueMap) @@ -1528,7 +1532,7 @@ function parseAttribute (attr: Attribute) { } value = convertStyleUnit(value) - // 判断属性是否为style属性 + // 判断属性是否为 style 属性 if (key === 'style' && value) { try { const styleParseReslut = parseStyle(key, value) as any @@ -1564,7 +1568,7 @@ function parseAttribute (attr: Attribute) { } catch (error) { const pureContent = content.slice(1, content.length - 1) if (reserveKeyWords.has(pureContent)) { - const err = `转换模板参数: \`${key}: ${value}\` 报错: \`${pureContent}\` 是 JavaScript 保留字,请不要使用它作为值。` + const err = `转换模板参数: \`${key}: ${value}\` 报错:\`${pureContent}\` 是 JavaScript 保留字,请不要使用它作为值。` if (key === WX_KEY) { expr = t.stringLiteral('') } else { @@ -1628,7 +1632,7 @@ function parseAttribute (attr: Attribute) { jsxValue = t.jSXExpressionContainer(t.memberExpression(t.thisExpression(), t.identifier(jsxValue.value))) } } - // 如果data-xxx自定义属性名xxx不是以-分隔的写法就要转成全小写属性名 + // 如果 data-xxx 自定义属性名 xxx 不是以 - 分隔的写法就要转成全小写属性名 if (value && jsxKey.startsWith('data-')) { const realKey = jsxKey.replace(/^data-/, '') if (realKey.indexOf('-') === -1) { From 4e95523d99b806949fe49692326f62295280d5c6 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 2 Jul 2025 17:06:31 +0800 Subject: [PATCH 7/9] test(taroize): snap --- .../__tests__/__snapshots__/wxml.test.ts.snap | 1282 ++++++++--------- packages/taroize/__tests__/template.test.ts | 2 +- packages/taroize/src/template.ts | 46 +- packages/taroize/src/vue.ts | 4 +- packages/taroize/src/wxml.ts | 40 +- 5 files changed, 687 insertions(+), 687 deletions(-) diff --git a/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap b/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap index 3db4409abfe5..d15c18f86530 100644 --- a/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap +++ b/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap @@ -25,31 +25,31 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml__ -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement Hello Word! -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement Hello Word! -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_message @@ -67,33 +67,33 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_message -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {data} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {data} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier data -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_component_properties_string @@ -110,43 +110,43 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_component_properties_string -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id="item-view1" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id="item-view1" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id="item-view1" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_component_properties_variable @@ -163,45 +163,45 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_component_properties_variable -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id={"item-" + id} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id={"item-" + id} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute id={"item-" + id} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier id -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier id -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_keywords @@ -218,43 +218,43 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_keywords -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute checked={false} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier checked -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute checked={false} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier checked -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute checked={false} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier checked -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Checkbox -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_ternary_operations @@ -275,45 +275,45 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_ternary_operations -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute hidden={flag ? true : false} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier wx:if -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement Hidden -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:if={!(flag ? true : false)} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier flag -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement Hidden -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_string_operations @@ -331,33 +331,33 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_string_operations -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {"hello" + name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {"hello" + name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_wx_for @@ -378,95 +378,95 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_wx_for -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {index + ": " + item.message} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:for={array} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {array.map((item, index) => { return {index + ": " + item.message}; })} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier array -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier map -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {index + ": " + item.message} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier message -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier array -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier map -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {index + ": " + item.message} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier message -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_key @@ -493,159 +493,159 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_key -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {item.name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:key="index" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier wx:key -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:for={data} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {data.map((item, index) => { return {item.name}; })} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier data -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier map -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {item.name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {item.name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier data -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier map -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {item.name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute key={index} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier key -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier index -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {item.name} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier item -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Text -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_if @@ -685,69 +685,69 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_if -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 5}>1 2}>23 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:if={length > 5} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier length -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 1 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier length -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 2 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 3 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_show @@ -768,48 +768,48 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_show -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 测试使用 wx:if 替换 wx:show 属性 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:show={isShow} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier wx:show -WARN [taroize] createWxmlVistor - wx:show 属性不能编译,会被替换为 wx:if -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +WARN [taroize] createWxmlVisitor - wx:show 属性不能编译,会被替换为 wx:if +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier wx:if -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 测试使用 wx:if 替换 wx:show 属性 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute wx:if={isShow} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier isShow -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 测试使用 wx:if 替换 wx:show 属性 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: wxml_unsupported_classArray @@ -827,43 +827,43 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxml_unsupported_classArray -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="12,3" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="12,3" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="12,3" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: anonymity_slot @@ -890,80 +890,80 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: anonymity_slot -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部节点 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部节点 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部节点 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - tagName: Slot -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - tagName: Slot +INFO [taroize] createWxmlVisitor - 解析 Identifier props -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier children -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: anonymity_wxml_slot @@ -987,71 +987,71 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: anonymity_wxml_slot -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 插入 slot 的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 插入 slot 的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 插入 slot 的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 插入 slot 的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: named_slot @@ -1087,123 +1087,123 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: named_slot -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部细节 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部细节 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - tagName: Slot -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - tagName: Slot +INFO [taroize] createWxmlVisitor - 解析 Identifier props -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier renderBefore -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部细节 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - tagName: Slot -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - tagName: Slot +INFO [taroize] createWxmlVisitor - 解析 Identifier props -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier renderAfter -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: named_wxml_slot @@ -1240,117 +1240,117 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: named_wxml_slot -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="before" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: component_slot_empty @@ -1386,121 +1386,121 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: component_slot_empty -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="before"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是插入到组件 slot name="after"中的内容 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute slot="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier SlotComponent -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseWXML - 入参 dirPath: slot_name_no_string @@ -1536,92 +1536,92 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: slot_name_no_string -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部细节 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name={123} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement 这里是组件的内部细节 -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name={123} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name="after" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute className="wrapper" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier className -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute name={123} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier name -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Slot -INFO [taroize] createWxmlVistor - tagName: Slot -ERROR [taroize] createWxmlVistor - slot 的值不是一个字符串 +INFO [taroize] createWxmlVisitor - tagName: Slot +ERROR [taroize] createWxmlVisitor - slot 的值不是一个字符串 INFO [taroize] parse - 入参 option: {"framework":"react","json":"{}","logFilePath":"","path":"wxs_src","rootPath":"","script":"Page({})","scriptPath":"","wxml":"n n {{wxs_test.foo}}n {{wxs_test.bar('nihao')}}n ","isApp":false} INFO [taroize] parseWXML - 入参 @@ -1656,90 +1656,90 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] createPreWxmlVistor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 -INFO [taroize] createWxmlVistor - 入参 +INFO [taroize] createWxmlVisitor - 入参 dirPath: wxs_src -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {wxs_test.foo}{wxs_test.bar('nihao')} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Wxs -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute src=".././../utils/test.wxs" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier src -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute module="wxs_test" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier module -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Wxs -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Wxs -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute src=".././../utils/test.wxs" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier src -INFO [taroize] createWxmlVistor - 解析JSXAttribute +INFO [taroize] createWxmlVisitor - 解析 JSXAttribute module="wxs_test" -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier module -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Wxs -INFO [taroize] createWxmlVistor - tagName: Wxs -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - tagName: Wxs +INFO [taroize] createWxmlVisitor - 解析 JSXElement {wxs_test.foo} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier wxs_test -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier foo -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXElement +INFO [taroize] createWxmlVisitor - 解析 JSXElement {wxs_test.bar('nihao')} -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier wxs_test -INFO [taroize] createWxmlVistor - 解析Identifier +INFO [taroize] createWxmlVisitor - 解析 Identifier bar -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier View -INFO [taroize] createWxmlVistor - 解析JSXIdentifier +INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier Block INFO [taroize] parseScript - 入参 scriptPath: INFO [taroize] parseCode - 入参 scriptPath: -INFO [taroize] parseScript - 解析CallExpression +INFO [taroize] parseScript - 解析 CallExpression Page({}) INFO [taroize] parsePage - 入参 pagePath: Page({}) -INFO [taroize] parseScript - 解析Identifier +INFO [taroize] parseScript - 解析 Identifier Page , } diff --git a/packages/taroize/__tests__/template.test.ts b/packages/taroize/__tests__/template.test.ts index a9c0ef964660..2bb9ce11986c 100644 --- a/packages/taroize/__tests__/template.test.ts +++ b/packages/taroize/__tests__/template.test.ts @@ -321,7 +321,7 @@ describe('template.ts', () => { parseWXML(dirPath, wxml) expect(spy).toHaveBeenCalledTimes(1) expect(spy.mock.calls[0][0]).toMatchInlineSnapshot( - `标签: 没有自动关闭。形如: 才是标准的 wxml 格式。` + `标签: 没有自动关闭。形如: 才是标准的 wxml 格式。` ) }) }) diff --git a/packages/taroize/src/template.ts b/packages/taroize/src/template.ts index efbcbedb05b4..a61bf929878b 100644 --- a/packages/taroize/src/template.ts +++ b/packages/taroize/src/template.ts @@ -14,7 +14,7 @@ import { setting, updateLogFileContent, } from './utils' -import { createWxmlVistor, parseWXML, WXS } from './wxml' +import { createWxmlVisitor, parseWXML, WXS } from './wxml' import type { NodePath } from '@babel/traverse' @@ -43,10 +43,10 @@ export function buildTemplateName (name: string, pascal = true): string { } /** - * 支持import的src绝对路径转为相对路径 + * 支持 import 的 src 绝对路径转为相对路径 * * @param dirPath 文件目录的绝对路径 - * @param srcPath import的src路径 + * @param srcPath import 的 src 路径 * @returns 处理后的相对路径 */ export function getSrcRelPath (dirPath: string, srcPath: string) { @@ -69,8 +69,8 @@ export function getSrcRelPath (dirPath: string, srcPath: string) { } /** - * @description 预解析template模板 - * @param path template在AST中的区域 + * @description 预解析 template 模板 + * @param path template 在 AST 中的区域 * @returns */ export function preParseTemplate (path: NodePath) { @@ -89,7 +89,7 @@ export function preParseTemplate (path: NodePath) { if (!(name && t.isJSXAttribute(name.node))) { return } - // 获取template name + // 获取 template name const value = name.node.value if (value === null || !t.isStringLiteral(value)) { // @ts-ignore @@ -108,8 +108,8 @@ export function preParseTemplate (path: NodePath) { const templateApplys = new Set() path.traverse({ JSXAttribute (p) { - updateLogFileContent(`INFO [taroize] preParseTemplate - 解析JSXAttribute ${getLineBreak()}${p} ${getLineBreak()}`) - // 获取 template方法 + updateLogFileContent(`INFO [taroize] preParseTemplate - 解析 JSXAttribute ${getLineBreak()}${p} ${getLineBreak()}`) + // 获取 template 方法 const node = p.node if ( t.isJSXExpressionContainer(node.value) && @@ -117,7 +117,7 @@ export function preParseTemplate (path: NodePath) { t.isThisExpression(node.value.expression.object) && t.isIdentifier(node.value.expression.property) ) { - // funcName加入到funcs + // funcName 加入到 funcs const funcName = node.value.expression.property.name if (!templateFuncs.has(funcName)) { templateFuncs.add(funcName) @@ -126,9 +126,9 @@ export function preParseTemplate (path: NodePath) { }, JSXOpeningElement (p) { updateLogFileContent( - `INFO [taroize] preParseTemplate - 解析JSXOpeningElement ${getLineBreak()}${p} ${getLineBreak()}` + `INFO [taroize] preParseTemplate - 解析 JSXOpeningElement ${getLineBreak()}${p} ${getLineBreak()}` ) - // 获取 template调用的模板 + // 获取 template 调用的模板 const attrs = p.get('attributes') const is = attrs.find( (attr) => @@ -153,7 +153,7 @@ export function preParseTemplate (path: NodePath) { position ) } - // is的模板调用形式为 is="xxx", xxx为模板名或表达式 + // is 的模板调用形式为 is="xxx", xxx 为模板名或表达式 if (t.isStringLiteral(value)) { const apply = buildTemplateName(value.value) templateApplys.add(apply) @@ -206,13 +206,13 @@ export function parseTemplate (path: NodePath, dirPath: string, wx if (value === null || !t.isStringLiteral(value)) { throw new Error('template 的 `name` 属性只能是字符串') } - // 收集template原始name, 作为map的key + // 收集 template 原始 name, 作为 map 的 key const templateName = value.value const className = buildTemplateName(value.value) - path.traverse(createWxmlVistor(loopIds, refIds, dirPath, [], imports)) + path.traverse(createWxmlVisitor(loopIds, refIds, dirPath, [], imports)) - // refIds中可能包含wxs模块,应从refIds中去除并单独以模块的形式导入 + // refIds 中可能包含 wxs 模块,应从 refIds 中去除并单独以模块的形式导入 const usedWxses = new Set() const refdata = refIds refdata.forEach((refId) => { @@ -250,7 +250,7 @@ export function parseTemplate (path: NodePath, dirPath: string, wx t.classBody([render]), [] ) - // 添加withWeapp装饰器 + // 添加 withWeapp 装饰器 classDecl.decorators = [t.decorator(t.callExpression(t.identifier('withWeapp'), [t.objectExpression([])]))] path.remove() return { @@ -363,7 +363,7 @@ export function parseTemplate (path: NodePath, dirPath: string, wx ) } -export function getWXMLsource (dirPath: string, src: string, type: string) { +export function getWxmlSource (dirPath: string, src: string, type: string) { try { let filePath = join(dirPath, src) if (!extname(filePath)) { @@ -412,9 +412,9 @@ export function parseModule (jsx: NodePath, dirPath: string, type: // @ts-ignore const { line, column } = jsx.node?.position?.start || { line: 0, column: 0 } const position = { col: column, row: line } - updateLogFileContent(`ERROR [taroize] parseModule - ${type} 标签src AST节点未包含node ${getLineBreak()}`) + updateLogFileContent(`ERROR [taroize] parseModule - ${type} 标签 src AST 节点未包含 node ${getLineBreak()}`) throw new IReportError( - `${type} 标签src AST节点 必须包含node`, + `${type} 标签 src AST 节点 必须包含 node`, 'WxmlTagSrcAttributeError', 'WXML_FILE', astToCode(jsx.node) || '', @@ -452,7 +452,7 @@ export function parseModule (jsx: NodePath, dirPath: string, type: ) } if (type === 'import') { - const wxml = getWXMLsource(dirPath, srcValue, type) + const wxml = getWxmlSource(dirPath, srcValue, type) const { imports } = parseWXML(resolve(dirPath, srcValue), wxml, true) try { jsx.remove() @@ -461,15 +461,15 @@ export function parseModule (jsx: NodePath, dirPath: string, type: } return imports } else { - const wxmlStr = getWXMLsource(dirPath, srcValue, type) + const wxmlStr = getWxmlSource(dirPath, srcValue, type) const block = buildBlockElement() if (wxmlStr === '') { if (jsx.node.children.length) { console.error( - `标签: 没有自动关闭。形如: 才是标准的 wxml 格式。` + `标签: 没有自动关闭。形如: 才是标准的 wxml 格式。` ) updateLogFileContent( - `WARN [taroize] parseModule - 标签: 没有自动关闭 ${getLineBreak()}` + `WARN [taroize] parseModule - 标签: 没有自动关闭 ${getLineBreak()}` ) } jsx.remove() diff --git a/packages/taroize/src/vue.ts b/packages/taroize/src/vue.ts index fa7f5be0d23b..bfe139dfd119 100644 --- a/packages/taroize/src/vue.ts +++ b/packages/taroize/src/vue.ts @@ -8,7 +8,7 @@ import { parse, stringify } from 'himalaya-wxml' import { kebabCase } from 'lodash' import { replaceIdentifier, replaceMemberExpression } from './script' -import { buildTemplateName, getWXMLsource } from './template' +import { buildTemplateName, getWxmlSource } from './template' import { buildImportStatement, codeFrameError, getLineBreak, parseCode, setting, updateLogFileContent } from './utils' import { AllKindNode, @@ -375,7 +375,7 @@ export function parseModule (element: Element, dirPath: string, imports: VueImpo } if (tagName === 'import') { - const wxml = getWXMLsource(dirPath, srcValue, tagName) + const wxml = getWxmlSource(dirPath, srcValue, tagName) const mods = parseWXML(resolve(dirPath, srcValue), wxml, imports || [])?.imports imports.push(...(mods || [])) } else { diff --git a/packages/taroize/src/wxml.ts b/packages/taroize/src/wxml.ts index 302c8a2451cf..3387b866c438 100644 --- a/packages/taroize/src/wxml.ts +++ b/packages/taroize/src/wxml.ts @@ -281,7 +281,7 @@ export function getWxsImports (templateFileName, usedWxses, dirPath) { return wxsImports } -export const createWxmlVistor = ( +export const createWxmlVisitor = ( loopIds: Set, refIds: Set, dirPath: string, @@ -289,11 +289,11 @@ export const createWxmlVistor = ( imports: Imports[] = [], templates?: Map ) => { - updateLogFileContent(`INFO [taroize] createWxmlVistor - 入参 ${getLineBreak()}dirPath: ${dirPath} ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - 入参 ${getLineBreak()}dirPath: ${dirPath} ${getLineBreak()}`) const jsxAttrVisitor = (path: NodePath) => { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` ) const name = path.node.name as t.JSXIdentifier const jsx = path.findParent((p) => p.isJSXElement()) as NodePath @@ -339,7 +339,7 @@ export const createWxmlVistor = ( const renameJSXKey = (path: NodePath) => { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` ) const nodeName = path.node.name if (path.parentPath.isJSXAttribute()) { @@ -360,7 +360,7 @@ export const createWxmlVistor = ( // eslint-disable-next-line no-console console.log(`属性 ${nodeName}不能编译,会被替换为 wx:if`) updateLogFileContent( - `WARN [taroize] createWxmlVistor - ${nodeName} 属性不能编译,会被替换为 wx:if ${getLineBreak()}` + `WARN [taroize] createWxmlVisitor - ${nodeName} 属性不能编译,会被替换为 wx:if ${getLineBreak()}` ) } else if (nodeName.startsWith('wx:') && !wxTemplateCommand.includes(nodeName)) { const position = { @@ -377,7 +377,7 @@ export const createWxmlVistor = ( // eslint-disable-next-line no-console console.log(`未知 wx 作用域属性: ${nodeName},该属性会被移除掉。`) updateLogFileContent( - `WARN [taroize] createWxmlVistor - 未知 wx 作用域属性:${nodeName},该属性会被移除掉 ${getLineBreak()}` + `WARN [taroize] createWxmlVisitor - 未知 wx 作用域属性:${nodeName},该属性会被移除掉 ${getLineBreak()}` ) path.parentPath.remove() } @@ -390,7 +390,7 @@ export const createWxmlVistor = ( Identifier: { enter (path: NodePath) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 Identifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 Identifier ${getLineBreak()}${path} ${getLineBreak()}` ) if (!path.isReferencedIdentifier()) { return @@ -407,7 +407,7 @@ export const createWxmlVistor = ( JSXElement: { enter (path: NodePath) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 JSXElement ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 JSXElement ${getLineBreak()}${path} ${getLineBreak()}` ) const openingElement = path.get('openingElement') const jsxName = openingElement.get('name') @@ -450,14 +450,14 @@ export const createWxmlVistor = ( } const tagName = jsxName.node.name if (tagName === 'Slot') { - updateLogFileContent(`INFO [taroize] createWxmlVistor - tagName: Slot ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - tagName: Slot ${getLineBreak()}`) const nameAttr = attrs.find((a) => t.isJSXAttribute(a.node) && a.node.name.name === 'name') let slotName = '' if (nameAttr && t.isJSXAttribute(nameAttr.node)) { if (nameAttr.node.value && t.isStringLiteral(nameAttr.node.value)) { slotName = nameAttr.node.value.value } else { - updateLogFileContent(`ERROR [taroize] createWxmlVistor - slot 的值不是一个字符串 ${getLineBreak()}`) + updateLogFileContent(`ERROR [taroize] createWxmlVisitor - slot 的值不是一个字符串 ${getLineBreak()}`) // const error = codeFrameError(jsxName.node, 'slot 的值必须是一个字符串') // @ts-ignore const { line, column } = path.node?.position?.start || { line: 0, column: 0 } @@ -479,13 +479,13 @@ export const createWxmlVistor = ( path.replaceWith(path.parentPath.isJSXElement() ? t.jSXExpressionContainer(children) : children) } catch (error) { updateLogFileContent( - `WARN [taroize] createWxmlVistor - Slot 节点替换异常 ${getLineBreak()}${error} ${getLineBreak()}` + `WARN [taroize] createWxmlVisitor - Slot 节点替换异常 ${getLineBreak()}${error} ${getLineBreak()}` ) // } } if (tagName === 'Wxs') { - updateLogFileContent(`INFO [taroize] createWxmlVistor - tagName: Wxs ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - tagName: Wxs ${getLineBreak()}`) wxses.push( getWXS( attrs.map((a) => a.node as t.JSXAttribute), @@ -495,7 +495,7 @@ export const createWxmlVistor = ( ) } if (tagName === 'Template') { - updateLogFileContent(`INFO [taroize] createWxmlVistor - tagName: Template ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - tagName: Template ${getLineBreak()}`) const template = parseTemplate(path, dirPath, wxses) if (template) { let funcs = new Set() @@ -532,7 +532,7 @@ export const createWxmlVistor = ( traverse(ast, { JSXIdentifier (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 JSXIdentifier ${getLineBreak()}${path} ${getLineBreak()}` ) const node = path.node if (node.name.endsWith('Tmpl') && node.name.length > 4 && path.parentPath.isJSXOpeningElement()) { @@ -565,7 +565,7 @@ export const createWxmlVistor = ( }, JSXAttribute (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 JSXAttribute ${getLineBreak()}${path} ${getLineBreak()}` ) // 识别 template 使用到的处理事件的 func const node = path.node @@ -586,7 +586,7 @@ export const createWxmlVistor = ( // 将使用到的处理事件的 func 写入到 props BlockStatement (path) { updateLogFileContent( - `INFO [taroize] createWxmlVistor - 解析 BlockStatement ${getLineBreak()}${path} ${getLineBreak()}` + `INFO [taroize] createWxmlVisitor - 解析 BlockStatement ${getLineBreak()}${path} ${getLineBreak()}` ) if (funcs.size > 0) { const body = path.node.body @@ -629,14 +629,14 @@ export const createWxmlVistor = ( } } if (tagName === 'Import') { - updateLogFileContent(`INFO [taroize] createWxmlVistor - tagName: Import ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - tagName: Import ${getLineBreak()}`) const mods = parseModule(path, dirPath, 'import') if (mods) { imports.push(...mods) } } if (tagName === 'Include') { - updateLogFileContent(`INFO [taroize] createWxmlVistor - tagName: Include ${getLineBreak()}`) + updateLogFileContent(`INFO [taroize] createWxmlVisitor - tagName: Include ${getLineBreak()}`) parseModule(path, dirPath, 'include') } }, @@ -658,7 +658,7 @@ export const createWxmlVistor = ( path.replaceWith(caller) } catch (error) { updateLogFileContent( - `WARN [taroize] createWxmlVistor - block 节点替换异常 ${getLineBreak()}${error} ${getLineBreak()}` + `WARN [taroize] createWxmlVisitor - block 节点替换异常 ${getLineBreak()}${error} ${getLineBreak()}` ) // } @@ -777,7 +777,7 @@ export function parseWXML (dirPath: string, wxml?: string, parseImport?: boolean // 获取 template 调用后,需要通过遍历,获取某个模板完整的调用关系 templateBfs(templates) - traverse(ast, createWxmlVistor(loopIds, refIds, dirPath, wxses, imports, templates)) + traverse(ast, createWxmlVisitor(loopIds, refIds, dirPath, wxses, imports, templates)) refIds.forEach((id) => { if ( From 14e37d09fce37c5f7d18f12bf536c4e6020a3f46 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 7 Jul 2025 21:29:04 +0800 Subject: [PATCH 8/9] chore(taroize): advanced components --- packages/taroize/src/script.ts | 8 -------- packages/taroize/src/wxml.ts | 4 ---- 2 files changed, 12 deletions(-) diff --git a/packages/taroize/src/script.ts b/packages/taroize/src/script.ts index 2e74b2e7bfa5..e22296617fa5 100644 --- a/packages/taroize/src/script.ts +++ b/packages/taroize/src/script.ts @@ -176,8 +176,6 @@ export function parseScript ( ), ]) - const useVirtualList = usedComponents.delete('VirtualList') - if (isCommonjsModule(ast.program.body)) { const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents], '', true) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro', true) @@ -191,9 +189,6 @@ export function parseScript ( .filter((wxs) => !wxs.src.startsWith('./wxs__')) .map((wxs) => buildImportStatement(wxs.src, [], wxs.module, true)) ) - if (useVirtualList) { - ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'], '', true)) - } } else { const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents]) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro') @@ -207,9 +202,6 @@ export function parseScript ( .filter((wxs) => !wxs.src.startsWith('./wxs__')) .map((wxs) => buildImportStatement(wxs.src, [], wxs.module)) ) - if (useVirtualList) { - ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'])) - } } return ast diff --git a/packages/taroize/src/wxml.ts b/packages/taroize/src/wxml.ts index 3387b866c438..1c86a206549c 100644 --- a/packages/taroize/src/wxml.ts +++ b/packages/taroize/src/wxml.ts @@ -501,7 +501,6 @@ export const createWxmlVisitor = ( let funcs = new Set() const { ast: classDecl, name, tmplName, usedWxses } = template const wxsImports = getWxsImports(name, usedWxses, dirPath) - const useVirtualList = usedComponents.delete('VirtualList') const taroComponentsImport = buildImportStatement('@tarojs/components', [...usedComponents]) const taroImport = buildImportStatement('@tarojs/taro', [], 'Taro') const reactImport = buildImportStatement('react', [], 'React') @@ -517,9 +516,6 @@ export const createWxmlVisitor = ( classDecl, t.exportDefaultDeclaration(t.identifier(name)) ) - if (useVirtualList) { - ast.program.body.unshift(buildImportStatement('@tarojs/components-advanced', ['VirtualList'])) - } const usedTemplate = new Set() // funcs 的值首先来源于预解析结果 if (templates) { From 161784484d3e2ff5a110063206c821330527d4b4 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 7 Jul 2025 21:48:21 +0800 Subject: [PATCH 9/9] fix(taroize): typo --- .../__tests__/__snapshots__/wxml.test.ts.snap | 38 +++++++++---------- packages/taroize/src/template.ts | 6 +-- packages/taroize/src/wxml.ts | 18 ++++----- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap b/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap index d15c18f86530..0b135121fed2 100644 --- a/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap +++ b/packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap @@ -22,7 +22,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -64,7 +64,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -107,7 +107,7 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] parseAttribute - 入参 attr: {"key":"id","value":"item-view1"} INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -160,7 +160,7 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] parseAttribute - 入参 attr: {"key":"id","value":"item-{{id}}"} INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -215,7 +215,7 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] parseAttribute - 入参 attr: {"key":"checked","value":"{{false}}"} INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -272,7 +272,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -328,7 +328,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -375,7 +375,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -490,7 +490,7 @@ INFO [taroize] parseNode - 入参 tagName: text INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -682,7 +682,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -765,7 +765,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -824,7 +824,7 @@ INFO [taroize] parseAttribute - 入参 attr: {"key":"class","value":"[1,2,3]"} WARN [taroize] parseAttribute - Taro/React 不支持 class 传入数组,此写法可能无法得到正确的 class INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -887,7 +887,7 @@ INFO [taroize] parseContent - 进入函数 INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseElement - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -984,7 +984,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -1084,7 +1084,7 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] parseAttribute - 入参 attr: {"key":"name","value":"after"} INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -1237,7 +1237,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -1383,7 +1383,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -1533,7 +1533,7 @@ INFO [taroize] parseElement - 进入函数 INFO [taroize] parseAttribute - 入参 attr: {"key":"name","value":"after"} INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 @@ -1653,7 +1653,7 @@ INFO [taroize] parseNode - 入参 tagName: view INFO [taroize] parseText - 进入函数 INFO [taroize] parseContent - 进入函数 -INFO [taroize] createPreWxmlVistor - 入参 +INFO [taroize] createPreWxmlVisitor - 入参 templates: [object Map] INFO [taroize] templateBfs - 进入函数 INFO [taroize] createWxmlVisitor - 入参 diff --git a/packages/taroize/src/template.ts b/packages/taroize/src/template.ts index a61bf929878b..213b286a1420 100644 --- a/packages/taroize/src/template.ts +++ b/packages/taroize/src/template.ts @@ -105,7 +105,7 @@ export function preParseTemplate (path: NodePath) { } const templateName = buildTemplateName(value.value) const templateFuncs = new Set() - const templateApplys = new Set() + const templateApplies = new Set() path.traverse({ JSXAttribute (p) { updateLogFileContent(`INFO [taroize] preParseTemplate - 解析 JSXAttribute ${getLineBreak()}${p} ${getLineBreak()}`) @@ -156,14 +156,14 @@ export function preParseTemplate (path: NodePath) { // is 的模板调用形式为 is="xxx", xxx 为模板名或表达式 if (t.isStringLiteral(value)) { const apply = buildTemplateName(value.value) - templateApplys.add(apply) + templateApplies.add(apply) } }, }) return { name: templateName, funcs: templateFuncs, - applys: templateApplys, + applies: templateApplies, } } diff --git a/packages/taroize/src/wxml.ts b/packages/taroize/src/wxml.ts index 1c86a206549c..206c79be5ddd 100644 --- a/packages/taroize/src/wxml.ts +++ b/packages/taroize/src/wxml.ts @@ -232,9 +232,9 @@ export function convertStyleUnit (value: string) { * @param { any[] } templates wxml 页面下的模板信息 * @returns Visitor */ -export const createPreWxmlVistor = (templates: Map) => { +export const createPreWxmlVisitor = (templates: Map) => { updateLogFileContent( - `INFO [taroize] createPreWxmlVistor - 入参 ${getLineBreak()}templates: ${templates} ${getLineBreak()}` + `INFO [taroize] createPreWxmlVisitor - 入参 ${getLineBreak()}templates: ${templates} ${getLineBreak()}` ) // const Appls = new Map() return { @@ -253,7 +253,7 @@ export const createPreWxmlVistor = (templates: Map) => { if (templateInfo) { templates.set(templateInfo.name, { funcs: templateInfo.funcs, - applyTemplates: templateInfo.applys, + applyTemplates: templateInfo.applies, }) } }, @@ -672,12 +672,12 @@ export const createWxmlVisitor = ( function templateBfs (templates: Map) { updateLogFileContent(`INFO [taroize] templateBfs - 进入函数 ${getLineBreak()}`) const names: string[] = [] - const applys = new Map>() + const applies = new Map>() for (const key of templates.keys()) { names.push(key) const templateInfo = templates.get(key) if (templateInfo) { - applys.set(key, templateInfo.applyTemplates) + applies.set(key, templateInfo.applyTemplates) } } for (const name of names) { @@ -693,11 +693,11 @@ function templateBfs (templates: Map) { continue } visited.add(template) - const templateApplys = applys.get(template) - if (!templateApplys || templateApplys.size === 0) { + const templateApplies = applies.get(template) + if (!templateApplies || templateApplies.size === 0) { continue } - templateApplys.forEach((item) => { + templateApplies.forEach((item) => { if (names.includes(item)) { queue.push(item) } @@ -769,7 +769,7 @@ export function parseWXML (dirPath: string, wxml?: string, parseImport?: boolean } // 在解析 wxml 页面前,先进行预解析 // 当前预解析主要为了抽取页面下的模板信息 - traverse(ast, createPreWxmlVistor(templates)) + traverse(ast, createPreWxmlVisitor(templates)) // 获取 template 调用后,需要通过遍历,获取某个模板完整的调用关系 templateBfs(templates)