@lynx-js/tasm 0.0.21 → 0.0.23

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/ChangeLog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ # 0.0.23
4
+ * Support render functions for framework to load lazy CSS with `__LoadStyleSheet` and `__AdoptStyleSheet`.
5
+
6
+ # 0.0.22
7
+ * Change `path.resolve` to `require.resolve` for webpack pre-bundle
8
+
3
9
  # 0.0.21
4
10
  * supports to resolve `compilerOption` in a tasm file.
5
11
 
Binary file
Binary file
package/index.js CHANGED
@@ -44,8 +44,7 @@ async function encode_wasm(options) {
44
44
  return res;
45
45
  }
46
46
  function encode_napi(options) {
47
- const bindingPath = path.resolve(__dirname, `./build/${process.platform}/Release/lepus.node`);
48
- const lepus = require(bindingPath);
47
+ const lepus = require(`./build/${process.platform}/Release/lepus.node`);
49
48
  const res = lepus.encode(JSON.stringify({...options}));
50
49
  if (res.status !== 0) {
51
50
  throw new Error(`encode error: ${res.error_msg}`);
@@ -69,15 +68,13 @@ function getEncodeMode(os) {
69
68
  }
70
69
 
71
70
  function encrypt(plain) {
72
- const bindingPath = path.resolve(__dirname, `./build/${process.platform}/Release/lepus.node`);
73
- const lepus = require(bindingPath);
71
+ const lepus = require(`./build/${process.platform}/Release/lepus.node`);
74
72
  const res = lepus.encrypt(plain);
75
73
  return res
76
74
  }
77
75
 
78
76
  function decrypt(cipher) {
79
- const bindingPath = path.resolve(__dirname, `./build/${process.platform}/Release/lepus.node`);
80
- const lepus = require(bindingPath);
77
+ const lepus = require(`./build/${process.platform}/Release/lepus.node`);
81
78
  const res = lepus.decrypt(cipher);
82
79
  return res
83
80
  }
@@ -96,8 +93,7 @@ function decrypt_wasm(plain) {
96
93
 
97
94
  function decode_napi(templateJS) {
98
95
  const templateArray = Uint8Array.from(templateJS);
99
- const bindingPath = path.resolve(__dirname, `./build/${process.platform}/Release/lepus.node`);
100
- const lepus = require(bindingPath);
96
+ const lepus = require(`./build/${process.platform}/Release/lepus.node`);
101
97
  const res = lepus.decode(templateArray);
102
98
  if (res.status !== 0) {
103
99
  throw new Error(`decode error: ${res.error_msg}`);