@ray-js/builder-mp 1.3.99-beta.1 → 1.3.99-beta.3
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.
@@ -39,7 +39,10 @@ function insertSpecifierImport(program, imports, moduleName) {
|
|
39
39
|
const importDeclaration = t.importDeclaration(specifiers, t.stringLiteral(moduleName));
|
40
40
|
program.unshiftContainer('body', importDeclaration);
|
41
41
|
}
|
42
|
-
const contextTemplate = (0, template_1.default)(`
|
42
|
+
const contextTemplate = (0, template_1.default)(`
|
43
|
+
import hoistNonReactStatics from 'hoist-non-react-statics';
|
44
|
+
|
45
|
+
let id = forwardRef((props, ref) => {
|
43
46
|
const isClassType = (c) => c.prototype && typeof c.prototype.render === 'function';
|
44
47
|
const $instance = new PageInstance();
|
45
48
|
usePageEvent('onLoad', () => {
|
@@ -61,7 +64,10 @@ const contextTemplate = (0, template_1.default)(`const id = forwardRef((props, r
|
|
61
64
|
{isClassType(compName) ? <compTag ref={ref} {...props}/> : <compTag {...props}/> }
|
62
65
|
</PageInstanceContext.Provider>
|
63
66
|
);
|
64
|
-
})
|
67
|
+
});
|
68
|
+
|
69
|
+
id = hoistNonReactStatics(id, compName);
|
70
|
+
`, {
|
65
71
|
plugins: ['jsx'],
|
66
72
|
syntacticPlaceholders: false,
|
67
73
|
placeholderWhitelist: new Set(['id', 'compTag', 'compName', 'platform']),
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/builder-mp",
|
3
|
-
"version": "1.3.99-beta.
|
3
|
+
"version": "1.3.99-beta.3",
|
4
4
|
"description": "Ray builder for mini program",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -26,14 +26,14 @@
|
|
26
26
|
"@babel/template": "^7.16.0",
|
27
27
|
"@babel/traverse": "^7.16.3",
|
28
28
|
"@babel/types": "^7.16.0",
|
29
|
-
"@ray-core/babel-preset-remax": "^0.3.
|
30
|
-
"@ray-core/build-store": "^0.3.
|
31
|
-
"@ray-core/cli": "^0.3.
|
32
|
-
"@ray-core/ray": "^0.3.
|
33
|
-
"@ray-js/adapter": "^1.3.99-beta.
|
29
|
+
"@ray-core/babel-preset-remax": "^0.3.99-beta.1",
|
30
|
+
"@ray-core/build-store": "^0.3.99-beta.1",
|
31
|
+
"@ray-core/cli": "^0.3.99-beta.1",
|
32
|
+
"@ray-core/ray": "^0.3.99-beta.1",
|
33
|
+
"@ray-js/adapter": "^1.3.99-beta.3",
|
34
34
|
"@ray-js/rjs-for-wechat": "^0.0.3",
|
35
|
-
"@ray-js/shared": "^1.3.99-beta.
|
36
|
-
"@ray-js/types": "^1.3.99-beta.
|
35
|
+
"@ray-js/shared": "^1.3.99-beta.3",
|
36
|
+
"@ray-js/types": "^1.3.99-beta.3",
|
37
37
|
"babel-loader": "^8.2.3",
|
38
38
|
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
|
39
39
|
"babel-plugin-transform-prune-unused-imports": "^1.0.1",
|
@@ -41,6 +41,7 @@
|
|
41
41
|
"colors": "1.4.0",
|
42
42
|
"fs-extra": "^10.0.0",
|
43
43
|
"hash-replace": "^1.0.5",
|
44
|
+
"hoist-non-react-statics": "^3.3.1",
|
44
45
|
"postcss-units-transform": "^1.1.0",
|
45
46
|
"pretty-bytes": "^5.6.0",
|
46
47
|
"react": "^17.0.2",
|
@@ -50,7 +51,7 @@
|
|
50
51
|
"webpack-virtual-modules": "^0.4.4"
|
51
52
|
},
|
52
53
|
"devDependencies": {
|
53
|
-
"@ray-core/types": "^0.3.
|
54
|
+
"@ray-core/types": "^0.3.99-beta.1",
|
54
55
|
"@types/jest": "^27.0.2",
|
55
56
|
"@types/node": "^16.9.1",
|
56
57
|
"babel-plugin-tester": "^10.1.0",
|
@@ -64,6 +65,6 @@
|
|
64
65
|
"email": "tuyafe@tuya.com"
|
65
66
|
}
|
66
67
|
],
|
67
|
-
"gitHead": "
|
68
|
+
"gitHead": "fb0a79e1296c9f6311467d9c00634654f0136644",
|
68
69
|
"repository": {}
|
69
70
|
}
|