@vxrn/compiler 2.0.0-beta.33.1 → 2.0.0-beta.362.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 (115) 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 +428 -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 +247 -221
  9. package/dist/cjs/transformHermesAsync.cjs +36 -47
  10. package/dist/cjs/transformHermesClasses.cjs +51 -0
  11. package/dist/cjs/transformHermesLoops.cjs +279 -281
  12. package/dist/cjs/transformSWC.cjs +183 -200
  13. package/dist/cjs/transformWorklets.cjs +107 -95
  14. package/dist/cjs/types.cjs +9 -11
  15. package/dist/cjs/workletUtils.cjs +30 -0
  16. package/dist/cjs/worklets/autoworklet.cjs +277 -222
  17. package/dist/cjs/worklets/globals.cjs +145 -60
  18. package/dist/cjs/worklets/hash.cjs +23 -27
  19. package/dist/cjs/worklets/scope.cjs +338 -359
  20. package/dist/cjs/worklets/serialize.cjs +73 -75
  21. package/dist/cjs/worklets/transform.cjs +217 -222
  22. package/dist/cjs/worklets/types.cjs +9 -11
  23. package/dist/esm/cache.mjs +96 -89
  24. package/dist/esm/cache.mjs.map +1 -1
  25. package/dist/esm/configure.mjs +11 -10
  26. package/dist/esm/configure.mjs.map +1 -1
  27. package/dist/esm/constants.mjs +41 -41
  28. package/dist/esm/constants.mjs.map +1 -1
  29. package/dist/esm/index.js +426 -420
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/index.mjs +426 -420
  32. package/dist/esm/index.mjs.map +1 -1
  33. package/dist/esm/reactNativeCodegen.mjs +90 -88
  34. package/dist/esm/reactNativeCodegen.mjs.map +1 -1
  35. package/dist/esm/reactNativeViewConfig.mjs +347 -362
  36. package/dist/esm/reactNativeViewConfig.mjs.map +1 -1
  37. package/dist/esm/refresh-runtime.mjs +372 -376
  38. package/dist/esm/refresh-runtime.mjs.map +1 -1
  39. package/dist/esm/transformBabel.mjs +231 -198
  40. package/dist/esm/transformBabel.mjs.map +1 -1
  41. package/dist/esm/transformHermesAsync.mjs +20 -21
  42. package/dist/esm/transformHermesAsync.mjs.map +1 -1
  43. package/dist/esm/transformHermesClasses.mjs +25 -0
  44. package/dist/esm/transformHermesClasses.mjs.map +1 -0
  45. package/dist/esm/transformHermesLoops.mjs +264 -255
  46. package/dist/esm/transformHermesLoops.mjs.map +1 -1
  47. package/dist/esm/transformSWC.mjs +163 -171
  48. package/dist/esm/transformSWC.mjs.map +1 -1
  49. package/dist/esm/transformWorklets.mjs +89 -69
  50. package/dist/esm/transformWorklets.mjs.map +1 -1
  51. package/dist/esm/types.mjs +0 -2
  52. package/dist/esm/workletUtils.mjs +5 -0
  53. package/dist/esm/worklets/autoworklet.mjs +258 -200
  54. package/dist/esm/worklets/autoworklet.mjs.map +1 -1
  55. package/dist/esm/worklets/globals.mjs +130 -42
  56. package/dist/esm/worklets/globals.mjs.map +1 -1
  57. package/dist/esm/worklets/hash.mjs +10 -9
  58. package/dist/esm/worklets/hash.mjs.map +1 -1
  59. package/dist/esm/worklets/scope.mjs +325 -341
  60. package/dist/esm/worklets/scope.mjs.map +1 -1
  61. package/dist/esm/worklets/serialize.mjs +60 -58
  62. package/dist/esm/worklets/serialize.mjs.map +1 -1
  63. package/dist/esm/worklets/transform.mjs +201 -197
  64. package/dist/esm/worklets/transform.mjs.map +1 -1
  65. package/dist/esm/worklets/types.mjs +0 -2
  66. package/package.json +15 -6
  67. package/src/cache.ts +37 -7
  68. package/src/index.ts +44 -19
  69. package/src/reactNativeViewConfig.ts +6 -1
  70. package/src/transformBabel.test.ts +351 -17
  71. package/src/transformBabel.ts +137 -96
  72. package/src/transformHermesClasses.ts +34 -0
  73. package/src/transformSWC.ts +12 -1
  74. package/src/transformWorklets.test.ts +80 -5
  75. package/src/workletUtils.ts +4 -0
  76. package/src/worklets/autoworklet.ts +5 -2
  77. package/src/worklets/globals.ts +23 -0
  78. package/src/worklets/serialize.ts +1 -1
  79. package/types/cache.d.ts +2 -2
  80. package/types/cache.d.ts.map +1 -1
  81. package/types/index.d.ts +1 -0
  82. package/types/index.d.ts.map +1 -1
  83. package/types/reactNativeViewConfig.d.ts.map +1 -1
  84. package/types/transformBabel.d.ts +16 -1
  85. package/types/transformBabel.d.ts.map +1 -1
  86. package/types/transformHermesClasses.d.ts +5 -0
  87. package/types/transformHermesClasses.d.ts.map +1 -0
  88. package/types/transformSWC.d.ts +1 -4
  89. package/types/transformSWC.d.ts.map +1 -1
  90. package/types/workletUtils.d.ts +4 -0
  91. package/types/workletUtils.d.ts.map +1 -0
  92. package/types/worklets/autoworklet.d.ts.map +1 -1
  93. package/types/worklets/globals.d.ts.map +1 -1
  94. package/dist/cjs/transformBabel.test.cjs +0 -360
  95. package/dist/cjs/transformHermesLoops.test.cjs +0 -257
  96. package/dist/cjs/transformSWC.test.cjs +0 -117
  97. package/dist/cjs/transformWorklets.test.cjs +0 -604
  98. package/dist/esm/transformBabel.test.mjs +0 -337
  99. package/dist/esm/transformBabel.test.mjs.map +0 -1
  100. package/dist/esm/transformHermesLoops.test.mjs +0 -234
  101. package/dist/esm/transformHermesLoops.test.mjs.map +0 -1
  102. package/dist/esm/transformSWC.test.mjs +0 -118
  103. package/dist/esm/transformSWC.test.mjs.map +0 -1
  104. package/dist/esm/transformWorklets.test.mjs +0 -581
  105. package/dist/esm/transformWorklets.test.mjs.map +0 -1
  106. package/dist/esm/types.mjs.map +0 -1
  107. package/dist/esm/worklets/types.mjs.map +0 -1
  108. package/types/transformBabel.test.d.ts +0 -2
  109. package/types/transformBabel.test.d.ts.map +0 -1
  110. package/types/transformHermesLoops.test.d.ts +0 -2
  111. package/types/transformHermesLoops.test.d.ts.map +0 -1
  112. package/types/transformSWC.test.d.ts +0 -2
  113. package/types/transformSWC.test.d.ts.map +0 -1
  114. package/types/transformWorklets.test.d.ts +0 -2
  115. package/types/transformWorklets.test.d.ts.map +0 -1
