@ray-js/builder-mp 1.3.99-beta.0 → 1.3.99-beta.2

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)(`const id = forwardRef((props, ref) => {
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']),
@@ -90,7 +90,8 @@ class WorkerBuild {
90
90
  return config.toConfig();
91
91
  }
92
92
  readConfig() {
93
- this.routesConfigFile = builder_1.builder.api.searchJSFile('src/routes.config');
93
+ const { source } = this.options;
94
+ this.routesConfigFile = builder_1.builder.api.searchJSFile(`${source}/routes.config`);
94
95
  if (!this.routesConfigFile) {
95
96
  shared_1.log.error(LOG_PREFIX_WORKER, `missing configuration file (routes.config.{ts|js})`);
96
97
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/builder-mp",
3
- "version": "1.3.99-beta.0",
3
+ "version": "1.3.99-beta.2",
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.1",
30
- "@ray-core/build-store": "^0.3.1",
31
- "@ray-core/cli": "^0.3.1",
32
- "@ray-core/ray": "^0.3.1",
33
- "@ray-js/adapter": "^1.3.99-beta.0",
29
+ "@ray-core/babel-preset-remax": "^0.3.99-beta.0",
30
+ "@ray-core/build-store": "^0.3.99-beta.0",
31
+ "@ray-core/cli": "^0.3.99-beta.0",
32
+ "@ray-core/ray": "^0.3.99-beta.0",
33
+ "@ray-js/adapter": "^1.3.99-beta.2",
34
34
  "@ray-js/rjs-for-wechat": "^0.0.3",
35
- "@ray-js/shared": "^1.3.99-beta.0",
36
- "@ray-js/types": "^1.3.99-beta.0",
35
+ "@ray-js/shared": "^1.3.99-beta.2",
36
+ "@ray-js/types": "^1.3.99-beta.2",
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.1",
54
+ "@ray-core/types": "^0.3.99-beta.0",
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": "55e5b53442b4d17914c437b101e15e485ec4aebe",
68
+ "gitHead": "c129b96e800e9bb062bdbb1236c05cb800fdc34b",
68
69
  "repository": {}
69
70
  }