Skip to content

Commit

Permalink
Merge branch 'next' into feat/plugin-http
Browse files Browse the repository at this point in the history
  • Loading branch information
bigmeow authored Aug 17, 2023
2 parents 5736470 + c71ad63 commit 5933b2d
Show file tree
Hide file tree
Showing 49 changed files with 192 additions and 26 deletions.
6 changes: 5 additions & 1 deletion packages/shared/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ export class UnRecursiveTemplate extends BaseTemplate {
const componentsAlias = this.componentsAlias
const listA = Array.from(isLoopCompsSet).map(item => componentsAlias[item]?._num || item)
const listB = hasMaxComps.map(item => componentsAlias[item]?._num || item)

const containerLevel = this.baseLevel - 1

return `function (l, n, s) {
var a = ${JSON.stringify(listA)}
var b = ${JSON.stringify(listB)}
Expand All @@ -685,6 +686,9 @@ export class UnRecursiveTemplate extends BaseTemplate {
}
l = depth
}
if (l === ${containerLevel}) {
return 'tmpl_${containerLevel}_${Shortcuts.Container}'
}
return 'tmpl_' + l + '_' + n
}`
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-api/src/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getPxTransform (taro) {
throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)
}
const formatSize = ~~size
let rootValue = 1 / config.deviceRatio[designWidth]
let rootValue = 1 / deviceRatio[designWidth]
switch (config.targetUnit) {
case 'rem':
rootValue *= baseFontSize * 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function initVue2Components (components: Record<string, any> = {}) {

Vue.use(Fragment.Plugin)
Object.entries(components).forEach(([name, definition]) => {
if (typeof definition?.render === 'function') {
if (typeof definition === 'function') {
const tagName = 'taro' + name.replace(new RegExp('([A-Z])', 'g'), '-$1').toLowerCase()
const comp = Vue.extend(definition)
Vue.component(tagName, comp)
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-components-rn/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class _Button extends React.Component<ButtonProps, ButtonState> {
$touchable = React.createRef<TouchableWithoutFeedback>()

isTouchEnd = false
pressInTimer: number
pressOutTimer: number
pressInTimer: ReturnType<typeof setTimeout>
pressOutTimer: ReturnType<typeof setTimeout>

state: ButtonState = {
isHover: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Carousel extends React.Component<CarouselProps, CarouselState> {

viewPager = React.createRef<ViewPager>()

private autoplayTimer: number
private autoplayTimer: ReturnType<typeof setTimeout>
private isScrolling: boolean
private count: number

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,9 @@ module.exports = {
}
l = depth
}
if (l === 19) {
return 'tmpl_19_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -3201,6 +3204,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -4751,6 +4757,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -2961,6 +2964,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -5679,6 +5682,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -8617,6 +8623,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -4253,6 +4256,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -2929,6 +2932,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -4476,6 +4482,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down Expand Up @@ -6023,6 +6032,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2742,6 +2742,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,9 @@ module.exports = {
}
l = depth
}
if (l === 15) {
return 'tmpl_15_container'
}
return 'tmpl_' + l + '_' + n
},
b: function (a, b) {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-mini-runner/src/plugins/MiniPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ export default class TaroMiniPlugin {
}
}
if (isUsingCustomWrapper) {
baseCompConfig[customWrapperName] = `./${customWrapperName}`
baseCompConfig.usingComponents[customWrapperName] = `./${customWrapperName}`
this.generateConfigFile(compilation, this.getIsBuildPluginPath(customWrapperName, isBuildPlugin), {
component: true,
usingComponents: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ exports[`babel should convert do expressions 2`] = `
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ exports[`compiler-macros - defineAppConfig and definePageConfig should read app
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ exports[`config should build from origin and pipe to output 2`] = `
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down Expand Up @@ -1827,7 +1827,7 @@ I m irrelevant.
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down Expand Up @@ -2762,7 +2762,7 @@ exports[`config should resolved alias 2`] = `
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ exports[`css modules should use css modules with global mode 2`] = `
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down Expand Up @@ -1855,7 +1855,7 @@ exports[`css modules should use css modules with module mode 2`] = `
throw new Error("deviceRatio 配置中不存在 ".concat(designWidth, " 的设置!"));
}
var formatSize = ~~size;
var rootValue = 1 / config.deviceRatio[designWidth];
var rootValue = 1 / deviceRatio[designWidth];
switch (config.targetUnit) {
case "rem":
rootValue *= baseFontSize * 2;
Expand Down
Loading

0 comments on commit 5933b2d

Please sign in to comment.