@@ -3,71 +3,156 @@ 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
+ "ReanimatedError",
124
+ "__reanimatedLoggerConfig",
125
+ "_IS_FABRIC",
126
+ "_log",
127
+ "_toString",
128
+ "_scheduleHostFunctionOnJS",
129
+ "_scheduleRemoteFunctionOnJS",
130
+ "_scheduleOnRuntime",
131
+ "_makeShareableClone",
132
+ "_updatePropsPaper",
133
+ "_updatePropsFabric",
134
+ "_measurePaper",
135
+ "_measureFabric",
136
+ "_scrollToPaper",
137
+ "_dispatchCommandPaper",
138
+ "_dispatchCommandFabric",
139
+ "_setGestureState",
140
+ "_notifyAboutProgress",
141
+ "_notifyAboutEnd",
142
+ "_runOnUIQueue",
143
+ "_getAnimationTimestamp"
144
+ ]);
60
145
  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
- }
146
+ const set = /* @__PURE__ */ new Set();
147
+ if (!strictGlobal) {
148
+ for (const g of DEFAULT_GLOBALS) {
149
+ set.add(g);
150
+ }
151
+ }
152
+ if (customGlobals) {
153
+ for (const g of customGlobals) {
154
+ set.add(g);
155
+ }
156
+ }
157
+ return set;
158
+ }
@@ -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
+ }