@vxrn/compiler 2.0.0-beta.33.1 → 2.0.0-beta.46.1

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.
Files changed (95) hide show
  1. package/dist/cjs/cache.cjs +112 -109
  2. package/dist/cjs/configure.cjs +26 -28
  3. package/dist/cjs/constants.cjs +56 -60
  4. package/dist/cjs/index.cjs +420 -438
  5. package/dist/cjs/reactNativeCodegen.cjs +105 -114
  6. package/dist/cjs/reactNativeViewConfig.cjs +362 -381
  7. package/dist/cjs/refresh-runtime.cjs +390 -397
  8. package/dist/cjs/transformBabel.cjs +278 -218
  9. package/dist/cjs/transformHermesAsync.cjs +36 -47
  10. package/dist/cjs/transformHermesLoops.cjs +279 -281
  11. package/dist/cjs/transformSWC.cjs +183 -200
  12. package/dist/cjs/transformWorklets.cjs +107 -95
  13. package/dist/cjs/types.cjs +9 -11
  14. package/dist/cjs/worklets/autoworklet.cjs +277 -222
  15. package/dist/cjs/worklets/globals.cjs +124 -60
  16. package/dist/cjs/worklets/hash.cjs +23 -27
  17. package/dist/cjs/worklets/scope.cjs +338 -359
  18. package/dist/cjs/worklets/serialize.cjs +73 -75
  19. package/dist/cjs/worklets/transform.cjs +217 -222
  20. package/dist/cjs/worklets/types.cjs +9 -11
  21. package/dist/esm/cache.mjs +96 -89
  22. package/dist/esm/cache.mjs.map +1 -1
  23. package/dist/esm/configure.mjs +11 -10
  24. package/dist/esm/configure.mjs.map +1 -1
  25. package/dist/esm/constants.mjs +41 -41
  26. package/dist/esm/constants.mjs.map +1 -1
  27. package/dist/esm/index.js +417 -420
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/index.mjs +417 -420
  30. package/dist/esm/index.mjs.map +1 -1
  31. package/dist/esm/reactNativeCodegen.mjs +90 -88
  32. package/dist/esm/reactNativeCodegen.mjs.map +1 -1
  33. package/dist/esm/reactNativeViewConfig.mjs +347 -362
  34. package/dist/esm/reactNativeViewConfig.mjs.map +1 -1
  35. package/dist/esm/refresh-runtime.mjs +372 -376
  36. package/dist/esm/refresh-runtime.mjs.map +1 -1
  37. package/dist/esm/transformBabel.mjs +261 -194
  38. package/dist/esm/transformBabel.mjs.map +1 -1
  39. package/dist/esm/transformHermesAsync.mjs +20 -21
  40. package/dist/esm/transformHermesAsync.mjs.map +1 -1
  41. package/dist/esm/transformHermesLoops.mjs +264 -255
  42. package/dist/esm/transformHermesLoops.mjs.map +1 -1
  43. package/dist/esm/transformSWC.mjs +163 -171
  44. package/dist/esm/transformSWC.mjs.map +1 -1
  45. package/dist/esm/transformWorklets.mjs +89 -69
  46. package/dist/esm/transformWorklets.mjs.map +1 -1
  47. package/dist/esm/types.mjs +0 -2
  48. package/dist/esm/worklets/autoworklet.mjs +258 -200
  49. package/dist/esm/worklets/autoworklet.mjs.map +1 -1
  50. package/dist/esm/worklets/globals.mjs +109 -42
  51. package/dist/esm/worklets/globals.mjs.map +1 -1
  52. package/dist/esm/worklets/hash.mjs +10 -9
  53. package/dist/esm/worklets/hash.mjs.map +1 -1
  54. package/dist/esm/worklets/scope.mjs +325 -341
  55. package/dist/esm/worklets/scope.mjs.map +1 -1
  56. package/dist/esm/worklets/serialize.mjs +60 -58
  57. package/dist/esm/worklets/serialize.mjs.map +1 -1
  58. package/dist/esm/worklets/transform.mjs +201 -197
  59. package/dist/esm/worklets/transform.mjs.map +1 -1
  60. package/dist/esm/worklets/types.mjs +0 -2
  61. package/package.json +7 -6
  62. package/src/cache.ts +37 -7
  63. package/src/index.ts +33 -18
  64. package/src/transformBabel.test.ts +311 -1
  65. package/src/transformBabel.ts +110 -13
  66. package/src/transformWorklets.test.ts +7 -1
  67. package/types/cache.d.ts +2 -2
  68. package/types/cache.d.ts.map +1 -1
  69. package/types/index.d.ts.map +1 -1
  70. package/types/transformBabel.d.ts +16 -1
  71. package/types/transformBabel.d.ts.map +1 -1
  72. package/types/transformSWC.d.ts +1 -4
  73. package/types/transformSWC.d.ts.map +1 -1
  74. package/dist/cjs/transformBabel.test.cjs +0 -360
  75. package/dist/cjs/transformHermesLoops.test.cjs +0 -257
  76. package/dist/cjs/transformSWC.test.cjs +0 -117
  77. package/dist/cjs/transformWorklets.test.cjs +0 -604
  78. package/dist/esm/transformBabel.test.mjs +0 -337
  79. package/dist/esm/transformBabel.test.mjs.map +0 -1
  80. package/dist/esm/transformHermesLoops.test.mjs +0 -234
  81. package/dist/esm/transformHermesLoops.test.mjs.map +0 -1
  82. package/dist/esm/transformSWC.test.mjs +0 -118
  83. package/dist/esm/transformSWC.test.mjs.map +0 -1
  84. package/dist/esm/transformWorklets.test.mjs +0 -581
  85. package/dist/esm/transformWorklets.test.mjs.map +0 -1
  86. package/dist/esm/types.mjs.map +0 -1
  87. package/dist/esm/worklets/types.mjs.map +0 -1
  88. package/types/transformBabel.test.d.ts +0 -2
  89. package/types/transformBabel.test.d.ts.map +0 -1
  90. package/types/transformHermesLoops.test.d.ts +0 -2
  91. package/types/transformHermesLoops.test.d.ts.map +0 -1
  92. package/types/transformSWC.test.d.ts +0 -2
  93. package/types/transformSWC.test.d.ts.map +0 -1
  94. package/types/transformWorklets.test.d.ts +0 -2
  95. package/types/transformWorklets.test.d.ts.map +0 -1
