@vxrn/compiler 1.12.3 → 1.12.5
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/dist/cjs/index.cjs +1 -1
- package/dist/esm/index.js +181 -188
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/dist/cjs/cache.js +0 -86
- package/dist/cjs/cache.js.map +0 -6
- package/dist/cjs/configure.js +0 -30
- package/dist/cjs/configure.js.map +0 -6
- package/dist/cjs/constants.js +0 -56
- package/dist/cjs/constants.js.map +0 -6
- package/dist/cjs/index.js +0 -297
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/refresh-runtime.js +0 -300
- package/dist/cjs/refresh-runtime.js.map +0 -6
- package/dist/cjs/transformBabel.js +0 -153
- package/dist/cjs/transformBabel.js.map +0 -6
- package/dist/cjs/transformSWC.js +0 -256
- package/dist/cjs/transformSWC.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/esm/cache.js +0 -73
- package/dist/esm/cache.js.map +0 -6
- package/dist/esm/configure.js +0 -14
- package/dist/esm/configure.js.map +0 -6
- package/dist/esm/constants.js +0 -40
- package/dist/esm/constants.js.map +0 -6
- package/dist/esm/refresh-runtime.js +0 -284
- package/dist/esm/refresh-runtime.js.map +0 -6
- package/dist/esm/transformBabel.js +0 -133
- package/dist/esm/transformBabel.js.map +0 -6
- package/dist/esm/transformSWC.js +0 -246
- package/dist/esm/transformSWC.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var refresh_runtime_exports = {};
|
|
16
|
-
__export(refresh_runtime_exports, {
|
|
17
|
-
__hmr_import: () => __hmr_import,
|
|
18
|
-
createSignatureFunctionForTransform: () => createSignatureFunctionForTransform,
|
|
19
|
-
default: () => refresh_runtime_default,
|
|
20
|
-
getRefreshReg: () => getRefreshReg,
|
|
21
|
-
injectIntoGlobalHook: () => injectIntoGlobalHook,
|
|
22
|
-
registerExportsForReactRefresh: () => registerExportsForReactRefresh,
|
|
23
|
-
validateRefreshBoundaryAndEnqueueUpdate: () => validateRefreshBoundaryAndEnqueueUpdate
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(refresh_runtime_exports);
|
|
26
|
-
/*! Copyright (c) Meta Platforms, Inc. and affiliates. **/
|
|
27
|
-
const REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
28
|
-
let allFamiliesByID = /* @__PURE__ */ new Map(), allFamiliesByType = /* @__PURE__ */ new WeakMap(), allSignaturesByType = /* @__PURE__ */ new WeakMap();
|
|
29
|
-
const updatedFamiliesByType = /* @__PURE__ */ new WeakMap();
|
|
30
|
-
let pendingUpdates = [];
|
|
31
|
-
const helpersByRendererID = /* @__PURE__ */ new Map(), helpersByRoot = /* @__PURE__ */ new Map(), mountedRoots = /* @__PURE__ */ new Set(), failedRoots = /* @__PURE__ */ new Set();
|
|
32
|
-
let rootElements = /* @__PURE__ */ new WeakMap(), isPerformingRefresh = !1;
|
|
33
|
-
function computeFullKey(signature) {
|
|
34
|
-
if (signature.fullKey !== null)
|
|
35
|
-
return signature.fullKey;
|
|
36
|
-
let fullKey = signature.ownKey, hooks2;
|
|
37
|
-
try {
|
|
38
|
-
hooks2 = signature.getCustomHooks();
|
|
39
|
-
} catch {
|
|
40
|
-
return signature.forceReset = !0, signature.fullKey = fullKey, fullKey;
|
|
41
|
-
}
|
|
42
|
-
for (let i = 0; i < hooks2.length; i++) {
|
|
43
|
-
const hook = hooks2[i];
|
|
44
|
-
if (typeof hook != "function")
|
|
45
|
-
return signature.forceReset = !0, signature.fullKey = fullKey, fullKey;
|
|
46
|
-
const nestedHookSignature = allSignaturesByType.get(hook);
|
|
47
|
-
if (nestedHookSignature === void 0)
|
|
48
|
-
continue;
|
|
49
|
-
const nestedHookKey = computeFullKey(nestedHookSignature);
|
|
50
|
-
nestedHookSignature.forceReset && (signature.forceReset = !0), fullKey += `
|
|
51
|
-
---
|
|
52
|
-
` + nestedHookKey;
|
|
53
|
-
}
|
|
54
|
-
return signature.fullKey = fullKey, fullKey;
|
|
55
|
-
}
|
|
56
|
-
function haveEqualSignatures(prevType, nextType) {
|
|
57
|
-
const prevSignature = allSignaturesByType.get(prevType), nextSignature = allSignaturesByType.get(nextType);
|
|
58
|
-
return prevSignature === void 0 && nextSignature === void 0 ? !0 : !(prevSignature === void 0 || nextSignature === void 0 || computeFullKey(prevSignature) !== computeFullKey(nextSignature) || nextSignature.forceReset);
|
|
59
|
-
}
|
|
60
|
-
function isReactClass(type) {
|
|
61
|
-
return type.prototype && type.prototype.isReactComponent;
|
|
62
|
-
}
|
|
63
|
-
function canPreserveStateBetween(prevType, nextType) {
|
|
64
|
-
return isReactClass(prevType) || isReactClass(nextType) ? !1 : !!haveEqualSignatures(prevType, nextType);
|
|
65
|
-
}
|
|
66
|
-
function resolveFamily(type) {
|
|
67
|
-
return updatedFamiliesByType.get(type);
|
|
68
|
-
}
|
|
69
|
-
function getProperty(object, property) {
|
|
70
|
-
try {
|
|
71
|
-
return object[property];
|
|
72
|
-
} catch {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function performReactRefresh() {
|
|
77
|
-
if (pendingUpdates.length === 0 || isPerformingRefresh)
|
|
78
|
-
return null;
|
|
79
|
-
isPerformingRefresh = !0;
|
|
80
|
-
try {
|
|
81
|
-
const staleFamilies = /* @__PURE__ */ new Set(), updatedFamilies = /* @__PURE__ */ new Set(), updates = pendingUpdates;
|
|
82
|
-
pendingUpdates = [], updates.forEach(([family, nextType]) => {
|
|
83
|
-
const prevType = family.current;
|
|
84
|
-
updatedFamiliesByType.set(prevType, family), updatedFamiliesByType.set(nextType, family), family.current = nextType, canPreserveStateBetween(prevType, nextType) ? updatedFamilies.add(family) : staleFamilies.add(family);
|
|
85
|
-
});
|
|
86
|
-
const update = {
|
|
87
|
-
updatedFamilies,
|
|
88
|
-
// Families that will re-render preserving state
|
|
89
|
-
staleFamilies
|
|
90
|
-
// Families that will be remounted
|
|
91
|
-
};
|
|
92
|
-
helpersByRendererID.forEach((helpers) => {
|
|
93
|
-
helpers.setRefreshHandler(resolveFamily);
|
|
94
|
-
});
|
|
95
|
-
let didError = !1, firstError = null;
|
|
96
|
-
const failedRootsSnapshot = new Set(failedRoots), mountedRootsSnapshot = new Set(mountedRoots), helpersByRootSnapshot = new Map(helpersByRoot);
|
|
97
|
-
if (failedRootsSnapshot.forEach((root) => {
|
|
98
|
-
const helpers = helpersByRootSnapshot.get(root);
|
|
99
|
-
if (helpers === void 0)
|
|
100
|
-
throw new Error(
|
|
101
|
-
"Could not find helpers for a root. This is a bug in React Refresh."
|
|
102
|
-
);
|
|
103
|
-
if (failedRoots.has(root), rootElements === null || !rootElements.has(root))
|
|
104
|
-
return;
|
|
105
|
-
const element = rootElements.get(root);
|
|
106
|
-
try {
|
|
107
|
-
helpers.scheduleRoot(root, element);
|
|
108
|
-
} catch (err) {
|
|
109
|
-
didError || (didError = !0, firstError = err);
|
|
110
|
-
}
|
|
111
|
-
}), mountedRootsSnapshot.forEach((root) => {
|
|
112
|
-
const helpers = helpersByRootSnapshot.get(root);
|
|
113
|
-
if (helpers === void 0)
|
|
114
|
-
throw new Error(
|
|
115
|
-
"Could not find helpers for a root. This is a bug in React Refresh."
|
|
116
|
-
);
|
|
117
|
-
mountedRoots.has(root);
|
|
118
|
-
try {
|
|
119
|
-
helpers.scheduleRefresh(root, update);
|
|
120
|
-
} catch (err) {
|
|
121
|
-
didError || (didError = !0, firstError = err);
|
|
122
|
-
}
|
|
123
|
-
}), didError)
|
|
124
|
-
throw firstError;
|
|
125
|
-
return update;
|
|
126
|
-
} finally {
|
|
127
|
-
isPerformingRefresh = !1;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function register(type, id) {
|
|
131
|
-
if (type === null || typeof type != "function" && typeof type != "object" || allFamiliesByType.has(type))
|
|
132
|
-
return;
|
|
133
|
-
let family = allFamiliesByID.get(id);
|
|
134
|
-
if (family === void 0 ? (family = { current: type }, allFamiliesByID.set(id, family)) : pendingUpdates.push([family, type]), allFamiliesByType.set(type, family), typeof type == "object" && type !== null)
|
|
135
|
-
switch (getProperty(type, "$$typeof")) {
|
|
136
|
-
case REACT_FORWARD_REF_TYPE:
|
|
137
|
-
register(type.render, id + "$render");
|
|
138
|
-
break;
|
|
139
|
-
case REACT_MEMO_TYPE:
|
|
140
|
-
register(type.type, id + "$type");
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function setSignature(type, key, forceReset, getCustomHooks) {
|
|
145
|
-
if (allSignaturesByType.has(type) || allSignaturesByType.set(type, {
|
|
146
|
-
forceReset,
|
|
147
|
-
ownKey: key,
|
|
148
|
-
fullKey: null,
|
|
149
|
-
getCustomHooks: getCustomHooks || (() => [])
|
|
150
|
-
}), typeof type == "object" && type !== null)
|
|
151
|
-
switch (getProperty(type, "$$typeof")) {
|
|
152
|
-
case REACT_FORWARD_REF_TYPE:
|
|
153
|
-
setSignature(type.render, key, forceReset, getCustomHooks);
|
|
154
|
-
break;
|
|
155
|
-
case REACT_MEMO_TYPE:
|
|
156
|
-
setSignature(type.type, key, forceReset, getCustomHooks);
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function collectCustomHooksForSignature(type) {
|
|
161
|
-
const signature = allSignaturesByType.get(type);
|
|
162
|
-
signature !== void 0 && computeFullKey(signature);
|
|
163
|
-
}
|
|
164
|
-
function injectIntoGlobalHook(globalObject) {
|
|
165
|
-
let hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
166
|
-
if (hook === void 0) {
|
|
167
|
-
let nextID = 0;
|
|
168
|
-
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
|
|
169
|
-
renderers: /* @__PURE__ */ new Map(),
|
|
170
|
-
supportsFiber: !0,
|
|
171
|
-
inject: (injected) => nextID++,
|
|
172
|
-
onScheduleFiberRoot: (id, root, children) => {
|
|
173
|
-
},
|
|
174
|
-
onCommitFiberRoot: (id, root, maybePriorityLevel, didError) => {
|
|
175
|
-
},
|
|
176
|
-
onCommitFiberUnmount() {
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
if (hook.isDisabled) {
|
|
181
|
-
console.warn(
|
|
182
|
-
"Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled."
|
|
183
|
-
);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const oldInject = hook.inject;
|
|
187
|
-
hook.inject = function(injected) {
|
|
188
|
-
const id = oldInject.apply(this, arguments);
|
|
189
|
-
return typeof injected.scheduleRefresh == "function" && typeof injected.setRefreshHandler == "function" && helpersByRendererID.set(id, injected), id;
|
|
190
|
-
}, hook.renderers.forEach((injected, id) => {
|
|
191
|
-
typeof injected.scheduleRefresh == "function" && typeof injected.setRefreshHandler == "function" && helpersByRendererID.set(id, injected);
|
|
192
|
-
});
|
|
193
|
-
const oldOnCommitFiberRoot = hook.onCommitFiberRoot, oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || (() => {
|
|
194
|
-
});
|
|
195
|
-
hook.onScheduleFiberRoot = function(id, root, children) {
|
|
196
|
-
return isPerformingRefresh || (failedRoots.delete(root), rootElements !== null && rootElements.set(root, children)), oldOnScheduleFiberRoot.apply(this, arguments);
|
|
197
|
-
}, hook.onCommitFiberRoot = function(id, root, maybePriorityLevel, didError) {
|
|
198
|
-
const helpers = helpersByRendererID.get(id);
|
|
199
|
-
if (helpers !== void 0) {
|
|
200
|
-
helpersByRoot.set(root, helpers);
|
|
201
|
-
const current = root.current, alternate = current.alternate;
|
|
202
|
-
if (alternate !== null) {
|
|
203
|
-
const wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root), isMounted = current.memoizedState != null && current.memoizedState.element != null;
|
|
204
|
-
!wasMounted && isMounted ? (mountedRoots.add(root), failedRoots.delete(root)) : wasMounted && isMounted || (wasMounted && !isMounted ? (mountedRoots.delete(root), didError ? failedRoots.add(root) : helpersByRoot.delete(root)) : !wasMounted && !isMounted && didError && failedRoots.add(root));
|
|
205
|
-
} else
|
|
206
|
-
mountedRoots.add(root);
|
|
207
|
-
}
|
|
208
|
-
return oldOnCommitFiberRoot.apply(this, arguments);
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function createSignatureFunctionForTransform() {
|
|
212
|
-
let savedType, hasCustomHooks, didCollectHooks = !1;
|
|
213
|
-
return (type, key, forceReset, getCustomHooks) => {
|
|
214
|
-
if (typeof key == "string")
|
|
215
|
-
return savedType || (savedType = type, hasCustomHooks = typeof getCustomHooks == "function"), type != null && (typeof type == "function" || typeof type == "object") && setSignature(type, key, forceReset, getCustomHooks), type;
|
|
216
|
-
!didCollectHooks && hasCustomHooks && (didCollectHooks = !0, collectCustomHooksForSignature(savedType));
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
function isLikelyComponentType(type) {
|
|
220
|
-
switch (typeof type) {
|
|
221
|
-
case "function": {
|
|
222
|
-
if (type.prototype != null) {
|
|
223
|
-
if (type.prototype.isReactComponent)
|
|
224
|
-
return !0;
|
|
225
|
-
const ownNames = Object.getOwnPropertyNames(type.prototype);
|
|
226
|
-
if (ownNames.length > 1 || ownNames[0] !== "constructor" || type.prototype.__proto__ !== Object.prototype)
|
|
227
|
-
return !1;
|
|
228
|
-
}
|
|
229
|
-
const name = type.name || type.displayName;
|
|
230
|
-
return typeof name == "string" && /^[A-Z]/.test(name);
|
|
231
|
-
}
|
|
232
|
-
case "object": {
|
|
233
|
-
if (type != null)
|
|
234
|
-
switch (getProperty(type, "$$typeof")) {
|
|
235
|
-
case REACT_FORWARD_REF_TYPE:
|
|
236
|
-
case REACT_MEMO_TYPE:
|
|
237
|
-
return !0;
|
|
238
|
-
default:
|
|
239
|
-
return !1;
|
|
240
|
-
}
|
|
241
|
-
return !1;
|
|
242
|
-
}
|
|
243
|
-
default:
|
|
244
|
-
return !1;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
function getRefreshReg(filename) {
|
|
248
|
-
return (type, id) => register(type, filename + " " + id);
|
|
249
|
-
}
|
|
250
|
-
function registerExportsForReactRefresh(filename, moduleExports) {
|
|
251
|
-
for (const key in moduleExports) {
|
|
252
|
-
if (key === "__esModule") continue;
|
|
253
|
-
const exportValue = moduleExports[key];
|
|
254
|
-
isLikelyComponentType(exportValue) && register(exportValue, filename + " export " + key);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
function debounce(fn, delay) {
|
|
258
|
-
let handle;
|
|
259
|
-
return () => {
|
|
260
|
-
clearTimeout(handle), handle = setTimeout(fn, delay);
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
const hooks = [];
|
|
264
|
-
window.__registerBeforePerformReactRefresh = (cb) => {
|
|
265
|
-
hooks.push(cb);
|
|
266
|
-
};
|
|
267
|
-
const enqueueUpdate = debounce(async () => {
|
|
268
|
-
hooks.length && await Promise.all(hooks.map((cb) => cb())), performReactRefresh();
|
|
269
|
-
}, 16);
|
|
270
|
-
function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) {
|
|
271
|
-
const ignoredExports = ["sitemap", "loader", "generateStaticParams"];
|
|
272
|
-
if (predicateOnExport(ignoredExports, prevExports, (key) => key in nextExports) !== !0)
|
|
273
|
-
return "Could not Fast Refresh (export removed)";
|
|
274
|
-
if (predicateOnExport(ignoredExports, nextExports, (key) => key in prevExports) !== !0)
|
|
275
|
-
return "Could not Fast Refresh (new export)";
|
|
276
|
-
let hasExports = !1;
|
|
277
|
-
const allExportsAreComponentsOrUnchanged = predicateOnExport(
|
|
278
|
-
ignoredExports,
|
|
279
|
-
nextExports,
|
|
280
|
-
(key, value) => (hasExports = !0, isLikelyComponentType(value) ? !0 : prevExports[key] === nextExports[key])
|
|
281
|
-
);
|
|
282
|
-
if (hasExports && allExportsAreComponentsOrUnchanged === !0)
|
|
283
|
-
enqueueUpdate();
|
|
284
|
-
else
|
|
285
|
-
return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react-swc#consistent-components-exports`;
|
|
286
|
-
}
|
|
287
|
-
function predicateOnExport(ignoredExports, moduleExports, predicate) {
|
|
288
|
-
for (const key in moduleExports) {
|
|
289
|
-
if (key === "__esModule" || ignoredExports.includes(key)) continue;
|
|
290
|
-
const desc = Object.getOwnPropertyDescriptor(moduleExports, key);
|
|
291
|
-
if (desc && desc.get || !predicate(key, moduleExports[key])) return key;
|
|
292
|
-
}
|
|
293
|
-
return !0;
|
|
294
|
-
}
|
|
295
|
-
const __hmr_import = (module2) => import(
|
|
296
|
-
/* @vite-ignore */
|
|
297
|
-
module2
|
|
298
|
-
);
|
|
299
|
-
var refresh_runtime_default = { injectIntoGlobalHook };
|
|
300
|
-
//# sourceMappingURL=refresh-runtime.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/refresh-runtime.js"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAM,yBAAyB,OAAO,IAAI,mBAAmB,GACvD,kBAAkB,OAAO,IAAI,YAAY;AAI/C,IAAI,kBAAkB,oBAAI,IAAI,GAC1B,oBAAoB,oBAAI,QAAQ,GAChC,sBAAsB,oBAAI,QAAQ;AAItC,MAAM,wBAAwB,oBAAI,QAAQ;AAI1C,IAAI,iBAAiB,CAAC;AAGtB,MAAM,sBAAsB,oBAAI,IAAI,GAE9B,gBAAgB,oBAAI,IAAI,GAGxB,eAAe,oBAAI,IAAI,GAEvB,cAAc,oBAAI,IAAI;AAK5B,IAAI,eAAe,oBAAI,QAAQ,GAC3B,sBAAsB;AAE1B,SAAS,eAAe,WAAW;AACjC,MAAI,UAAU,YAAY;AACxB,WAAO,UAAU;AAGnB,MAAI,UAAU,UAAU,QACpBA;AACJ,MAAI;AACF,IAAAA,SAAQ,UAAU,eAAe;AAAA,EACnC,QAAc;AAIZ,qBAAU,aAAa,IACvB,UAAU,UAAU,SACb;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAIA,OAAM,QAAQ,KAAK;AACrC,UAAM,OAAOA,OAAM,CAAC;AACpB,QAAI,OAAO,QAAS;AAElB,uBAAU,aAAa,IACvB,UAAU,UAAU,SACb;AAET,UAAM,sBAAsB,oBAAoB,IAAI,IAAI;AACxD,QAAI,wBAAwB;AAG1B;AAEF,UAAM,gBAAgB,eAAe,mBAAmB;AACxD,IAAI,oBAAoB,eACtB,UAAU,aAAa,KAEzB,WAAW;AAAA;AAAA,IAAY;AAAA,EACzB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EAAE,qBAAqB;",
|
|
5
|
-
"names": ["hooks", "module"]
|
|
6
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
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, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var transformBabel_exports = {};
|
|
24
|
-
__export(transformBabel_exports, {
|
|
25
|
-
getBabelOptions: () => getBabelOptions,
|
|
26
|
-
transformBabel: () => transformBabel
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(transformBabel_exports);
|
|
29
|
-
var import_node_path = require("node:path"), import_core = __toESM(require("@babel/core"), 1), import_utils = require("@vxrn/utils"), import_configure = require("./configure"), import_constants = require("./constants");
|
|
30
|
-
function getBabelOptions(props) {
|
|
31
|
-
return props.userSetting === "babel" ? getOptions(props, !0) : typeof props.userSetting > "u" || typeof props.userSetting == "object" && props.userSetting.transform === "babel" ? props.userSetting?.excludeDefaultPlugins ? props.userSetting : getOptions(props) : null;
|
|
32
|
-
}
|
|
33
|
-
const getOptions = (props, force = !1) => {
|
|
34
|
-
let plugins = [];
|
|
35
|
-
(force || shouldBabelGenerators(props)) && (plugins = getBasePlugins(props));
|
|
36
|
-
const enableNativewind = import_configure.configuration.enableNativewind && (props.environment === "ios" || props.environment === "android") && // if reanimated gets wrapped in transform it causes circular dep issues
|
|
37
|
-
!/node_modules/.test(props.id) && // only needed for createElement calls, so be a bit conservative
|
|
38
|
-
props.code.includes("createElement");
|
|
39
|
-
return enableNativewind && (props.id.includes("node_modules") || plugins.push((0, import_utils.resolvePath)("react-native-css-interop/dist/babel-plugin.js"))), (enableNativewind || shouldBabelReanimated(props)) && ((0, import_constants.debug)?.(`Using babel reanimated on file ${props.id}`), plugins.push(
|
|
40
|
-
// TODO make this configurable
|
|
41
|
-
process.env.VXRN_WORKLET_PLUGIN ? "react-native-worklets/plugin" : "react-native-reanimated/plugin"
|
|
42
|
-
)), shouldBabelReactCompiler(props) && ((0, import_constants.debug)?.("Using babel react compiler on file"), plugins.push(getBabelReactCompilerPlugin(props))), shouldBabelReactNativeCodegen(props) && ((0, import_constants.debug)?.("Using babel @react-native/babel-plugin-codegen on file"), plugins.push("@react-native/babel-plugin-codegen")), plugins.length ? { plugins } : null;
|
|
43
|
-
};
|
|
44
|
-
async function transformBabel(id, code, options) {
|
|
45
|
-
const extension = (0, import_node_path.extname)(id), isTSX = extension === ".tsx", babelOptions = {
|
|
46
|
-
filename: id,
|
|
47
|
-
compact: !1,
|
|
48
|
-
babelrc: !1,
|
|
49
|
-
configFile: !1,
|
|
50
|
-
sourceMaps: !1,
|
|
51
|
-
minified: !1,
|
|
52
|
-
...options,
|
|
53
|
-
presets: [
|
|
54
|
-
isTSX || extension === ".ts" ? [
|
|
55
|
-
"@babel/preset-typescript",
|
|
56
|
-
{
|
|
57
|
-
isTSX,
|
|
58
|
-
allExtensions: isTSX
|
|
59
|
-
}
|
|
60
|
-
] : "",
|
|
61
|
-
...options.presets || []
|
|
62
|
-
].filter(Boolean)
|
|
63
|
-
};
|
|
64
|
-
try {
|
|
65
|
-
return await new Promise((res, rej) => {
|
|
66
|
-
import_core.default.transform(code, babelOptions, (err, result) => {
|
|
67
|
-
if (!result || err)
|
|
68
|
-
return rej(err || "no res");
|
|
69
|
-
res(result);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
} catch (err) {
|
|
73
|
-
console.error(
|
|
74
|
-
"[vxrn:compiler] babel transform error",
|
|
75
|
-
err,
|
|
76
|
-
"with options",
|
|
77
|
-
babelOptions
|
|
78
|
-
), console.error("code", code), console.error("id", id);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const getBasePlugins = ({ development }) => [
|
|
82
|
-
["@babel/plugin-transform-destructuring"],
|
|
83
|
-
["@babel/plugin-transform-react-jsx", { development }],
|
|
84
|
-
["@babel/plugin-transform-async-generator-functions"],
|
|
85
|
-
["@babel/plugin-transform-async-to-generator"],
|
|
86
|
-
[
|
|
87
|
-
"@babel/plugin-transform-runtime",
|
|
88
|
-
{
|
|
89
|
-
helpers: !0,
|
|
90
|
-
// NOTE THIS WAS SPELLED WRONG BEFOER THIS COMMIT MAYBE IT WAS UNINTENTIONALLY WORKING
|
|
91
|
-
regenerator: !1
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
], NATIVE_COMPONENT_RE = /NativeComponent\.[jt]sx?$/, SPEC_FILE_RE = /[/\\]specs?[/\\]/, shouldBabelReactNativeCodegen = ({ id, environment }) => (environment === "ios" || environment === "android") && (NATIVE_COMPONENT_RE.test(id) || SPEC_FILE_RE.test(id)), shouldBabelReactCompiler = (props) => {
|
|
95
|
-
if (props.environment === "ssr" || !import_configure.configuration.enableCompiler)
|
|
96
|
-
return !1;
|
|
97
|
-
const { enableCompiler } = import_configure.configuration;
|
|
98
|
-
if (typeof enableCompiler == "object" && !Array.isArray(enableCompiler) && !(enableCompiler instanceof RegExp)) {
|
|
99
|
-
const filter = props.environment === "ios" || props.environment === "android" ? enableCompiler.native : enableCompiler.web;
|
|
100
|
-
return filter ? applyCompilerFilter(filter, props) : !1;
|
|
101
|
-
}
|
|
102
|
-
return typeof enableCompiler == "function" ? enableCompiler(props.id, props.environment) : enableCompiler instanceof RegExp ? enableCompiler.test(props.id) : Array.isArray(enableCompiler) && !enableCompiler.includes(props.environment) ? !1 : applyDefaultFilters(props);
|
|
103
|
-
};
|
|
104
|
-
function applyCompilerFilter(filter, props) {
|
|
105
|
-
return typeof filter == "function" ? filter(props.id, props.environment) : filter instanceof RegExp ? filter.test(props.id) : filter === !0 ? applyDefaultFilters(props) : !1;
|
|
106
|
-
}
|
|
107
|
-
function applyDefaultFilters(props) {
|
|
108
|
-
return !(!/(\.tsx?)$/.test(props.id) || props.id.includes("node_modules") || props.id.includes("+api.") || props.code.startsWith("// disable-compiler"));
|
|
109
|
-
}
|
|
110
|
-
const getBabelReactCompilerPlugin = (props) => ["babel-plugin-react-compiler", { target: props.reactForRNVersion === "18" && (props.environment === "ios" || props.environment === "android") ? "18" : "19" }];
|
|
111
|
-
function shouldBabelGenerators({ code }) {
|
|
112
|
-
if (process.env.VXRN_USE_BABEL_FOR_GENERATORS)
|
|
113
|
-
return import_constants.asyncGeneratorRegex.test(code);
|
|
114
|
-
}
|
|
115
|
-
const REANIMATED_AUTOWORKLETIZATION_KEYWORDS = [
|
|
116
|
-
"worklet",
|
|
117
|
-
"useAnimatedGestureHandler",
|
|
118
|
-
"useAnimatedScrollHandler",
|
|
119
|
-
"useFrameCallback",
|
|
120
|
-
"useAnimatedStyle",
|
|
121
|
-
"useAnimatedProps",
|
|
122
|
-
"createAnimatedPropAdapter",
|
|
123
|
-
"useDerivedValue",
|
|
124
|
-
"useAnimatedReaction",
|
|
125
|
-
"useWorkletCallback",
|
|
126
|
-
"withTiming",
|
|
127
|
-
"withSpring",
|
|
128
|
-
"withDecay",
|
|
129
|
-
"withRepeat",
|
|
130
|
-
"runOnUI",
|
|
131
|
-
"executeOnUIRuntimeSync"
|
|
132
|
-
], REANIMATED_REGEX = new RegExp(REANIMATED_AUTOWORKLETIZATION_KEYWORDS.join("|")), REANIMATED_IGNORED_PATHS = [
|
|
133
|
-
// Prebuilt/vendored react-native that shouldn't be transformed
|
|
134
|
-
"react-native-prebuilt",
|
|
135
|
-
"node_modules/.vxrn/react-native",
|
|
136
|
-
// Known false positives - they mention worklet keywords in comments/strings but don't use them
|
|
137
|
-
"node_modules/react/",
|
|
138
|
-
"node_modules/react-dom/",
|
|
139
|
-
"node_modules/react-native/",
|
|
140
|
-
"node_modules/react-native-web/"
|
|
141
|
-
], REANIMATED_IGNORED_PATHS_REGEX = new RegExp(
|
|
142
|
-
REANIMATED_IGNORED_PATHS.map((s) => s.replace(/\//g, "/")).join("|")
|
|
143
|
-
);
|
|
144
|
-
function shouldBabelReanimated({ code, id }) {
|
|
145
|
-
if (!import_configure.configuration.enableReanimated || REANIMATED_IGNORED_PATHS_REGEX.test(id))
|
|
146
|
-
return !1;
|
|
147
|
-
if (REANIMATED_REGEX.test(code)) {
|
|
148
|
-
const location = id.includes("node_modules") ? "node_modules" : "user-code";
|
|
149
|
-
return (0, import_constants.debug)?.(` \u{1FA84} [reanimated/${location}] ${(0, import_node_path.relative)(process.cwd(), id)}`), !0;
|
|
150
|
-
}
|
|
151
|
-
return !1;
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=transformBabel.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/transformBabel.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;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