@vxrn/compiler 2.8.1 → 2.9.0

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.
@@ -57,6 +57,7 @@ __reExport(index_exports, require("./transformHermesClasses.cjs"), module.export
57
57
  var import_cache2 = require("./cache.cjs");
58
58
  var import_globals = require("./worklets/globals.cjs");
59
59
  var import_scope = require("./worklets/scope.cjs");
60
+ __reExport(index_exports, require("./transformMixedNativeModule.cjs"), module.exports);
60
61
  const import_meta = {};
61
62
  const perfStats = {
62
63
  babel: {
@@ -25,7 +25,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
27
  var reactNativeCodegen_exports = {};
28
- __export(reactNativeCodegen_exports, { transformReactNativeCodegen: () => transformReactNativeCodegen });
28
+ __export(reactNativeCodegen_exports, {
29
+ isReactNativeCodegenSpec: () => isReactNativeCodegenSpec,
30
+ transformReactNativeCodegen: () => transformReactNativeCodegen
31
+ });
29
32
  module.exports = __toCommonJS(reactNativeCodegen_exports);
30
33
  var import_magic_string = __toESM(require("magic-string"), 1);
31
34
  var import_reactNativeViewConfig = require("./reactNativeViewConfig.cjs");
@@ -61,12 +64,12 @@ function isCodegenNativeCommandsDeclaration(declaration) {
61
64
  const unwrapped = unwrapExpression(declaration);
62
65
  return unwrapped?.type === "CallExpression" && unwrapped.callee?.type === "Identifier" && unwrapped.callee.name === "codegenNativeCommands";
63
66
  }
67
+ function isReactNativeCodegenSpec(id, code) {
68
+ return CODEGEN_FILE_RE.test(normalizePath(id.split("?")[0])) && CODEGEN_CALL_RE.test(code);
69
+ }
64
70
  function transformReactNativeCodegen(code, id, projectRoot) {
65
71
  const cleanId = normalizePath(id.split("?")[0]);
66
- if (!CODEGEN_FILE_RE.test(cleanId)) {
67
- return;
68
- }
69
- if (!CODEGEN_CALL_RE.test(code)) {
72
+ if (!isReactNativeCodegenSpec(id, code)) {
70
73
  return;
71
74
  }
72
75
  const program = (0, import_reactNativeViewConfig.parseSpec)(code, cleanId, projectRoot);
@@ -27,7 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  var transformHermesAsync_exports = {};
28
28
  __export(transformHermesAsync_exports, { transformHermesAsync: () => transformHermesAsync });
29
29
  module.exports = __toCommonJS(transformHermesAsync_exports);
30
- async function transformHermesAsync(code, filename, sourceMaps = false, format) {
30
+ async function transformHermesAsync(code, filename, sourceMaps = false, format, keepNames = false) {
31
31
  if (!format && !code.includes("async")) return;
32
32
  const { transformSync } = await import("esbuild");
33
33
  const cleanId = filename.split("?")[0];
@@ -35,6 +35,7 @@ async function transformHermesAsync(code, filename, sourceMaps = false, format)
35
35
  loader: /\.[cm]?ts$/.test(cleanId) ? "ts" : cleanId.endsWith(".tsx") ? "tsx" : "jsx",
36
36
  jsx: "preserve",
37
37
  format,
38
+ keepNames,
38
39
  supported: {
39
40
  "async-await": false,
40
41
  "async-generator": false,
@@ -0,0 +1,297 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var transformMixedNativeModule_exports = {};
28
+ __export(transformMixedNativeModule_exports, { transformMixedNativeModule: () => transformMixedNativeModule });
29
+ module.exports = __toCommonJS(transformMixedNativeModule_exports);
30
+ var import_oxc_parser = require("oxc-parser");
31
+ var import_magic_string = __toESM(require("magic-string"), 1);
32
+ var import_remapping = __toESM(require("@jridgewell/remapping"), 1);
33
+ function analyze(program) {
34
+ const scopes = /* @__PURE__ */ new WeakMap();
35
+ const bindings = /* @__PURE__ */ new WeakSet();
36
+ const root = {
37
+ bindings: /* @__PURE__ */ new Set(),
38
+ function: true
39
+ };
40
+ function bind(pattern, scope) {
41
+ if (!pattern) return;
42
+ if (pattern.type === "Identifier") {
43
+ scope.bindings.add(pattern.name);
44
+ bindings.add(pattern);
45
+ } else if (pattern.type === "RestElement") bind(pattern.argument, scope);
46
+ else if (pattern.type === "AssignmentPattern") bind(pattern.left, scope);
47
+ else if (pattern.type === "ArrayPattern") {
48
+ for (const item of pattern.elements) bind(item, scope);
49
+ } else if (pattern.type === "ObjectPattern") {
50
+ for (const item of pattern.properties) bind(item.type === "RestElement" ? item.argument : item.value, scope);
51
+ }
52
+ }
53
+ function visit(node, parentScope) {
54
+ let scope = parentScope;
55
+ const fn = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/.test(node.type);
56
+ if (node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") bind(node.id, parentScope);
57
+ if (fn || /^(?:BlockStatement|CatchClause|ForStatement|ForInStatement|ForOfStatement|SwitchStatement|ClassExpression|ClassDeclaration|StaticBlock)$/.test(node.type)) {
58
+ scope = {
59
+ parent: parentScope,
60
+ bindings: /* @__PURE__ */ new Set(),
61
+ function: fn || node.type === "StaticBlock"
62
+ };
63
+ }
64
+ scopes.set(node, scope);
65
+ if (fn) {
66
+ if (node.type === "FunctionExpression") bind(node.id, scope);
67
+ for (const param of node.params) bind(param, scope);
68
+ }
69
+ if (node.type === "ClassExpression" || node.type === "ClassDeclaration") bind(node.id, scope);
70
+ if (node.type === "CatchClause") bind(node.param, scope);
71
+ if (node.type === "VariableDeclaration") {
72
+ let target = scope;
73
+ if (node.kind === "var") while (!target.function) target = target.parent;
74
+ for (const declaration of node.declarations) bind(declaration.id, target);
75
+ }
76
+ if (node.type === "ImportDeclaration") for (const specifier of node.specifiers) bind(specifier.local, scope);
77
+ children(node, (child) => visit(child, scope));
78
+ if ((node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") && node.id) scopes.set(node.id, parentScope);
79
+ }
80
+ visit(program, root);
81
+ function binding(node) {
82
+ let scope = scopes.get(node);
83
+ while (scope && !scope.bindings.has(node.name)) scope = scope.parent;
84
+ return scope;
85
+ }
86
+ return {
87
+ bindings,
88
+ binding,
89
+ rootBindings: root.bindings
90
+ };
91
+ }
92
+ function children(node, visit) {
93
+ for (const key of Object.keys(node)) {
94
+ if (key === "parent") continue;
95
+ const value = node[key];
96
+ if (Array.isArray(value)) {
97
+ for (const child of value) if (child?.type) visit(child, key);
98
+ } else if (value?.type) visit(value, key);
99
+ }
100
+ }
101
+ function isReference(node, parent, key, bindings) {
102
+ if (bindings.has(node)) return false;
103
+ if ((parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression") && key === "property" && !parent.computed) return false;
104
+ if (/^(?:Property|MethodDefinition|PropertyDefinition)$/.test(parent.type) && key === "key" && !parent.computed) return false;
105
+ if (/^(?:Import.*Specifier|ExportSpecifier|LabeledStatement|BreakStatement|ContinueStatement|MetaProperty)$/.test(parent.type)) return false;
106
+ return true;
107
+ }
108
+ function lowerLocalExports(program, code, analysis) {
109
+ const edited = new import_magic_string.default(code);
110
+ let exportAccess = "__mixedExports";
111
+ while (code.includes(exportAccess)) exportAccess += "_";
112
+ const exportBinding = analysis.rootBindings.has("exports") ? `const ${exportAccess} = module.exports;` : `const ${exportAccess} = () => exports;`;
113
+ const exportObject = analysis.rootBindings.has("exports") ? exportAccess : `${exportAccess}()`;
114
+ const exported = /* @__PURE__ */ new Map();
115
+ const imported = /* @__PURE__ */ new Set();
116
+ for (const node of program.body) if (node.type === "ImportDeclaration") for (const specifier of node.specifiers) imported.add(specifier.local.name);
117
+ const hoisted = [];
118
+ const defaultFunctions = [];
119
+ function names(pattern) {
120
+ if (!pattern) return [];
121
+ if (pattern.type === "Identifier") return [pattern];
122
+ if (pattern.type === "RestElement") return names(pattern.argument);
123
+ if (pattern.type === "AssignmentPattern") return names(pattern.left);
124
+ if (pattern.type === "ArrayPattern") return pattern.elements.flatMap(names);
125
+ if (pattern.type === "ObjectPattern") return pattern.properties.flatMap((item) => names(item.type === "RestElement" ? item.argument : item.value));
126
+ return [];
127
+ }
128
+ function add(id, name) {
129
+ const entry = exported.get(id.name) || {
130
+ scope: analysis.binding(id),
131
+ names: []
132
+ };
133
+ entry.names.push(name);
134
+ exported.set(id.name, entry);
135
+ }
136
+ const assignments = (id) => exported.get(id).names.map((name) => `${exportObject}[${JSON.stringify(name)}] = `).join("") + id;
137
+ for (const node of program.body) {
138
+ if (node.type === "ExportDefaultDeclaration") {
139
+ const declaration = node.declaration;
140
+ if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration" && declaration.id) {
141
+ edited.remove(node.start, declaration.start);
142
+ if (declaration.id) {
143
+ add(declaration.id, "default");
144
+ if (declaration.type === "FunctionDeclaration") hoisted.push(declaration.id.name);
145
+ else edited.appendLeft(node.end, `;${exportObject}.default = ${declaration.id.name};`);
146
+ } else {
147
+ let name = "__mixedDefault";
148
+ while (code.includes(name)) name += "_";
149
+ const prefix = code.slice(declaration.start, declaration.body.start).match(/^(?:async\s+)?function\s*\*?/)[0];
150
+ edited.prependRight(declaration.start + prefix.length, ` ${name}`);
151
+ defaultFunctions.push(`${exportObject}.default = ${name};`);
152
+ }
153
+ } else if (declaration.type !== "TSInterfaceDeclaration") {
154
+ edited.overwrite(node.start, declaration.start, `${exportObject}.default = (`);
155
+ edited.appendLeft(declaration.end, ")");
156
+ }
157
+ }
158
+ if (node.type === "ExportNamedDeclaration" && !node.source && node.exportKind !== "type") {
159
+ const declaration = node.declaration;
160
+ if (declaration) {
161
+ if (/^(?:TS|Interface|Type)/.test(declaration.type)) continue;
162
+ const ids = declaration.type === "VariableDeclaration" ? declaration.declarations.flatMap((item) => names(item.id)) : names(declaration.id);
163
+ for (const id of ids) add(id, id.name);
164
+ edited.remove(node.start, declaration.start);
165
+ if (declaration.type === "FunctionDeclaration") hoisted.push(...ids.map((id) => id.name));
166
+ } else {
167
+ const locals = node.specifiers.filter((item) => item.exportKind !== "type" && !imported.has(item.local.name));
168
+ for (const item of locals) add(item.local, item.exported.name ?? item.exported.value);
169
+ if (locals.length === node.specifiers.length) edited.remove(node.start, node.end);
170
+ else if (locals.length) {
171
+ const retained = node.specifiers.filter((other) => !locals.includes(other));
172
+ edited.overwrite(node.start, node.end, `export { ${retained.map((other) => code.slice(other.start, other.end)).join(", ")} };`);
173
+ }
174
+ }
175
+ }
176
+ }
177
+ for (const node of program.body) {
178
+ const declaration = node.type === "ExportNamedDeclaration" ? node.declaration : node;
179
+ if (!declaration) continue;
180
+ if (declaration.type === "VariableDeclaration") {
181
+ for (const item of declaration.declarations) for (const id of names(item.id)) {
182
+ if (exported.has(id.name)) {
183
+ if (item.id.type === "Identifier" && item.init) {
184
+ const prefix = exported.get(id.name).names.map((name) => `${exportObject}[${JSON.stringify(name)}] = `).join("");
185
+ edited.prependRight(item.init.start, prefix + "(");
186
+ edited.appendLeft(item.init.end, ")");
187
+ } else if (item.id.type !== "Identifier") edited.appendLeft(node.end, `;${assignments(id.name)};`);
188
+ }
189
+ }
190
+ } else if (declaration.type === "FunctionDeclaration" && exported.has(declaration.id?.name)) {
191
+ if (!hoisted.includes(declaration.id.name)) hoisted.push(declaration.id.name);
192
+ } else if (declaration.type === "ClassDeclaration" && exported.has(declaration.id?.name)) {
193
+ edited.appendLeft(node.end, `;${assignments(declaration.id.name)};`);
194
+ }
195
+ }
196
+ let temporary = "__mixedExportResult";
197
+ while (code.includes(temporary)) temporary += "_";
198
+ function mutations(node) {
199
+ if (node.type === "ForOfStatement" || node.type === "ForInStatement") {
200
+ const ids = (node.left.type === "VariableDeclaration" ? node.left.declarations.flatMap((item) => names(item.id)) : names(node.left)).filter((id) => exported.has(id.name) && analysis.binding(id) === exported.get(id.name).scope);
201
+ if (ids.length) {
202
+ const publish = ids.map((id) => assignments(id.name) + ";").join("");
203
+ if (node.body.type === "BlockStatement") edited.prependRight(node.body.start + 1, publish);
204
+ else {
205
+ edited.prependRight(node.body.start, "{" + publish);
206
+ edited.appendLeft(node.body.end, "}");
207
+ }
208
+ }
209
+ }
210
+ if (node.type === "AssignmentExpression" || node.type === "UpdateExpression") {
211
+ const ids = names(node.type === "AssignmentExpression" ? node.left : node.argument).filter((id) => exported.has(id.name) && analysis.binding(id) === exported.get(id.name).scope);
212
+ if (ids.length) {
213
+ edited.prependRight(node.start, `((${temporary}) => (${ids.map((id) => assignments(id.name)).join(", ")}, ${temporary}))(`);
214
+ edited.appendLeft(node.end, ")");
215
+ }
216
+ }
217
+ children(node, (child) => mutations(child));
218
+ }
219
+ mutations(program);
220
+ const first = program.body.find((node) => !(node.type === "ExpressionStatement" && node.directive));
221
+ const initialization = [...exported.values()].flatMap((entry) => entry.names).map((name) => `${exportObject}[${JSON.stringify(name)}] = void 0;`).join("");
222
+ edited.prependRight(first?.start ?? code.length, `export {};${exportBinding}${initialization}${hoisted.map((id) => assignments(id) + ";").join("")}${defaultFunctions.join("")}`);
223
+ return edited;
224
+ }
225
+ async function transformMixedNativeModule(code, filename, sourceMaps = false) {
226
+ if (!/\b(?:module|exports)\b/.test(code) || !/\b(?:import|export)\b/.test(code)) return;
227
+ const typescript = /\.[cm]?tsx?$/.test(filename);
228
+ const parsed = (0, import_oxc_parser.parseSync)(filename, code, { lang: typescript ? filename.endsWith("tsx") ? "tsx" : "ts" : "jsx" });
229
+ if (parsed.errors.length) throw new Error(parsed.errors[0].message);
230
+ let program = parsed.program;
231
+ if (!program.body.some((node) => /^(?:Import|Export)/.test(node.type))) return;
232
+ let analysis = analyze(program);
233
+ let mixed = false;
234
+ function inspect(node, parent, key) {
235
+ if (node.type === "Identifier" && /^(?:module|exports)$/.test(node.name) && isReference(node, parent, key, analysis.bindings) && !analysis.binding(node)) mixed = true;
236
+ children(node, (child, key2) => inspect(child, node, key2));
237
+ }
238
+ inspect(program, program, "");
239
+ if (!mixed) return;
240
+ const { transform } = await import("@swc/core");
241
+ let typeMap;
242
+ if (typescript) {
243
+ const stripped = await transform(code, {
244
+ filename,
245
+ swcrc: false,
246
+ configFile: false,
247
+ sourceMaps,
248
+ jsc: {
249
+ target: "esnext",
250
+ parser: {
251
+ syntax: "typescript",
252
+ tsx: filename.endsWith(".tsx")
253
+ },
254
+ transform: { react: { runtime: "preserve" } }
255
+ },
256
+ module: { type: "es6" }
257
+ });
258
+ code = stripped.code;
259
+ typeMap = stripped.map ? JSON.parse(stripped.map) : void 0;
260
+ const javascript = (0, import_oxc_parser.parseSync)(filename, code, { lang: "jsx" });
261
+ if (javascript.errors.length) throw new Error(javascript.errors[0].message);
262
+ program = javascript.program;
263
+ analysis = analyze(program);
264
+ }
265
+ const edited = lowerLocalExports(program, code, analysis);
266
+ const result = await transform(edited.toString(), {
267
+ filename,
268
+ swcrc: false,
269
+ configFile: false,
270
+ sourceMaps,
271
+ jsc: {
272
+ target: "esnext",
273
+ parser: {
274
+ syntax: "ecmascript",
275
+ jsx: true
276
+ },
277
+ transform: { react: { runtime: "preserve" } }
278
+ },
279
+ module: {
280
+ type: "commonjs",
281
+ strictMode: false,
282
+ allowTopLevelThis: true
283
+ }
284
+ });
285
+ return {
286
+ code: result.code,
287
+ map: result.map ? (0, import_remapping.default)([
288
+ JSON.parse(result.map),
289
+ edited.generateMap({
290
+ source: filename,
291
+ includeContent: true,
292
+ hires: true
293
+ }),
294
+ ...typeMap ? [typeMap] : []
295
+ ], () => null) : void 0
296
+ };
297
+ }
@@ -38,6 +38,10 @@ var import_node_module = require("node:module");
38
38
  var import_node_path = __toESM(require("node:path"), 1);
39
39
  var import_configure = require("./configure.cjs");
40
40
  var import_autoworklet = require("./worklets/autoworklet.cjs");
41
+ var import_remapping = __toESM(require("@jridgewell/remapping"), 1);
42
+ var import_reactNativeCodegen = require("./reactNativeCodegen.cjs");
43
+ var import_transformFlow = require("./transformFlow.cjs");
44
+ var import_transformSWC = require("./transformSWC.cjs");
41
45
  var import_transform = require("./worklets/transform.cjs");
42
46
  var import_transform2 = require("./worklets/transform.cjs");
43
47
  const import_meta = {};
@@ -131,5 +135,15 @@ function getWorkletsVersion(projectRoot, filename) {
131
135
  throw new Error(`[@vxrn/compiler] Unable to resolve "react-native-worklets" or "react-native-reanimated" version from "${target}". Please ensure react-native-worklets is installed in your project.`);
132
136
  }
133
137
  async function transformWorklets(id, code, sourceMaps = false, options) {
138
+ if ((0, import_transformSWC.shouldStripFlow)(id, code)) {
139
+ if ((0, import_reactNativeCodegen.isReactNativeCodegenSpec)(id, code)) return { code };
140
+ const stripped = await (0, import_transformFlow.stripFlowTypes)(id, code, sourceMaps);
141
+ const result = (0, import_transform.executeWorkletTransform)(id, stripped.code, sourceMaps, options, getWorkletsVersion);
142
+ if (!sourceMaps || !stripped.map) return result;
143
+ return {
144
+ code: result.code,
145
+ map: result.map ? (0, import_remapping.default)([result.map, stripped.map], () => null) : stripped.map
146
+ };
147
+ }
134
148
  return (0, import_transform.executeWorkletTransform)(id, code, sourceMaps, options, getWorkletsVersion);
135
149
  }
package/dist/esm/index.js CHANGED
@@ -31,6 +31,8 @@ export * from "./transformHermesAsync.mjs"
31
31
 
32
32
  export * from "./transformHermesClasses.mjs"
33
33
 
34
+ export * from "./transformMixedNativeModule.mjs"
35
+
34
36
  const perfStats = {
35
37
  babel: {
36
38
  totalCalls: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, extname, join, relative, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolvePath } from \"@vxrn/utils\";\nimport { cssToReactNativeRuntime } from \"react-native-css-interop/css-to-rn/index.js\";\nimport { configuration, isNativeWorkletsEnabled } from \"./configure\";\nimport { debug, runtimePublicPath, validParsers } from \"./constants\";\nimport {\n getBabelOptions,\n transformBabel,\n transformOxcReactCompiler\n} from \"./transformBabel\";\nimport { shouldSourceMap } from \"./transformSWC\";\nimport {\n prepareWorkletsForReactCompiler,\n shouldTransformWorklets,\n transformWorklets\n} from \"./transformWorklets\";\nimport { getCachedTransform, logCacheStats, setCachedTransform } from \"./cache\";\nexport * from \"./configure\";\nexport * from \"./transformBabel\";\nexport * from \"./transformFlow\";\nexport * from \"./transformSWC\";\nexport * from \"./transformWorklets\";\nexport * from \"./reactNativeCodegen\";\nexport * from \"./transformHermesLoops\";\nexport * from \"./transformHermesAsync\";\nexport * from \"./transformHermesClasses\";\nimport { clearTransformCache } from \"./cache\";\nimport { JS_GLOBALS } from \"./worklets/globals\";\nimport { getClosureVariables } from \"./worklets/scope\";\nconst perfStats = {\n babel: {\n totalCalls: 0,\n totalTransforms: 0,\n totalTime: 0,\n byEnvironment: {}\n },\n optimizeDeps: {\n byEnvironment: {}\n }\n};\nfunction logPerfSummary() {\n if (!process.env.DEBUG_COMPILER_PERF) {\n return;\n }\n console.info(\"\\n\\u{1F4CA} [Compiler Performance Summary]\");\n console.info(\n `Babel: ${perfStats.babel.totalTransforms} transforms / ${perfStats.babel.totalCalls} calls (${(perfStats.babel.totalTransforms / Math.max(perfStats.babel.totalCalls, 1) * 100).toFixed(1)}% transform rate)`\n );\n console.info(`Babel total time: ${perfStats.babel.totalTime}ms`);\n for (const [env, stats] of Object.entries(perfStats.babel.byEnvironment)) {\n if (stats.transforms > 0) {\n console.info(\n ` ${env}: ${stats.transforms} transforms, ${stats.time}ms (${(stats.time / stats.transforms).toFixed(1)}ms avg)`\n );\n }\n }\n for (const [env, stats] of Object.entries(perfStats.optimizeDeps.byEnvironment)) {\n const elapsed = Date.now() - stats.startTime;\n console.info(\n `optimizeDeps ${env}: checked ${stats.filesChecked} files, transformed ${stats.filesTransformed} (${elapsed}ms)`\n );\n }\n}\nconst compilerLog = {\n compiled: 0,\n cached: 0,\n time: 0,\n // typed loose because the dom lib types setTimeout as number, but node gives\n // us a Timeout we need to unref so the debounce never holds the process open\n timer: null\n};\nfunction logCompiled(cached, ms) {\n if (cached) {\n compilerLog.cached++;\n } else {\n compilerLog.compiled++;\n compilerLog.time += ms;\n }\n if (compilerLog.timer) clearTimeout(compilerLog.timer);\n compilerLog.timer = setTimeout(() => {\n const total = compilerLog.compiled + compilerLog.cached;\n const detail = compilerLog.compiled ? `${compilerLog.compiled} compiled in ${compilerLog.time}ms${compilerLog.cached ? `, ${compilerLog.cached} cached` : \"\"}` : `all cached`;\n console.info(` \\u{1FA84} [compiler] ${total} file${total === 1 ? \"\" : \"s\"} (${detail})`);\n compilerLog.compiled = 0;\n compilerLog.cached = 0;\n compilerLog.time = 0;\n compilerLog.timer = null;\n }, 500);\n compilerLog.timer.unref?.();\n}\nasync function performBabelTransform({\n id,\n code,\n projectRoot,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n}) {\n perfStats.babel.totalCalls++;\n if (!perfStats.babel.byEnvironment[environment]) {\n perfStats.babel.byEnvironment[environment] = { calls: 0, transforms: 0, time: 0 };\n }\n perfStats.babel.byEnvironment[environment].calls++;\n const transformProps = {\n id,\n code,\n projectRoot,\n development: !production,\n environment,\n reactForRNVersion\n };\n const userTransform = optionsIn?.transform?.(transformProps);\n if (userTransform === false) {\n return null;\n }\n if (userTransform !== \"swc\" && userTransform !== \"oxc\") {\n let babelOptions = getBabelOptions({\n ...transformProps,\n userSetting: userTransform\n });\n if (!babelOptions && shouldTransformWorklets({ id, code })) {\n babelOptions = { plugins: [] };\n }\n if (babelOptions) {\n const hasCompilerPlugin = babelOptions.plugins?.some(\n (x) => Array.isArray(x) && x[0] === \"babel-plugin-react-compiler\"\n );\n const userBabelConfigPath = typeof babelOptions.configFile === \"string\" ? babelOptions.configFile : null;\n const cached = getCachedTransform(id, code, environment, userBabelConfigPath);\n if (cached) {\n perfStats.babel.byEnvironment[environment].transforms++;\n if (hasCompilerPlugin && (cached.code.includes(\"react/compiler-runtime\") || cached.code.includes(\"react-compiler-runtime\"))) {\n debug?.(` \\u{1FA84} [compiler] ${relative(process.cwd(), id)} (cached)`);\n logCompiled(true, 0);\n }\n debug?.(`[babel/cached] ${id}`);\n return cached;\n }\n const isWorkletPlugin = (entry) => {\n if (!entry) return false;\n const name = typeof entry === \"string\" ? entry : Array.isArray(entry) ? entry[0] : null;\n return typeof name === \"string\" && (name.includes(\"react-native-worklets\") || name.includes(\"react-native-reanimated\"));\n };\n const workletEntry = babelOptions.plugins?.find(isWorkletPlugin);\n const workletPluginOptions = Array.isArray(workletEntry) ? workletEntry[1] : void 0;\n const useWorklets = isNativeWorkletsEnabled() && (Boolean(workletEntry) || shouldTransformWorklets({ id, code }));\n let curCode = code;\n let workletPreparation = null;\n let compilerOut = null;\n const compilerPluginIndex = babelOptions.plugins?.findIndex(\n (x) => Array.isArray(x) && x[0] === \"babel-plugin-react-compiler\"\n ) ?? -1;\n if (compilerPluginIndex !== -1) {\n const compilerPluginConfig = babelOptions.plugins[compilerPluginIndex];\n const compilerPluginOptions = compilerPluginConfig[1] || {};\n const useBabelCompiler = compilerPluginOptions.compiler === \"babel\" || process.env.ONE_REACT_COMPILER === \"babel\" || process.env.VXRN_REACT_COMPILER === \"babel\";\n if (!useBabelCompiler) {\n if (useWorklets) {\n workletPreparation = prepareWorkletsForReactCompiler(\n id,\n curCode,\n shouldSourceMap()\n );\n if (workletPreparation) curCode = workletPreparation.code;\n }\n compilerOut = await transformOxcReactCompiler(\n id,\n curCode,\n compilerPluginOptions,\n shouldSourceMap()\n );\n if (compilerOut) curCode = compilerOut.code;\n babelOptions.plugins.splice(compilerPluginIndex, 1);\n }\n }\n let workletsOut = null;\n if (useWorklets) {\n workletsOut = await transformWorklets(id, curCode, shouldSourceMap(), {\n projectRoot,\n ...workletPluginOptions\n });\n babelOptions.plugins = babelOptions.plugins?.filter(\n (entry) => !isWorkletPlugin(entry)\n );\n curCode = workletsOut.code;\n }\n const startTime = Date.now();\n let babelOut = null;\n if (babelOptions.plugins?.length === 0 && !babelOptions.configFile && !babelOptions.babelrc) {\n let finalMap = void 0;\n if (shouldSourceMap()) {\n const intermediateMaps = [\n workletPreparation?.map,\n compilerOut?.map,\n workletsOut?.map\n ].filter(Boolean);\n if (intermediateMaps.length === 1) {\n finalMap = intermediateMaps[0];\n } else if (intermediateMaps.length > 1) {\n const remapping = (await import(\"@jridgewell/remapping\")).default;\n finalMap = remapping(intermediateMaps.slice().reverse(), () => null);\n }\n }\n babelOut = { code: curCode, map: finalMap };\n } else {\n const babelOptsWithMap = shouldSourceMap() && (workletsOut?.map || compilerOut?.map || workletPreparation?.map) ? { ...babelOptions, sourceMaps: true } : babelOptions;\n babelOut = await transformBabel(id, curCode, babelOptsWithMap);\n if (shouldSourceMap() && babelOut?.map) {\n const priorMaps = [\n workletPreparation?.map,\n compilerOut?.map,\n workletsOut?.map\n ].filter(Boolean);\n if (priorMaps.length > 0) {\n const remapping = (await import(\"@jridgewell/remapping\")).default;\n babelOut.map = remapping(\n [babelOut.map, ...priorMaps.slice().reverse()],\n () => null\n );\n }\n }\n }\n const babelTime = Date.now() - startTime;\n if (babelOut?.code) {\n perfStats.babel.totalTransforms++;\n perfStats.babel.totalTime += babelTime;\n perfStats.babel.byEnvironment[environment].transforms++;\n perfStats.babel.byEnvironment[environment].time += babelTime;\n if (hasCompilerPlugin && (babelOut.code.includes(\"react/compiler-runtime\") || babelOut.code.includes(\"react-compiler-runtime\"))) {\n debug?.(` \\u{1FA84} [compiler] ${relative(process.cwd(), id)} (${babelTime}ms)`);\n logCompiled(false, babelTime);\n }\n debug?.(`[babel] ${id}`);\n const outCode = `${babelOut.code}\n// vxrn-did-babel`;\n const result = { code: outCode, map: babelOut.map };\n setCachedTransform(id, code, result, environment, userBabelConfigPath);\n return result;\n }\n }\n }\n return null;\n}\nasync function createVXRNCompilerPlugin(optionsIn) {\n const reactVersion = await (async () => {\n const path = resolvePath(\"react/package.json\");\n const json = JSON.parse(await readFile(path, \"utf-8\"));\n return json.version;\n })();\n const envNames = {\n ios: true,\n android: true,\n client: true,\n ssr: true\n };\n function getEnvName(name) {\n if (name === \"worker\") return \"ssr\";\n if (!envNames[name]) throw new Error(`Invalid env: ${name}`);\n return name;\n }\n const reactForRNVersion = reactVersion.split(\".\")[0];\n const cssTransformCache = /* @__PURE__ */ new Map();\n const rolldownPath = resolvePath(\"rolldown\");\n const rolldownNodeMods = rolldownPath.slice(\n 0,\n rolldownPath.indexOf(sep + \"node_modules\")\n );\n let config;\n return [\n {\n name: \"one:compiler-resolve-refresh-runtime\",\n apply: \"serve\",\n enforce: \"pre\",\n // Run before Vite default resolve to avoid syscalls\n resolveId: (id) => id === runtimePublicPath || id === `${runtimePublicPath}.map` ? id : void 0,\n load: (id) => {\n const basePath = dirname(fileURLToPath(import.meta.url));\n if (id === runtimePublicPath) {\n return readFileSync(join(basePath, \"refresh-runtime.mjs\"), \"utf-8\").replace(\n /\\/\\/# sourceMappingURL=.*/,\n \"\"\n );\n }\n if (id === `${runtimePublicPath}.map`) {\n return JSON.stringify({ version: 3, sources: [], mappings: \"\" });\n }\n return void 0;\n }\n },\n {\n name: `one:compiler-css-to-js`,\n // only .css files can match, so let rust reject everything else\n transform: {\n filter: { id: /\\.css$/ },\n handler(codeIn, id) {\n const environment = getEnvName(this.environment.name);\n if (configuration.enableNativeCSS && (environment === \"ios\" || environment === \"android\")) {\n {\n const data = JSON.stringify(\n cssToReactNativeRuntime(codeIn, { inlineRem: 16 })\n );\n const code = `require(\"nativewind/dist/index.js\").require().StyleSheet.registerCompiled(${data})`;\n const newId = `${id}.js`;\n const cssId = newId.replace(rolldownNodeMods + sep, \"\");\n cssTransformCache.set(cssId, code);\n return {\n code,\n id: newId,\n map: null\n };\n }\n }\n }\n },\n generateBundle(_, bundle) {\n const environment = getEnvName(this.environment.name);\n if (configuration.enableNativeCSS && (environment === \"ios\" || environment === \"android\")) {\n const rootJSName = Object.keys(bundle).find((i) => {\n const chunk = bundle[i];\n return chunk.type == \"chunk\" && chunk.fileName.match(/.[cm]?js(?:\\?.+)?$/) != null;\n });\n if (!rootJSName) {\n throw new Error(`Can't find root js, internal one error`);\n }\n const rootJS = bundle[rootJSName];\n const cssAssets = Object.keys(bundle).filter(\n (i) => bundle[i].fileName.endsWith(\".css.js\")\n );\n for (const name of cssAssets) {\n delete bundle[name];\n const jsCSS = cssTransformCache.get(name);\n rootJS.code = `\n${jsCSS}\n${rootJS.code}\n`;\n }\n }\n }\n },\n {\n name: \"one:compiler\",\n enforce: \"pre\",\n config: () => {\n const nodeModulesFilter = /node_modules[/\\\\].*\\.(tsx?|jsx?|mjs|cjs)$/;\n const createEnvironmentConfig = (environment) => {\n if (!perfStats.optimizeDeps.byEnvironment[environment]) {\n perfStats.optimizeDeps.byEnvironment[environment] = {\n filesChecked: 0,\n filesTransformed: 0,\n startTime: Date.now()\n };\n }\n return {\n optimizeDeps: {\n rolldownOptions: {\n plugins: [\n {\n name: `transform-before-optimize-deps-${environment}`,\n async transform(code, id) {\n if (!nodeModulesFilter.test(id)) {\n return null;\n }\n perfStats.optimizeDeps.byEnvironment[environment].filesChecked++;\n const production = process.env.NODE_ENV === \"production\" || process.env.NODE_ENV === \"test\";\n debug?.(`[rolldown optimizeDeps] ${id}`);\n const result = await performBabelTransform({\n id,\n code,\n projectRoot: config.root,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n });\n if (!result) {\n return null;\n }\n perfStats.optimizeDeps.byEnvironment[environment].filesTransformed++;\n return {\n code: result.code,\n map: result.map\n };\n },\n buildEnd() {\n if (process.env.DEBUG_COMPILER_PERF) {\n const stats = perfStats.optimizeDeps.byEnvironment[environment];\n const elapsed = Date.now() - stats.startTime;\n console.info(\n `[optimizeDeps ${environment}] Done: ${stats.filesChecked} files checked, ${stats.filesTransformed} transformed (${elapsed}ms)`\n );\n }\n const allDone = Object.keys(perfStats.optimizeDeps.byEnvironment).length >= 2;\n if (allDone) {\n logCacheStats();\n logPerfSummary();\n }\n }\n }\n ]\n }\n },\n define: {\n \"process.env.NATIVEWIND_OS\": JSON.stringify(\n environment === \"ios\" || environment === \"android\" ? \"native\" : \"web\"\n )\n }\n };\n };\n return {\n environments: {\n ios: createEnvironmentConfig(\"ios\"),\n android: createEnvironmentConfig(\"android\"),\n client: createEnvironmentConfig(\"client\"),\n ssr: createEnvironmentConfig(\"ssr\")\n }\n };\n },\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n },\n async transform(codeIn, _id) {\n let code = codeIn;\n const environment = getEnvName(this.environment.name);\n const isNative = environment === \"ios\" || environment === \"android\";\n const production = config.command === \"build\" || process.env.NODE_ENV === \"production\" || JSON.parse(\n this.environment.config?.define?.[\"process.env.NODE_ENV\"] || '\"\"'\n ) === \"production\";\n const isEntry = _id.includes(\"one-entry-native\");\n if (isEntry) {\n if (isNative && !production) {\n code = `import '@vxrn/vite-native-client'\n${code}`;\n }\n if (isNative && configuration.enableNativewind) {\n code = `import * as x from 'nativewind'\n${code}`;\n }\n return code;\n }\n const id = _id.split(\"?\")[0];\n const extension = extname(id);\n if (extension === \".css\" || !validParsers.has(extension)) {\n return;\n }\n if (id.includes(`virtual:`)) {\n return;\n }\n if (codeIn.endsWith(`// vxrn-did-babel`)) {\n debug?.(`[skip babel] ${id}`);\n return;\n }\n return performBabelTransform({\n id,\n code: codeIn,\n projectRoot: config.root,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n });\n }\n },\n // wraps client-side TSX/JSX with React Refresh preamble + import.meta.hot.accept\n // runs after vite:oxc (no enforce:'pre') so it sees the already-transformed code\n {\n name: \"one:react-refresh-web\",\n apply: \"serve\",\n transform(code, _id) {\n if (this.environment.name !== \"client\") return;\n if (code.includes(runtimePublicPath)) return;\n if (/[?&](?:worker|sharedworker|raw|url)\\b/.test(_id)) return;\n const id = _id.split(\"?\")[0];\n if (id.includes(\"node_modules\")) return;\n if (id.includes(\"virtual:\")) return;\n if (id === runtimePublicPath) return;\n const ext = extname(id);\n if (ext !== \".tsx\" && ext !== \".jsx\") return;\n const hasRefreshCalls = /\\$RefreshReg\\$\\(/.test(code);\n let out = `import * as RefreshRuntime from \"${runtimePublicPath}\";\n\n`;\n if (hasRefreshCalls) {\n out += `if (!window.$RefreshReg$) throw new Error(\"React refresh preamble was not loaded. Something is wrong.\");\nconst prevRefreshReg = window.$RefreshReg$;\nconst prevRefreshSig = window.$RefreshSig$;\nwindow.$RefreshReg$ = RefreshRuntime.getRefreshReg(\"${id}\");\nwindow.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;\n\n`;\n }\n out += code;\n if (hasRefreshCalls) {\n out += `\n\nwindow.$RefreshReg$ = prevRefreshReg;\nwindow.$RefreshSig$ = prevRefreshSig;\n`;\n }\n out += `\nRefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {\n RefreshRuntime.registerExportsForReactRefresh(\"${id}\", currentExports);\n import.meta.hot.accept((nextExports) => {\n if (!nextExports) return;\n const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(\"${id}\", currentExports, nextExports);\n if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);\n });\n});\n`;\n return { code: out, map: null };\n }\n }\n ];\n}\nexport {\n JS_GLOBALS,\n clearTransformCache,\n createVXRNCompilerPlugin,\n getClosureVariables\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,YAAY;CAChB,OAAO;EACL,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,eAAe,CAAC;CAClB;C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AI,GAAG,SAAS,cAAc,GAAG;IACjC,IAAI,GAAG,SAAS,UAAU,GAAG;IAC7B,IAAI,OAAO,mBAAmB;IAC9B,MAAM,MAAM,QAAQ,EAAE;IACtB,IAAI,QAAQ,UAAU,QAAQ,QAAQ;IACtC,MAAM,kBAAkB,mBAAmB,KAAK,IAAI;IACpD,IAAI,MAAM,oCAAoC,kBAAkB;;;IAGhE,IAAI,iBAAiB;KACnB,OAAO;;;sDAGqC,GAAG;;;;IAIjD;IACA,OAAO;IACP,IAAI,iBAAiB;KACnB,OAAO;;;;;IAKT;IACA,OAAO;;mDAEoC,GAAG;;;wFAGkC,GAAG;;;;;IAKnF,OAAO;KAAE,MAAM;KAAK,KAAK;IAAK;GAChC;EACF;CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, extname, join, relative, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolvePath } from \"@vxrn/utils\";\nimport { cssToReactNativeRuntime } from \"react-native-css-interop/css-to-rn/index.js\";\nimport { configuration, isNativeWorkletsEnabled } from \"./configure\";\nimport { debug, runtimePublicPath, validParsers } from \"./constants\";\nimport {\n getBabelOptions,\n transformBabel,\n transformOxcReactCompiler\n} from \"./transformBabel\";\nimport { shouldSourceMap } from \"./transformSWC\";\nimport {\n prepareWorkletsForReactCompiler,\n shouldTransformWorklets,\n transformWorklets\n} from \"./transformWorklets\";\nimport { getCachedTransform, logCacheStats, setCachedTransform } from \"./cache\";\nexport * from \"./configure\";\nexport * from \"./transformBabel\";\nexport * from \"./transformFlow\";\nexport * from \"./transformSWC\";\nexport * from \"./transformWorklets\";\nexport * from \"./reactNativeCodegen\";\nexport * from \"./transformHermesLoops\";\nexport * from \"./transformHermesAsync\";\nexport * from \"./transformHermesClasses\";\nimport { clearTransformCache } from \"./cache\";\nimport { JS_GLOBALS } from \"./worklets/globals\";\nimport { getClosureVariables } from \"./worklets/scope\";\nexport * from \"./transformMixedNativeModule\";\nconst perfStats = {\n babel: {\n totalCalls: 0,\n totalTransforms: 0,\n totalTime: 0,\n byEnvironment: {}\n },\n optimizeDeps: {\n byEnvironment: {}\n }\n};\nfunction logPerfSummary() {\n if (!process.env.DEBUG_COMPILER_PERF) {\n return;\n }\n console.info(\"\\n\\u{1F4CA} [Compiler Performance Summary]\");\n console.info(\n `Babel: ${perfStats.babel.totalTransforms} transforms / ${perfStats.babel.totalCalls} calls (${(perfStats.babel.totalTransforms / Math.max(perfStats.babel.totalCalls, 1) * 100).toFixed(1)}% transform rate)`\n );\n console.info(`Babel total time: ${perfStats.babel.totalTime}ms`);\n for (const [env, stats] of Object.entries(perfStats.babel.byEnvironment)) {\n if (stats.transforms > 0) {\n console.info(\n ` ${env}: ${stats.transforms} transforms, ${stats.time}ms (${(stats.time / stats.transforms).toFixed(1)}ms avg)`\n );\n }\n }\n for (const [env, stats] of Object.entries(perfStats.optimizeDeps.byEnvironment)) {\n const elapsed = Date.now() - stats.startTime;\n console.info(\n `optimizeDeps ${env}: checked ${stats.filesChecked} files, transformed ${stats.filesTransformed} (${elapsed}ms)`\n );\n }\n}\nconst compilerLog = {\n compiled: 0,\n cached: 0,\n time: 0,\n // typed loose because the dom lib types setTimeout as number, but node gives\n // us a Timeout we need to unref so the debounce never holds the process open\n timer: null\n};\nfunction logCompiled(cached, ms) {\n if (cached) {\n compilerLog.cached++;\n } else {\n compilerLog.compiled++;\n compilerLog.time += ms;\n }\n if (compilerLog.timer) clearTimeout(compilerLog.timer);\n compilerLog.timer = setTimeout(() => {\n const total = compilerLog.compiled + compilerLog.cached;\n const detail = compilerLog.compiled ? `${compilerLog.compiled} compiled in ${compilerLog.time}ms${compilerLog.cached ? `, ${compilerLog.cached} cached` : \"\"}` : `all cached`;\n console.info(` \\u{1FA84} [compiler] ${total} file${total === 1 ? \"\" : \"s\"} (${detail})`);\n compilerLog.compiled = 0;\n compilerLog.cached = 0;\n compilerLog.time = 0;\n compilerLog.timer = null;\n }, 500);\n compilerLog.timer.unref?.();\n}\nasync function performBabelTransform({\n id,\n code,\n projectRoot,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n}) {\n perfStats.babel.totalCalls++;\n if (!perfStats.babel.byEnvironment[environment]) {\n perfStats.babel.byEnvironment[environment] = { calls: 0, transforms: 0, time: 0 };\n }\n perfStats.babel.byEnvironment[environment].calls++;\n const transformProps = {\n id,\n code,\n projectRoot,\n development: !production,\n environment,\n reactForRNVersion\n };\n const userTransform = optionsIn?.transform?.(transformProps);\n if (userTransform === false) {\n return null;\n }\n if (userTransform !== \"swc\" && userTransform !== \"oxc\") {\n let babelOptions = getBabelOptions({\n ...transformProps,\n userSetting: userTransform\n });\n if (!babelOptions && shouldTransformWorklets({ id, code })) {\n babelOptions = { plugins: [] };\n }\n if (babelOptions) {\n const hasCompilerPlugin = babelOptions.plugins?.some(\n (x) => Array.isArray(x) && x[0] === \"babel-plugin-react-compiler\"\n );\n const userBabelConfigPath = typeof babelOptions.configFile === \"string\" ? babelOptions.configFile : null;\n const cached = getCachedTransform(id, code, environment, userBabelConfigPath);\n if (cached) {\n perfStats.babel.byEnvironment[environment].transforms++;\n if (hasCompilerPlugin && (cached.code.includes(\"react/compiler-runtime\") || cached.code.includes(\"react-compiler-runtime\"))) {\n debug?.(` \\u{1FA84} [compiler] ${relative(process.cwd(), id)} (cached)`);\n logCompiled(true, 0);\n }\n debug?.(`[babel/cached] ${id}`);\n return cached;\n }\n const isWorkletPlugin = (entry) => {\n if (!entry) return false;\n const name = typeof entry === \"string\" ? entry : Array.isArray(entry) ? entry[0] : null;\n return typeof name === \"string\" && (name.includes(\"react-native-worklets\") || name.includes(\"react-native-reanimated\"));\n };\n const workletEntry = babelOptions.plugins?.find(isWorkletPlugin);\n const workletPluginOptions = Array.isArray(workletEntry) ? workletEntry[1] : void 0;\n const useWorklets = isNativeWorkletsEnabled() && (Boolean(workletEntry) || shouldTransformWorklets({ id, code }));\n let curCode = code;\n let workletPreparation = null;\n let compilerOut = null;\n const compilerPluginIndex = babelOptions.plugins?.findIndex(\n (x) => Array.isArray(x) && x[0] === \"babel-plugin-react-compiler\"\n ) ?? -1;\n if (compilerPluginIndex !== -1) {\n const compilerPluginConfig = babelOptions.plugins[compilerPluginIndex];\n const compilerPluginOptions = compilerPluginConfig[1] || {};\n const useBabelCompiler = compilerPluginOptions.compiler === \"babel\" || process.env.ONE_REACT_COMPILER === \"babel\" || process.env.VXRN_REACT_COMPILER === \"babel\";\n if (!useBabelCompiler) {\n if (useWorklets) {\n workletPreparation = prepareWorkletsForReactCompiler(\n id,\n curCode,\n shouldSourceMap()\n );\n if (workletPreparation) curCode = workletPreparation.code;\n }\n compilerOut = await transformOxcReactCompiler(\n id,\n curCode,\n compilerPluginOptions,\n shouldSourceMap()\n );\n if (compilerOut) curCode = compilerOut.code;\n babelOptions.plugins.splice(compilerPluginIndex, 1);\n }\n }\n let workletsOut = null;\n if (useWorklets) {\n workletsOut = await transformWorklets(id, curCode, shouldSourceMap(), {\n projectRoot,\n ...workletPluginOptions\n });\n babelOptions.plugins = babelOptions.plugins?.filter(\n (entry) => !isWorkletPlugin(entry)\n );\n curCode = workletsOut.code;\n }\n const startTime = Date.now();\n let babelOut = null;\n if (babelOptions.plugins?.length === 0 && !babelOptions.configFile && !babelOptions.babelrc) {\n let finalMap = void 0;\n if (shouldSourceMap()) {\n const intermediateMaps = [\n workletPreparation?.map,\n compilerOut?.map,\n workletsOut?.map\n ].filter(Boolean);\n if (intermediateMaps.length === 1) {\n finalMap = intermediateMaps[0];\n } else if (intermediateMaps.length > 1) {\n const remapping = (await import(\"@jridgewell/remapping\")).default;\n finalMap = remapping(intermediateMaps.slice().reverse(), () => null);\n }\n }\n babelOut = { code: curCode, map: finalMap };\n } else {\n const babelOptsWithMap = shouldSourceMap() && (workletsOut?.map || compilerOut?.map || workletPreparation?.map) ? { ...babelOptions, sourceMaps: true } : babelOptions;\n babelOut = await transformBabel(id, curCode, babelOptsWithMap);\n if (shouldSourceMap() && babelOut?.map) {\n const priorMaps = [\n workletPreparation?.map,\n compilerOut?.map,\n workletsOut?.map\n ].filter(Boolean);\n if (priorMaps.length > 0) {\n const remapping = (await import(\"@jridgewell/remapping\")).default;\n babelOut.map = remapping(\n [babelOut.map, ...priorMaps.slice().reverse()],\n () => null\n );\n }\n }\n }\n const babelTime = Date.now() - startTime;\n if (babelOut?.code) {\n perfStats.babel.totalTransforms++;\n perfStats.babel.totalTime += babelTime;\n perfStats.babel.byEnvironment[environment].transforms++;\n perfStats.babel.byEnvironment[environment].time += babelTime;\n if (hasCompilerPlugin && (babelOut.code.includes(\"react/compiler-runtime\") || babelOut.code.includes(\"react-compiler-runtime\"))) {\n debug?.(` \\u{1FA84} [compiler] ${relative(process.cwd(), id)} (${babelTime}ms)`);\n logCompiled(false, babelTime);\n }\n debug?.(`[babel] ${id}`);\n const outCode = `${babelOut.code}\n// vxrn-did-babel`;\n const result = { code: outCode, map: babelOut.map };\n setCachedTransform(id, code, result, environment, userBabelConfigPath);\n return result;\n }\n }\n }\n return null;\n}\nasync function createVXRNCompilerPlugin(optionsIn) {\n const reactVersion = await (async () => {\n const path = resolvePath(\"react/package.json\");\n const json = JSON.parse(await readFile(path, \"utf-8\"));\n return json.version;\n })();\n const envNames = {\n ios: true,\n android: true,\n client: true,\n ssr: true\n };\n function getEnvName(name) {\n if (name === \"worker\") return \"ssr\";\n if (!envNames[name]) throw new Error(`Invalid env: ${name}`);\n return name;\n }\n const reactForRNVersion = reactVersion.split(\".\")[0];\n const cssTransformCache = /* @__PURE__ */ new Map();\n const rolldownPath = resolvePath(\"rolldown\");\n const rolldownNodeMods = rolldownPath.slice(\n 0,\n rolldownPath.indexOf(sep + \"node_modules\")\n );\n let config;\n return [\n {\n name: \"one:compiler-resolve-refresh-runtime\",\n apply: \"serve\",\n enforce: \"pre\",\n // Run before Vite default resolve to avoid syscalls\n resolveId: (id) => id === runtimePublicPath || id === `${runtimePublicPath}.map` ? id : void 0,\n load: (id) => {\n const basePath = dirname(fileURLToPath(import.meta.url));\n if (id === runtimePublicPath) {\n return readFileSync(join(basePath, \"refresh-runtime.mjs\"), \"utf-8\").replace(\n /\\/\\/# sourceMappingURL=.*/,\n \"\"\n );\n }\n if (id === `${runtimePublicPath}.map`) {\n return JSON.stringify({ version: 3, sources: [], mappings: \"\" });\n }\n return void 0;\n }\n },\n {\n name: `one:compiler-css-to-js`,\n // only .css files can match, so let rust reject everything else\n transform: {\n filter: { id: /\\.css$/ },\n handler(codeIn, id) {\n const environment = getEnvName(this.environment.name);\n if (configuration.enableNativeCSS && (environment === \"ios\" || environment === \"android\")) {\n {\n const data = JSON.stringify(\n cssToReactNativeRuntime(codeIn, { inlineRem: 16 })\n );\n const code = `require(\"nativewind/dist/index.js\").require().StyleSheet.registerCompiled(${data})`;\n const newId = `${id}.js`;\n const cssId = newId.replace(rolldownNodeMods + sep, \"\");\n cssTransformCache.set(cssId, code);\n return {\n code,\n id: newId,\n map: null\n };\n }\n }\n }\n },\n generateBundle(_, bundle) {\n const environment = getEnvName(this.environment.name);\n if (configuration.enableNativeCSS && (environment === \"ios\" || environment === \"android\")) {\n const rootJSName = Object.keys(bundle).find((i) => {\n const chunk = bundle[i];\n return chunk.type == \"chunk\" && chunk.fileName.match(/.[cm]?js(?:\\?.+)?$/) != null;\n });\n if (!rootJSName) {\n throw new Error(`Can't find root js, internal one error`);\n }\n const rootJS = bundle[rootJSName];\n const cssAssets = Object.keys(bundle).filter(\n (i) => bundle[i].fileName.endsWith(\".css.js\")\n );\n for (const name of cssAssets) {\n delete bundle[name];\n const jsCSS = cssTransformCache.get(name);\n rootJS.code = `\n${jsCSS}\n${rootJS.code}\n`;\n }\n }\n }\n },\n {\n name: \"one:compiler\",\n enforce: \"pre\",\n config: () => {\n const nodeModulesFilter = /node_modules[/\\\\].*\\.(tsx?|jsx?|mjs|cjs)$/;\n const createEnvironmentConfig = (environment) => {\n if (!perfStats.optimizeDeps.byEnvironment[environment]) {\n perfStats.optimizeDeps.byEnvironment[environment] = {\n filesChecked: 0,\n filesTransformed: 0,\n startTime: Date.now()\n };\n }\n return {\n optimizeDeps: {\n rolldownOptions: {\n plugins: [\n {\n name: `transform-before-optimize-deps-${environment}`,\n async transform(code, id) {\n if (!nodeModulesFilter.test(id)) {\n return null;\n }\n perfStats.optimizeDeps.byEnvironment[environment].filesChecked++;\n const production = process.env.NODE_ENV === \"production\" || process.env.NODE_ENV === \"test\";\n debug?.(`[rolldown optimizeDeps] ${id}`);\n const result = await performBabelTransform({\n id,\n code,\n projectRoot: config.root,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n });\n if (!result) {\n return null;\n }\n perfStats.optimizeDeps.byEnvironment[environment].filesTransformed++;\n return {\n code: result.code,\n map: result.map\n };\n },\n buildEnd() {\n if (process.env.DEBUG_COMPILER_PERF) {\n const stats = perfStats.optimizeDeps.byEnvironment[environment];\n const elapsed = Date.now() - stats.startTime;\n console.info(\n `[optimizeDeps ${environment}] Done: ${stats.filesChecked} files checked, ${stats.filesTransformed} transformed (${elapsed}ms)`\n );\n }\n const allDone = Object.keys(perfStats.optimizeDeps.byEnvironment).length >= 2;\n if (allDone) {\n logCacheStats();\n logPerfSummary();\n }\n }\n }\n ]\n }\n },\n define: {\n \"process.env.NATIVEWIND_OS\": JSON.stringify(\n environment === \"ios\" || environment === \"android\" ? \"native\" : \"web\"\n )\n }\n };\n };\n return {\n environments: {\n ios: createEnvironmentConfig(\"ios\"),\n android: createEnvironmentConfig(\"android\"),\n client: createEnvironmentConfig(\"client\"),\n ssr: createEnvironmentConfig(\"ssr\")\n }\n };\n },\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n },\n async transform(codeIn, _id) {\n let code = codeIn;\n const environment = getEnvName(this.environment.name);\n const isNative = environment === \"ios\" || environment === \"android\";\n const production = config.command === \"build\" || process.env.NODE_ENV === \"production\" || JSON.parse(\n this.environment.config?.define?.[\"process.env.NODE_ENV\"] || '\"\"'\n ) === \"production\";\n const isEntry = _id.includes(\"one-entry-native\");\n if (isEntry) {\n if (isNative && !production) {\n code = `import '@vxrn/vite-native-client'\n${code}`;\n }\n if (isNative && configuration.enableNativewind) {\n code = `import * as x from 'nativewind'\n${code}`;\n }\n return code;\n }\n const id = _id.split(\"?\")[0];\n const extension = extname(id);\n if (extension === \".css\" || !validParsers.has(extension)) {\n return;\n }\n if (id.includes(`virtual:`)) {\n return;\n }\n if (codeIn.endsWith(`// vxrn-did-babel`)) {\n debug?.(`[skip babel] ${id}`);\n return;\n }\n return performBabelTransform({\n id,\n code: codeIn,\n projectRoot: config.root,\n environment,\n production,\n reactForRNVersion,\n optionsIn\n });\n }\n },\n // wraps client-side TSX/JSX with React Refresh preamble + import.meta.hot.accept\n // runs after vite:oxc (no enforce:'pre') so it sees the already-transformed code\n {\n name: \"one:react-refresh-web\",\n apply: \"serve\",\n transform(code, _id) {\n if (this.environment.name !== \"client\") return;\n if (code.includes(runtimePublicPath)) return;\n if (/[?&](?:worker|sharedworker|raw|url)\\b/.test(_id)) return;\n const id = _id.split(\"?\")[0];\n if (id.includes(\"node_modules\")) return;\n if (id.includes(\"virtual:\")) return;\n if (id === runtimePublicPath) return;\n const ext = extname(id);\n if (ext !== \".tsx\" && ext !== \".jsx\") return;\n const hasRefreshCalls = /\\$RefreshReg\\$\\(/.test(code);\n let out = `import * as RefreshRuntime from \"${runtimePublicPath}\";\n\n`;\n if (hasRefreshCalls) {\n out += `if (!window.$RefreshReg$) throw new Error(\"React refresh preamble was not loaded. Something is wrong.\");\nconst prevRefreshReg = window.$RefreshReg$;\nconst prevRefreshSig = window.$RefreshSig$;\nwindow.$RefreshReg$ = RefreshRuntime.getRefreshReg(\"${id}\");\nwindow.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;\n\n`;\n }\n out += code;\n if (hasRefreshCalls) {\n out += `\n\nwindow.$RefreshReg$ = prevRefreshReg;\nwindow.$RefreshSig$ = prevRefreshSig;\n`;\n }\n out += `\nRefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {\n RefreshRuntime.registerExportsForReactRefresh(\"${id}\", currentExports);\n import.meta.hot.accept((nextExports) => {\n if (!nextExports) return;\n const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(\"${id}\", currentExports, nextExports);\n if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);\n });\n});\n`;\n return { code: out, map: null };\n }\n }\n ];\n}\nexport {\n JS_GLOBALS,\n clearTransformCache,\n createVXRNCompilerPlugin,\n getClosureVariables\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY;CAChB,OAAO;EACL,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,eAAe,CAAC;CAClB;CACA,cAAc,EACZ,eAAe,CAAC,EAClB;AACF;AACA,SAAS,iBAAiB;CACxB,IAAI,CAAC,QAAQ,IAAI,qBAAqB;EACpC;CACF;CACA,QAAQ,KAAK,qCAA4C;CACzD,QAAQ,KACN,UAAU,UAAU,MAAM,gBAAgB,gBAAgB,UAAU,MAAM,WAAW,WAAW,UAAU,MAAM,kBAAkB,KAAK,IAAI,UAAU,MAAM,YAAY,CAAC,IAAI,IAAG,CAAE,QAAQ,CAAC,EAAE,kBAC9L;CACA,QAAQ,KAAK,qBAAqB,UAAU,MAAM,UAAU,GAAG;CAC/D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,MAAM,aAAa,GAAG;EACxE,IAAI,MAAM,aAAa,GAAG;GACxB,QAAQ,KACN,KAAK,IAAI,IAAI,MAAM,WAAW,eAAe,MAAM,KAAK,OAAO,MAAM,OAAO,MAAM,WAAU,CAAE,QAAQ,CAAC,EAAE,QAC3G;EACF;CACF;CACA,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,aAAa,aAAa,GAAG;EAC/E,MAAM,UAAU,KAAK,IAAI,IAAI,MAAM;EACnC,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5B,IAAI,cAAc,UAAU,CAAC,aAAa,IAAI,SAAS,GAAG;KACxD;IACF;IACA,IAAI,GAAG,SAAS,UAAU,GAAG;KAC3B;IACF;IACA,IAAI,OAAO,SAAS,mBAAmB,GAAG;KACxC,QAAQ,gBAAgB,IAAI;KAC5B;IACF;IACA,OAAO,sBAAsB;KAC3B;KACA,MAAM;KACN,aAAa,OAAO;KACpB;KACA;KACA;KACA;IACF,CAAC;GACH;EACF;EAGA;GACE,MAAM;GACN,OAAO;GACP,UAAU,MAAM,KAAK;IACnB,IAAI,KAAK,YAAY,SAAS,UAAU;IACxC,IAAI,KAAK,SAAS,iBAAiB,GAAG;IACtC,IAAI,wCAAwC,KAAK,GAAG,GAAG;IACvD,MAAM,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC;IAC1B,IAAI,GAAG,SAAS,cAAc,GAAG;IACjC,IAAI,GAAG,SAAS,UAAU,GAAG;IAC7B,IAAI,OAAO,mBAAmB;IAC9B,MAAM,MAAM,QAAQ,EAAE;IACtB,IAAI,QAAQ,UAAU,QAAQ,QAAQ;IACtC,MAAM,kBAAkB,mBAAmB,KAAK,IAAI;IACpD,IAAI,MAAM,oCAAoC,kBAAkB;;;IAGhE,IAAI,iBAAiB;KACnB,OAAO;;;sDAGqC,GAAG;;;;IAIjD;IACA,OAAO;IACP,IAAI,iBAAiB;KACnB,OAAO;;;;;IAKT;IACA,OAAO;;mDAEoC,GAAG;;;wFAGkC,GAAG;;;;;IAKnF,OAAO;KAAE,MAAM;KAAK,KAAK;IAAK;GAChC;EACF;CACF;AACF"}
@@ -31,6 +31,8 @@ export * from "./transformHermesAsync.mjs"
31
31
 
32
32
  export * from "./transformHermesClasses.mjs"
33
33
 
34
+ export * from "./transformMixedNativeModule.mjs"
35
+
34
36
  const perfStats = {
35
37
  babel: {
36
38
  totalCalls: 0,