@@ -3,71 +3,135 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var globals_exports = {};
24
22
  __export(globals_exports, {
25
- DEFAULT_GLOBALS: () => DEFAULT_GLOBALS,
26
- JS_GLOBALS: () => JS_GLOBALS,
27
- createGlobalsSet: () => createGlobalsSet
23
+ DEFAULT_GLOBALS: () => DEFAULT_GLOBALS,
24
+ JS_GLOBALS: () => JS_GLOBALS,
25
+ createGlobalsSet: () => createGlobalsSet
28
26
  });
29
27
  module.exports = __toCommonJS(globals_exports);
30
- const JS_GLOBALS = /* @__PURE__ */new Set([
31
- // Value properties
32
- "globalThis", "Infinity", "NaN", "undefined",
33
- // Function properties
34
- "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "unescape",
35
- // Fundamental objects
36
- "Object", "Function", "Boolean", "Symbol",
37
- // Error objects
38
- "Error", "AggregateError", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "InternalError",
39
- // Numbers and dates
40
- "Number", "BigInt", "Math", "Date",
41
- // Text processing
42
- "String", "RegExp",
43
- // Indexed collections
44
- "Array", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "BigInt64Array", "BigUint64Array", "Float32Array", "Float64Array",
45
- // Keyed collections
46
- "Map", "Set", "WeakMap", "WeakSet",
47
- // Structured data
48
- "ArrayBuffer", "SharedArrayBuffer", "DataView", "Atomics", "JSON",
49
- // Managing memory
50
- "WeakRef", "FinalizationRegistry",
51
- // Control abstraction objects
52
- "Iterator", "AsyncIterator", "Promise", "GeneratorFunction", "AsyncGeneratorFunction", "Generator", "AsyncGenerator", "AsyncFunction",
53
- // Reflection
54
- "Reflect", "Proxy",
55
- // Internationalization
56
- "Intl"]);
57
- const DEFAULT_GLOBALS = /* @__PURE__ */new Set([...JS_GLOBALS,
58
- // Environment / Runtime
59
- "null", "this", "global", "window", "self", "console", "performance", "arguments", "require", "fetch", "XMLHttpRequest", "WebSocket", "queueMicrotask", "requestAnimationFrame", "cancelAnimationFrame", "setTimeout", "clearTimeout", "setImmediate", "clearImmediate", "setInterval", "clearInterval", "HermesInternal", "_WORKLET"]);
28
+ const JS_GLOBALS = /* @__PURE__ */ new Set([
29
+ "globalThis",
30
+ "Infinity",
31
+ "NaN",
32
+ "undefined",
33
+ "eval",
34
+ "isFinite",
35
+ "isNaN",
36
+ "parseFloat",
37
+ "parseInt",
38
+ "decodeURI",
39
+ "decodeURIComponent",
40
+ "encodeURI",
41
+ "encodeURIComponent",
42
+ "escape",
43
+ "unescape",
44
+ "Object",
45
+ "Function",
46
+ "Boolean",
47
+ "Symbol",
48
+ "Error",
49
+ "AggregateError",
50
+ "EvalError",
51
+ "RangeError",
52
+ "ReferenceError",
53
+ "SyntaxError",
54
+ "TypeError",
55
+ "URIError",
56
+ "InternalError",
57
+ "Number",
58
+ "BigInt",
59
+ "Math",
60
+ "Date",
61
+ "String",
62
+ "RegExp",
63
+ "Array",
64
+ "Int8Array",
65
+ "Uint8Array",
66
+ "Uint8ClampedArray",
67
+ "Int16Array",
68
+ "Uint16Array",
69
+ "Int32Array",
70
+ "Uint32Array",
71
+ "BigInt64Array",
72
+ "BigUint64Array",
73
+ "Float32Array",
74
+ "Float64Array",
75
+ "Map",
76
+ "Set",
77
+ "WeakMap",
78
+ "WeakSet",
79
+ "ArrayBuffer",
80
+ "SharedArrayBuffer",
81
+ "DataView",
82
+ "Atomics",
83
+ "JSON",
84
+ "WeakRef",
85
+ "FinalizationRegistry",
86
+ "Iterator",
87
+ "AsyncIterator",
88
+ "Promise",
89
+ "GeneratorFunction",
90
+ "AsyncGeneratorFunction",
91
+ "Generator",
92
+ "AsyncGenerator",
93
+ "AsyncFunction",
94
+ "Reflect",
95
+ "Proxy",
96
+ "Intl"
97
+ ]);
98
+ const DEFAULT_GLOBALS = /* @__PURE__ */ new Set([
99
+ ...JS_GLOBALS,
100
+ "null",
101
+ "this",
102
+ "global",
103
+ "window",
104
+ "self",
105
+ "console",
106
+ "performance",
107
+ "arguments",
108
+ "require",
109
+ "fetch",
110
+ "XMLHttpRequest",
111
+ "WebSocket",
112
+ "queueMicrotask",
113
+ "requestAnimationFrame",
114
+ "cancelAnimationFrame",
115
+ "setTimeout",
116
+ "clearTimeout",
117
+ "setImmediate",
118
+ "clearImmediate",
119
+ "setInterval",
120
+ "clearInterval",
121
+ "HermesInternal",
122
+ "_WORKLET"
123
+ ]);
60
124
  function createGlobalsSet(customGlobals, strictGlobal) {
61
- const set = /* @__PURE__ */new Set();
62
- if (!strictGlobal) {
63
- for (const g of DEFAULT_GLOBALS) {
64
- set.add(g);
65
- }
66
- }
67
- if (customGlobals) {
68
- for (const g of customGlobals) {
69
- set.add(g);
70
- }
71
- }
72
- return set;
73
- }
125
+ const set = /* @__PURE__ */ new Set();
126
+ if (!strictGlobal) {
127
+ for (const g of DEFAULT_GLOBALS) {
128
+ set.add(g);
129
+ }
130
+ }
131
+ if (customGlobals) {
132
+ for (const g of customGlobals) {
133
+ set.add(g);
134
+ }
135
+ }
136
+ return set;
137
+ }
@@ -3,36 +3,32 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var hash_exports = {};
24
- __export(hash_exports, {
25
- calculateWorkletHash: () => calculateWorkletHash
26
- });
22
+ __export(hash_exports, { calculateWorkletHash: () => calculateWorkletHash });
27
23
  module.exports = __toCommonJS(hash_exports);
28
24
  function calculateWorkletHash(str) {
29
- let i = str.length;
30
- let hash1 = 5381;
31
- let hash2 = 52711;
32
- while (i--) {
33
- const char = str.charCodeAt(i);
34
- hash1 = hash1 * 33 ^ char;
35
- hash2 = hash2 * 33 ^ char;
36
- }
37
- return (hash1 >>> 0) * 4096 + (hash2 >>> 0);
38
- }
25
+ let i = str.length;
26
+ let hash1 = 5381;
27
+ let hash2 = 52711;
28
+ while (i--) {
29
+ const char = str.charCodeAt(i);
30
+ hash1 = hash1 * 33 ^ char;
31
+ hash2 = hash2 * 33 ^ char;
32
+ }
33
+ return (hash1 >>> 0) * 4096 + (hash2 >>> 0);
34
+ }