Skip to content

Commit

Permalink
fix(mini-runner): 支持 template 递归的小程序平台不需要生成递归组件 (#8509)
Browse files Browse the repository at this point in the history
* fix(mini-runner): 支持 template 递归的小程序平台不需要生成递归组件

* chore: 更新测试
  • Loading branch information
luckyadam authored Jan 13, 2021
1 parent 14f0d71 commit 332d1fb
Show file tree
Hide file tree
Showing 5 changed files with 1,509 additions and 1,538 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`alipay should build alipay app 1`] = `18`;
exports[`alipay should build alipay app 1`] = `16`;

exports[`alipay should build alipay app 2`] = `
"
Expand All @@ -18,7 +18,7 @@ require(\\"./taro\\");
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 4 ], {
11: function(module, exports, __webpack_require__) {},
20: function(module, __webpack_exports__, __webpack_require__) {
19: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var taro_runtime = __webpack_require__(1);
Expand Down Expand Up @@ -69,7 +69,7 @@ require(\\"./taro\\");
taro_runtime[\\"window\\"].__taroAppConfig = config;
var inst = App(Object(taro_runtime[\\"createReactApp\\"])(lib_src_app, react, taro_react[\\"a\\"], config));
}
}, [ [ 20, 0, 1, 3, 2 ] ] ]);
}, [ [ 19, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -196,37 +196,24 @@ require(\\"./taro\\");
__webpack_exports__[\\"default\\"] = \\"react-mock\\";
} ] ]);
/** filePath: dist/comp.js **/
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 6 ], {
12: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
Component(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createRecursiveComponentConfig\\"])());
}
}, [ [ 12, 0, 1 ] ] ]);
/** filePath: dist/comp.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/custom-wrapper.axml **/
<import src=\\"./base.axml\\" />
<block a:for=\\"{{i.cn}}\\" a:key=\\"uid\\">
<template is=\\"tmpl_0_container\\" data=\\"{{i:item}}\\" />
</block>
/** filePath: dist/custom-wrapper.js **/
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 7 ], {
13: function(module, __webpack_exports__, __webpack_require__) {
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 6 ], {
12: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
Component(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createRecursiveComponentConfig\\"])());
}
}, [ [ 13, 0, 1 ] ] ]);
}, [ [ 12, 0, 1 ] ] ]);
/** filePath: dist/custom-wrapper.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
{\\"component\\":true,\\"usingComponents\\":{\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/pages/index/index.acss **/
Expand All @@ -236,16 +223,16 @@ require(\\"./taro\\");
<template is=\\"taro_tmpl\\" data=\\"{{root:root}}\\" />
/** filePath: dist/pages/index/index.js **/
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 8 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(14);
}, , , , , , , function(module, exports, __webpack_require__) {
(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 7 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(13);
}, , , , , , function(module, exports, __webpack_require__) {
var g = function() {
return this;
}() || Function(\\"return this\\")();
var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf(\\"regeneratorRuntime\\") >= 0;
var oldRuntime = hadRuntime && g.regeneratorRuntime;
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(15);
module.exports = __webpack_require__(14);
if (hadRuntime) {
g.regeneratorRuntime = oldRuntime;
} else {
Expand All @@ -257,7 +244,7 @@ require(\\"./taro\\");
}
}, function(module, exports, __webpack_require__) {
(function(module) {
var _typeof = __webpack_require__(17);
var _typeof = __webpack_require__(16);
!function(global) {
\\"use strict\\";
var Op = Object.prototype;
Expand Down Expand Up @@ -723,7 +710,7 @@ require(\\"./taro\\");
}(function() {
return this;
}() || Function(\\"return this\\")());
}).call(this, __webpack_require__(16)(module));
}).call(this, __webpack_require__(15)(module));
}, function(module, exports) {
module.exports = function(module) {
if (!module.webpackPolyfill) {
Expand Down Expand Up @@ -802,7 +789,7 @@ require(\\"./taro\\");
var createSuper = __webpack_require__(5);
var react = __webpack_require__(0);
var taro_components = __webpack_require__(2);
var index = __webpack_require__(18);
var index = __webpack_require__(17);
var index_Index = function(_Component) {
Object(inherits[\\"a\\"])(Index, _Component);
var _super = Object(createSuper[\\"a\\"])(Index);
Expand Down Expand Up @@ -864,7 +851,7 @@ require(\\"./taro\\");
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);
} ], [ [ 18, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
{\\"navigationBarTitleText\\":\\"首页\\",\\"usingComponents\\":{\\"custom-wrapper\\":\\"../../custom-wrapper\\"}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`bytedance should build bytedance app 1`] = `17`;
exports[`bytedance should build bytedance app 1`] = `15`;

exports[`bytedance should build bytedance app 2`] = `
"
Expand All @@ -15,7 +15,7 @@ require(\\"./taro\\");
(tt[\\"webpackJsonp\\"] = tt[\\"webpackJsonp\\"] || []).push([ [ 4 ], {
11: function(module, exports, __webpack_require__) {},
20: function(module, __webpack_exports__, __webpack_require__) {
19: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var taro_runtime = __webpack_require__(1);
Expand Down Expand Up @@ -66,7 +66,7 @@ require(\\"./taro\\");
taro_runtime[\\"window\\"].__taroAppConfig = config;
var inst = App(Object(taro_runtime[\\"createReactApp\\"])(lib_src_app, react, taro_react[\\"a\\"], config));
}
}, [ [ 20, 0, 1, 3, 2 ] ] ]);
}, [ [ 19, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -196,7 +196,7 @@ require(\\"./taro\\");
__webpack_exports__[\\"default\\"] = \\"react-mock\\";
} ] ]);
/** filePath: dist/comp.js **/
/** filePath: dist/custom-wrapper.js **/
(tt[\\"webpackJsonp\\"] = tt[\\"webpackJsonp\\"] || []).push([ [ 6 ], {
12: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
Expand All @@ -206,21 +206,8 @@ require(\\"./taro\\");
}
}, [ [ 12, 0, 1 ] ] ]);
/** filePath: dist/comp.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/custom-wrapper.js **/
(tt[\\"webpackJsonp\\"] = tt[\\"webpackJsonp\\"] || []).push([ [ 7 ], {
13: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
Component(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createRecursiveComponentConfig\\"])());
}
}, [ [ 13, 0, 1 ] ] ]);
/** filePath: dist/custom-wrapper.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
{\\"component\\":true,\\"usingComponents\\":{\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/custom-wrapper.ttml **/
<import src=\\"./base.ttml\\" />
Expand All @@ -229,16 +216,16 @@ require(\\"./taro\\");
</block>
/** filePath: dist/pages/index/index.js **/
(tt[\\"webpackJsonp\\"] = tt[\\"webpackJsonp\\"] || []).push([ [ 8 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(14);
}, , , , , , , function(module, exports, __webpack_require__) {
(tt[\\"webpackJsonp\\"] = tt[\\"webpackJsonp\\"] || []).push([ [ 7 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(13);
}, , , , , , function(module, exports, __webpack_require__) {
var g = function() {
return this;
}() || Function(\\"return this\\")();
var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf(\\"regeneratorRuntime\\") >= 0;
var oldRuntime = hadRuntime && g.regeneratorRuntime;
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(15);
module.exports = __webpack_require__(14);
if (hadRuntime) {
g.regeneratorRuntime = oldRuntime;
} else {
Expand All @@ -250,7 +237,7 @@ require(\\"./taro\\");
}
}, function(module, exports, __webpack_require__) {
(function(module) {
var _typeof = __webpack_require__(17);
var _typeof = __webpack_require__(16);
!function(global) {
\\"use strict\\";
var Op = Object.prototype;
Expand Down Expand Up @@ -716,7 +703,7 @@ require(\\"./taro\\");
}(function() {
return this;
}() || Function(\\"return this\\")());
}).call(this, __webpack_require__(16)(module));
}).call(this, __webpack_require__(15)(module));
}, function(module, exports) {
module.exports = function(module) {
if (!module.webpackPolyfill) {
Expand Down Expand Up @@ -795,7 +782,7 @@ require(\\"./taro\\");
var createSuper = __webpack_require__(5);
var react = __webpack_require__(0);
var taro_components = __webpack_require__(2);
var index = __webpack_require__(18);
var index = __webpack_require__(17);
var index_Index = function(_Component) {
Object(inherits[\\"a\\"])(Index, _Component);
var _super = Object(createSuper[\\"a\\"])(Index);
Expand Down Expand Up @@ -857,7 +844,7 @@ require(\\"./taro\\");
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);
} ], [ [ 18, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
{\\"navigationBarTitleText\\":\\"首页\\",\\"usingComponents\\":{\\"custom-wrapper\\":\\"../../custom-wrapper\\"}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`swan should build swan app 1`] = `18`;
exports[`swan should build swan app 1`] = `16`;

exports[`swan should build swan app 2`] = `
"
Expand All @@ -18,7 +18,7 @@ require(\\"./taro\\");
(swan[\\"webpackJsonp\\"] = swan[\\"webpackJsonp\\"] || []).push([ [ 4 ], {
11: function(module, exports, __webpack_require__) {},
20: function(module, __webpack_exports__, __webpack_require__) {
19: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var taro_runtime = __webpack_require__(1);
Expand Down Expand Up @@ -69,7 +69,7 @@ require(\\"./taro\\");
taro_runtime[\\"window\\"].__taroAppConfig = config;
var inst = App(Object(taro_runtime[\\"createReactApp\\"])(lib_src_app, react, taro_react[\\"a\\"], config));
}
}, [ [ 20, 0, 1, 3, 2 ] ] ]);
}, [ [ 19, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -196,7 +196,7 @@ require(\\"./taro\\");
__webpack_exports__[\\"default\\"] = \\"react-mock\\";
} ] ]);
/** filePath: dist/comp.js **/
/** filePath: dist/custom-wrapper.js **/
(swan[\\"webpackJsonp\\"] = swan[\\"webpackJsonp\\"] || []).push([ [ 6 ], {
12: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
Expand All @@ -206,21 +206,8 @@ require(\\"./taro\\");
}
}, [ [ 12, 0, 1 ] ] ]);
/** filePath: dist/comp.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/custom-wrapper.js **/
(swan[\\"webpackJsonp\\"] = swan[\\"webpackJsonp\\"] || []).push([ [ 7 ], {
13: function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
Component(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createRecursiveComponentConfig\\"])());
}
}, [ [ 13, 0, 1 ] ] ]);
/** filePath: dist/custom-wrapper.json **/
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\",\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
{\\"component\\":true,\\"usingComponents\\":{\\"custom-wrapper\\":\\"./custom-wrapper\\"}}
/** filePath: dist/custom-wrapper.swan **/
<import src=\\"./base.swan\\" />
Expand All @@ -232,16 +219,16 @@ require(\\"./taro\\");
/** filePath: dist/pages/index/index.js **/
(swan[\\"webpackJsonp\\"] = swan[\\"webpackJsonp\\"] || []).push([ [ 8 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(14);
}, , , , , , , function(module, exports, __webpack_require__) {
(swan[\\"webpackJsonp\\"] = swan[\\"webpackJsonp\\"] || []).push([ [ 7 ], [ , , , , , , , function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(13);
}, , , , , , function(module, exports, __webpack_require__) {
var g = function() {
return this;
}() || Function(\\"return this\\")();
var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf(\\"regeneratorRuntime\\") >= 0;
var oldRuntime = hadRuntime && g.regeneratorRuntime;
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(15);
module.exports = __webpack_require__(14);
if (hadRuntime) {
g.regeneratorRuntime = oldRuntime;
} else {
Expand All @@ -253,7 +240,7 @@ require(\\"./taro\\");
}
}, function(module, exports, __webpack_require__) {
(function(module) {
var _typeof = __webpack_require__(17);
var _typeof = __webpack_require__(16);
!function(global) {
\\"use strict\\";
var Op = Object.prototype;
Expand Down Expand Up @@ -719,7 +706,7 @@ require(\\"./taro\\");
}(function() {
return this;
}() || Function(\\"return this\\")());
}).call(this, __webpack_require__(16)(module));
}).call(this, __webpack_require__(15)(module));
}, function(module, exports) {
module.exports = function(module) {
if (!module.webpackPolyfill) {
Expand Down Expand Up @@ -798,7 +785,7 @@ require(\\"./taro\\");
var createSuper = __webpack_require__(5);
var react = __webpack_require__(0);
var taro_components = __webpack_require__(2);
var index = __webpack_require__(18);
var index = __webpack_require__(17);
var index_Index = function(_Component) {
Object(inherits[\\"a\\"])(Index, _Component);
var _super = Object(createSuper[\\"a\\"])(Index);
Expand Down Expand Up @@ -860,7 +847,7 @@ require(\\"./taro\\");
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);
} ], [ [ 18, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
{\\"navigationBarTitleText\\":\\"首页\\",\\"usingComponents\\":{\\"custom-wrapper\\":\\"../../custom-wrapper\\"}}
Expand Down
Loading

0 comments on commit 332d1fb

Please sign in to comment.