@mpxjs/webpack-plugin 2.10.5 → 2.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +10 -1
- package/lib/json-compiler/helper.js +1 -4
- package/lib/platform/template/wx/index.js +21 -1
- package/lib/resolver/PackageEntryPlugin.js +3 -1
- package/lib/runtime/components/react/dist/mpx-button.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-canvas/Image.js +2 -4
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +20 -17
- package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-checkbox.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-icon/index.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-image.jsx +9 -2
- package/lib/runtime/components/react/dist/mpx-input.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-label.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-movable-area.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-movable-view.jsx +76 -42
- package/lib/runtime/components/react/dist/mpx-picker/index.jsx +11 -13
- package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +8 -7
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +26 -8
- package/lib/runtime/components/react/dist/mpx-radio-group.jsx +9 -2
- package/lib/runtime/components/react/dist/mpx-radio.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +13 -4
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +11 -9
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +82 -36
- package/lib/runtime/components/react/dist/mpx-switch.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-text.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-video.jsx +7 -2
- package/lib/runtime/components/react/dist/mpx-view.jsx +2 -4
- package/lib/runtime/components/react/dist/utils.jsx +2 -2
- package/lib/runtime/components/react/mpx-button.tsx +9 -1
- package/lib/runtime/components/react/mpx-canvas/Image.ts +4 -4
- package/lib/runtime/components/react/mpx-canvas/index.tsx +24 -17
- package/lib/runtime/components/react/mpx-checkbox-group.tsx +9 -1
- package/lib/runtime/components/react/mpx-checkbox.tsx +9 -1
- package/lib/runtime/components/react/mpx-icon/index.tsx +9 -1
- package/lib/runtime/components/react/mpx-image.tsx +38 -19
- package/lib/runtime/components/react/mpx-input.tsx +10 -1
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +1 -1
- package/lib/runtime/components/react/mpx-label.tsx +9 -1
- package/lib/runtime/components/react/mpx-movable-area.tsx +7 -1
- package/lib/runtime/components/react/mpx-movable-view.tsx +75 -42
- package/lib/runtime/components/react/mpx-picker/index.tsx +18 -16
- package/lib/runtime/components/react/mpx-picker-view/index.tsx +22 -8
- package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +34 -30
- package/lib/runtime/components/react/mpx-radio-group.tsx +20 -9
- package/lib/runtime/components/react/mpx-radio.tsx +9 -1
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +10 -2
- package/lib/runtime/components/react/mpx-scroll-view.tsx +14 -3
- package/lib/runtime/components/react/mpx-swiper-item.tsx +11 -19
- package/lib/runtime/components/react/mpx-swiper.tsx +95 -38
- package/lib/runtime/components/react/mpx-switch.tsx +10 -2
- package/lib/runtime/components/react/mpx-text.tsx +10 -2
- package/lib/runtime/components/react/mpx-video.tsx +7 -2
- package/lib/runtime/components/react/mpx-view.tsx +8 -4
- package/lib/runtime/components/react/utils.tsx +4 -4
- package/lib/runtime/components/web/mpx-web-view.vue +1 -1
- package/lib/runtime/mpxGlobal.js +1 -0
- package/lib/runtime/optionProcessor.d.ts +5 -0
- package/lib/template-compiler/bind-this.js +8 -7
- package/lib/wxs/pre-loader.js +1 -0
- package/package.json +4 -4
|
@@ -70,7 +70,7 @@ function getCollectPath (path) {
|
|
|
70
70
|
function checkDelAndGetPath (path) {
|
|
71
71
|
let current = path
|
|
72
72
|
let delPath = path
|
|
73
|
-
let canDel = true
|
|
73
|
+
let canDel = true // 是否可删除,优先级比replace高
|
|
74
74
|
let ignore = false
|
|
75
75
|
let replace = false
|
|
76
76
|
|
|
@@ -80,8 +80,13 @@ function checkDelAndGetPath (path) {
|
|
|
80
80
|
if (t.isUnaryExpression(current.parent) && current.key === 'argument') {
|
|
81
81
|
delPath = current.parentPath
|
|
82
82
|
} else if (t.isCallExpression(current.parent)) {
|
|
83
|
-
const args = current.
|
|
84
|
-
if (
|
|
83
|
+
const args = current.parent.arguments || []
|
|
84
|
+
if (
|
|
85
|
+
// case: String(a) || this._p(a)
|
|
86
|
+
args.length === 1 ||
|
|
87
|
+
// 除了自身,参数列表里只能是数字或字符串才能删
|
|
88
|
+
(args.every(node => node === current.node || t.isNumericLiteral(node) || t.isStringLiteral(node)))
|
|
89
|
+
) {
|
|
85
90
|
delPath = current.parentPath
|
|
86
91
|
} else {
|
|
87
92
|
break
|
|
@@ -123,24 +128,20 @@ function checkDelAndGetPath (path) {
|
|
|
123
128
|
|
|
124
129
|
if (t.isCallExpression(parent) && listKey === 'arguments') {
|
|
125
130
|
canDel = false
|
|
126
|
-
break
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
if (t.isMemberExpression(parent) && parent.computed) {
|
|
130
134
|
canDel = false
|
|
131
|
-
break
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
if (t.isLogicalExpression(parent)) { // case: a || ((b || c) && d)
|
|
135
138
|
canDel = false
|
|
136
139
|
ignore = true
|
|
137
|
-
break
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
if (t.isConditionalExpression(parent)) {
|
|
141
143
|
if (key === 'test') {
|
|
142
144
|
canDel = false
|
|
143
|
-
break
|
|
144
145
|
} else {
|
|
145
146
|
ignore = true
|
|
146
147
|
replace = true // 继续往上找,判断是否存在if条件等
|
package/lib/wxs/pre-loader.js
CHANGED
|
@@ -54,6 +54,7 @@ module.exports = function (content) {
|
|
|
54
54
|
ExportNamedDeclaration (path) {
|
|
55
55
|
if (
|
|
56
56
|
path.node.declaration &&
|
|
57
|
+
path.node.declaration.declarations &&
|
|
57
58
|
path.node.declaration.declarations.length === 1 &&
|
|
58
59
|
path.node.declaration.declarations[0].id.name === path.node.declaration.declarations[0].init.name
|
|
59
60
|
) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.6",
|
|
4
4
|
"description": "mpx compile core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mpx"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@better-scroll/wheel": "^2.5.1",
|
|
29
29
|
"@better-scroll/zoom": "^2.5.1",
|
|
30
30
|
"@mpxjs/template-engine": "^2.8.7",
|
|
31
|
-
"@mpxjs/utils": "^2.10.
|
|
31
|
+
"@mpxjs/utils": "^2.10.6",
|
|
32
32
|
"acorn": "^8.11.3",
|
|
33
33
|
"acorn-walk": "^7.2.0",
|
|
34
34
|
"async": "^2.6.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@d11/react-native-fast-image": "^8.6.12",
|
|
86
|
-
"@mpxjs/api-proxy": "^2.10.
|
|
86
|
+
"@mpxjs/api-proxy": "^2.10.6",
|
|
87
87
|
"@types/babel-traverse": "^6.25.4",
|
|
88
88
|
"@types/babel-types": "^7.0.4",
|
|
89
89
|
"@types/react": "^18.2.79",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=14.14.0"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "e28605bc2d8ab33f4dccf13ea98d9ca996f43ed6"
|
|
104
104
|
}
|