@vxrn/react-native-prebuilt 1.25.5 → 1.25.7

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.
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: () => from[key],
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var import_vitest = require("vitest");
28
+ var import_index = require("./index.native.js");
29
+ (0, import_vitest.describe)("RExports", function () {
30
+ (0, import_vitest.it)("should contain all keys that the `react` package exports", async function () {
31
+ var React = (await import("react")).default;
32
+ for (var key in React) {
33
+ (0, import_vitest.expect)(import_index.RExports).toContain(key);
34
+ }
35
+ });
36
+ });
37
+ //# sourceMappingURL=index.test.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["import_vitest","require","import_index","describe","it","React","default","key","expect","RExports","toContain"],"sources":["../../src/index.test.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;gBAAA;AAEA,IAAAA,aAAA,GAAyBC,OAAA;AAAA,IAEzBC,YAAA,GAAAD,OAAA,oBAAS;AACP,IAAAD,aAAA,CAAAG,QAAG;EACD,IAAAH,aAAe,CAAAI,EAAA,4DAAuB;IAEtC,IAAAC,KAAA,GAAW,OAAO,MAAO,WAAAC,OAAA;IACvB,SAAAC,GAAA,IAAAF,KAAA;MACF,IAAAL,aAAA,CAAAQ,MAAA,EAAAN,YAAA,CAAAO,QAAA,EAAAC,SAAA,CAAAH,GAAA;IACD;EACF","ignoreList":[]}
@@ -0,0 +1,255 @@
1
+ import { mustReplace } from "@vxrn/utils";
2
+ import { transformFlowBabel } from "@vxrn/vite-flow";
3
+ import { build } from "esbuild";
4
+ import FSExtra from "fs-extra";
5
+ import { readFile } from "node:fs/promises";
6
+ import { createRequire } from "node:module";
7
+ const requireResolve = "url" in import.meta ? createRequire(import.meta.url).resolve : require.resolve;
8
+ const external = ["react", "react/jsx-runtime", "react/jsx-dev-runtime"];
9
+ async function buildReactJSX(options = {}) {
10
+ const isProd = options.define?.["__DEV__"] === "false";
11
+ return build({
12
+ bundle: true,
13
+ entryPoints: [requireResolve("react/jsx-dev-runtime")],
14
+ format: "cjs",
15
+ target: "node16",
16
+ jsx: "transform",
17
+ jsxFactory: "react",
18
+ allowOverwrite: true,
19
+ platform: "node",
20
+ define: {
21
+ __DEV__: "true",
22
+ "process.env.NODE_ENV": `"development"`
23
+ },
24
+ external,
25
+ logLevel: "warning",
26
+ ...options
27
+ }).then(async () => {
28
+ const bundled = await readFile(options.outfile, "utf-8");
29
+ const outCode = `
30
+ const run = () => {
31
+ ${mustReplace(bundled, [...(isProd ? [{
32
+ // react 18 and 19 (18 has _min)
33
+ find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
34
+ replace: `return require_react_jsx_runtime_production$1();`
35
+ }] : [{
36
+ find: `module.exports = require_react_jsx_dev_runtime_development();`,
37
+ replace: `return require_react_jsx_dev_runtime_development();`
38
+ }]), {
39
+ find: `process.env.VXRN_REACT_19`,
40
+ replace: "false",
41
+ optional: true
42
+ }, {
43
+ find: `Object.assign(exports, eval("require('@vxrn/vendor/react-jsx-19')"));`,
44
+ optional: true,
45
+ replace: ``
46
+ }])}
47
+ }
48
+ const __mod__ = run()
49
+ ${["jsx", "jsxs", "jsxDEV", "Fragment"].map(n => `export const ${n} = __mod__.${n} || __mod__.jsx || ${(() => {
50
+ if (n === "jsxs") {
51
+ return "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }";
52
+ }
53
+ return "__mod__.jsxDEV";
54
+ })()}`).join("\n")}
55
+ `;
56
+ await FSExtra.writeFile(options.outfile, outCode);
57
+ });
58
+ }
59
+ async function buildReact(options = {}) {
60
+ const isProd = options.define?.["__DEV__"] === "false";
61
+ return build({
62
+ bundle: true,
63
+ entryPoints: [requireResolve("react")],
64
+ format: "cjs",
65
+ target: "node16",
66
+ jsx: "transform",
67
+ jsxFactory: "react",
68
+ allowOverwrite: true,
69
+ platform: "node",
70
+ define: {
71
+ __DEV__: "true",
72
+ "process.env.NODE_ENV": `"development"`
73
+ },
74
+ logLevel: "warning",
75
+ external,
76
+ ...options
77
+ }).then(async () => {
78
+ const bundled = await readFile(options.outfile, "utf-8");
79
+ const outCode = `
80
+ const run = () => {
81
+ ${mustReplace(bundled, [isProd ? {
82
+ find: /module\.exports = require_react_production([a-z_]*)\(\);/,
83
+ replace: "return require_react_production$1();"
84
+ } : {
85
+ find: /module\.exports = require_react_development([a-z_]*)\(\);/,
86
+ replace: "return require_react_development$1();"
87
+ }, {
88
+ find: `process.env.VXRN_REACT_19`,
89
+ optional: true,
90
+ replace: "false"
91
+ }, {
92
+ find: `Object.assign(exports, eval("require('@vxrn/vendor/react-19')"));`,
93
+ optional: true,
94
+ replace: ``
95
+ }])}
96
+ }
97
+ const __mod__ = run()
98
+ ${RExports.map(n => `export const ${n} = __mod__.${n}`).join("\n")}
99
+ export default __mod__
100
+ `;
101
+ await FSExtra.writeFile(options.outfile, outCode);
102
+ });
103
+ }
104
+ async function buildReactNative(options = {}, {
105
+ platform
106
+ }) {
107
+ return build({
108
+ bundle: true,
109
+ entryPoints: [requireResolve("react-native")],
110
+ format: "cjs",
111
+ target: "node20",
112
+ allowOverwrite: true,
113
+ platform: "node",
114
+ external,
115
+ loader: {
116
+ ".png": "dataurl",
117
+ ".jpg": "dataurl",
118
+ ".jpeg": "dataurl",
119
+ ".gif": "dataurl"
120
+ },
121
+ define: {
122
+ __DEV__: "true",
123
+ "process.env.NODE_ENV": `"development"`
124
+ },
125
+ logLevel: "warning",
126
+ resolveExtensions: [`.${platform}.js`, ".native.js", ".js", ".jsx", ".json", ".mjs"],
127
+ ...options,
128
+ plugins: [{
129
+ name: "remove-flow",
130
+ setup(build2) {
131
+ build2.onResolve({
132
+ filter: /HMRClient/
133
+ }, async input => {
134
+ const path = requireResolve("@vxrn/vite-native-hmr");
135
+ const possibleEsmPath = path.replace("/cjs/index.cjs", "/esm/index.native.js");
136
+ if (FSExtra.pathExistsSync(possibleEsmPath)) {
137
+ return {
138
+ path: possibleEsmPath
139
+ };
140
+ }
141
+ return {
142
+ path
143
+ };
144
+ });
145
+ build2.onLoad({
146
+ filter: /.*\.js$/
147
+ }, async input => {
148
+ if (!input.path.includes("react-native") && !input.path.includes(`vite-native-hmr`)) {
149
+ return;
150
+ }
151
+ const code = await readFile(input.path, "utf-8");
152
+ let outagain = await transformFlowBabel(code, {
153
+ development: true,
154
+ path: input.path
155
+ });
156
+ if (input.path.endsWith("react-native/index.js")) {
157
+ outagain = outagain.replace(/module\.exports *= *{/, `
158
+ module.exports = {
159
+ get _vxrnInternalReactNativeVersionDoNotUse() {
160
+ return require("./Libraries/Core/ReactNativeVersion").default;
161
+ },
162
+ `.trim());
163
+ }
164
+ return {
165
+ contents: outagain,
166
+ loader: "jsx"
167
+ };
168
+ });
169
+ }
170
+ }]
171
+ }).then(async () => {
172
+ const bundled = await readFile(options.outfile, "utf-8");
173
+ const outCode = `
174
+ const run = () => {
175
+ ${mustReplace(bundled, [{
176
+ find: esbuildCommonJSFunction,
177
+ replace: `
178
+ // replaced commonjs function to allow importing internals
179
+ var __commonJS = function __commonJS(cb, mod) {
180
+ var path = __getOwnPropNames(cb)[0];
181
+ var modulePath = path.replace(/.*node_modules\\//, '').replace('.js', '');
182
+
183
+ var __require = function __require() {
184
+ if (mod) return mod;
185
+
186
+ var cachedMod = globalThis["__cachedModules"][modulePath];
187
+ if (cachedMod) return cachedMod;
188
+
189
+ var moduleFn = cb[path];
190
+ try {
191
+ mod = {
192
+ exports: {}
193
+ };
194
+ moduleFn(mod.exports, mod);
195
+ mod = mod.exports;
196
+ } catch (e) {
197
+ // match esbuild: don't leave a half-initialized module cached
198
+ throw mod = 0, e;
199
+ }
200
+ // this is one of our patches basically allowing importing the inner contents:
201
+ globalThis["__cachedModules"][modulePath] = mod;
202
+ return mod;
203
+ };
204
+
205
+ // this is another patch basically allowing importing the inner contents:
206
+ if (globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__']) {
207
+ globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__'][modulePath] = __require;
208
+ }
209
+
210
+ return __require;
211
+ };
212
+ `
213
+ }, {
214
+ find: /module\.exports = require_(react_native|index)\(\);/,
215
+ replace: [`const rn = require_$1();`, `rn.AssetRegistry = require_registry();`, `require_ReactFabric();`,
216
+ // This is react-native/Libraries/Renderer/shims/ReactFabric.js, we call it here to ensure shims are initialized since we won't lazy load React Native components. See the NOTE below.
217
+ `if (typeof require_InitializeCore === 'function') { require_InitializeCore(); }`,
218
+ // Since we're accessing the RefreshRuntime directly via `__cachedModules` directly in the RN bundle, we need to ensure it's loaded in time. Note that calling `require_react_refresh_runtime_development()`, `require_setUpReactRefresh()` or `require_setUpDeveloperTools()` directly won't work.
219
+ `return rn;`].join("\n")
220
+ },
221
+ // improve error logs a lot including stack of original error
222
+ {
223
+ find: `originalMessage = e.message || "";`,
224
+ replace: `originalMessage = "" + (e.stack || "");`
225
+ }])}
226
+ }
227
+ const RN = run()
228
+
229
+ export const REACT_NATIVE_ESM_MANUAL_EXPORTS_START = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_START';${ /* NOTE: The `REACT_NATIVE_ESM_MANUAL_EXPORTS_*` vars here are used by other tools to replace exports in this section with a CJS `module.export` which supports dynamic loaded lazy exports, if CJS can be used - such as in a React Native bundle. */
230
+ ""}
231
+ ${RNExportNames.map(n => `export const ${n} = RN.${n}`).join("\n")}
232
+ export const REACT_NATIVE_ESM_MANUAL_EXPORTS_END = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_END';
233
+ `;
234
+ await FSExtra.writeFile(options.outfile, outCode);
235
+ });
236
+ }
237
+ const esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
238
+ try {
239
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
240
+ } catch (e) {
241
+ throw mod = 0, e;
242
+ }
243
+ };`;
244
+ const RNExportNames = ["registerCallableModule", "AccessibilityInfo", "ActivityIndicator", "Button", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "InputAccessoryView", "KeyboardAvoidingView", "Modal", "Pressable", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "StatusBar", "Switch", "Text", "TextInput", "Touchable", "TouchableHighlight", "TouchableNativeFeedback", "TouchableOpacity", "TouchableWithoutFeedback", "View", "VirtualizedList", "VirtualizedSectionList", "ActionSheetIOS", "Alert", "Animated", "Appearance", "AppRegistry", "AppState", "BackHandler", "DeviceInfo", "DevSettings", "Dimensions", "Easing", "findNodeHandle", "I18nManager", "InteractionManager", "Keyboard", "LayoutAnimation", "Linking", "LogBox", "NativeDialogManagerAndroid", "NativeEventEmitter", "Networking", "PanResponder", "PermissionsAndroid", "PixelRatio", "Settings", "Share", "StyleSheet", "Systrace", "ToastAndroid", "TurboModuleRegistry", "UIManager", "unstable_batchedUpdates", "useAnimatedValue", "useAnimatedValueXY", "useAnimatedColor", "useColorScheme", "usePressability", "useWindowDimensions", "UTFSequence", "Vibration", "DeviceEventEmitter", "DynamicColorIOS", "EventEmitter", "NativeAppEventEmitter", "NativeModules", "Platform", "PlatformColor", "processColor", "requireNativeComponent", "RootTagContext", "AssetRegistry"
245
+ // Normally not exported by React Native, but with a hack we make @react-native/assets-registry/registry available here.
246
+ ];
247
+ const RExports = ["Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
248
+ // For React 18
249
+ "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
250
+ // For React 19
251
+ "cloneElement", "createContext", "createElement", "createFactory", "createRef", "forwardRef", "isValidElement", "lazy", "memo", "startTransition", "unstable_act", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition", "version",
252
+ // Added in React 19
253
+ "act", "cache", "unstable_useCacheRefresh", "use", "useActionState", "useOptimistic"];
254
+ export { RExports, RNExportNames, buildReact, buildReactJSX, buildReactNative };
255
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mustReplace","transformFlowBabel","build","FSExtra","readFile","createRequire","requireResolve","import","meta","url","resolve","require","external","buildReactJSX","options","isProd","define","bundle","entryPoints","format","target","jsx","jsxFactory","allowOverwrite","platform","__DEV__","logLevel","then","bundled","outfile","outCode","find","replace","optional","map","n","join","writeFile","buildReact","RExports","buildReactNative","loader","resolveExtensions","plugins","name","setup","onResolve","filter","input","path","possibleEsmPath","pathExistsSync","onLoad","includes","code","outagain","development","endsWith","trim","contents","esbuildCommonJSFunction","RNExportNames"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,kBAAA,QAA0B;AACnC,SAASC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AAgBA,CAAC,SAASA,CAAC,EAAE,EAAEC,IAAA,CAAK,IAAI,CAAC;AAAA;AAAA;IAGpE,MAAMjC,OAAA,CAAQkC,SAAA,CAAUvB,OAAA,CAAQe,OAAA,EAAUC,OAAO;EACnD,CAAC;AACH;AAEA,MAAM8B,uBAAA,GAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQzB,MAAMC,aAAA,GAAgB,CAC3B,0BACA,qBACA,qBACA,UACA,uBACA,YACA,SACA,mBACA,sBACA,wBACA,SACA,aACA,kBACA,gBACA,cACA,eACA,aACA,UACA,QACA,aACA,aACA,sBACA,2BACA,oBACA,4BACA,QACA,mBACA,0BACA,kBACA,SACA,YACA,cACA,eACA,YACA,eACA,cACA,eACA,cACA,UACA,kBACA,eACA,sBACA,YACA,mBACA,WACA,UACA,8BACA,sBACA,cACA,gBACA,sBACA,cACA,YACA,SACA,cACA,YACA,gBACA,uBACA,aACA,2BACA,oBACA,sBACA,oBACA,kBACA,mBACA,uBACA,eACA,aACA,sBACA,mBACA,gBACA,yBACA,iBACA,YACA,iBACA,gBACA,0BACA,kBACA;AAAA;AAAA,CACF;AAEO,MAAMtB,QAAA,GAAW,CACtB,YACA,aACA,YACA,YACA,iBACA,cACA,YACA;AAAA;AACA;AAAA;AACA,gBACA,iBACA,iBACA,iBACA,aACA,cACA,kBACA,QACA,QACA,mBACA,gBACA,eACA,cACA,iBACA,oBACA,aACA,SACA,uBACA,sBACA,mBACA,WACA,cACA,UACA,YACA,wBACA,iBACA;AAAA;AAEA,OACA,SACA,4BACA,OACA,kBACA,gBACF","ignoreList":[]}
@@ -0,0 +1,255 @@
1
+ import { mustReplace } from "@vxrn/utils";
2
+ import { transformFlowBabel } from "@vxrn/vite-flow";
3
+ import { build } from "esbuild";
4
+ import FSExtra from "fs-extra";
5
+ import { readFile } from "node:fs/promises";
6
+ import { createRequire } from "node:module";
7
+ const requireResolve = "url" in import.meta ? createRequire(import.meta.url).resolve : require.resolve;
8
+ const external = ["react", "react/jsx-runtime", "react/jsx-dev-runtime"];
9
+ async function buildReactJSX(options = {}) {
10
+ const isProd = options.define?.["__DEV__"] === "false";
11
+ return build({
12
+ bundle: true,
13
+ entryPoints: [requireResolve("react/jsx-dev-runtime")],
14
+ format: "cjs",
15
+ target: "node16",
16
+ jsx: "transform",
17
+ jsxFactory: "react",
18
+ allowOverwrite: true,
19
+ platform: "node",
20
+ define: {
21
+ __DEV__: "true",
22
+ "process.env.NODE_ENV": `"development"`
23
+ },
24
+ external,
25
+ logLevel: "warning",
26
+ ...options
27
+ }).then(async () => {
28
+ const bundled = await readFile(options.outfile, "utf-8");
29
+ const outCode = `
30
+ const run = () => {
31
+ ${mustReplace(bundled, [...(isProd ? [{
32
+ // react 18 and 19 (18 has _min)
33
+ find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
34
+ replace: `return require_react_jsx_runtime_production$1();`
35
+ }] : [{
36
+ find: `module.exports = require_react_jsx_dev_runtime_development();`,
37
+ replace: `return require_react_jsx_dev_runtime_development();`
38
+ }]), {
39
+ find: `process.env.VXRN_REACT_19`,
40
+ replace: "false",
41
+ optional: true
42
+ }, {
43
+ find: `Object.assign(exports, eval("require('@vxrn/vendor/react-jsx-19')"));`,
44
+ optional: true,
45
+ replace: ``
46
+ }])}
47
+ }
48
+ const __mod__ = run()
49
+ ${["jsx", "jsxs", "jsxDEV", "Fragment"].map(n => `export const ${n} = __mod__.${n} || __mod__.jsx || ${(() => {
50
+ if (n === "jsxs") {
51
+ return "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }";
52
+ }
53
+ return "__mod__.jsxDEV";
54
+ })()}`).join("\n")}
55
+ `;
56
+ await FSExtra.writeFile(options.outfile, outCode);
57
+ });
58
+ }
59
+ async function buildReact(options = {}) {
60
+ const isProd = options.define?.["__DEV__"] === "false";
61
+ return build({
62
+ bundle: true,
63
+ entryPoints: [requireResolve("react")],
64
+ format: "cjs",
65
+ target: "node16",
66
+ jsx: "transform",
67
+ jsxFactory: "react",
68
+ allowOverwrite: true,
69
+ platform: "node",
70
+ define: {
71
+ __DEV__: "true",
72
+ "process.env.NODE_ENV": `"development"`
73
+ },
74
+ logLevel: "warning",
75
+ external,
76
+ ...options
77
+ }).then(async () => {
78
+ const bundled = await readFile(options.outfile, "utf-8");
79
+ const outCode = `
80
+ const run = () => {
81
+ ${mustReplace(bundled, [isProd ? {
82
+ find: /module\.exports = require_react_production([a-z_]*)\(\);/,
83
+ replace: "return require_react_production$1();"
84
+ } : {
85
+ find: /module\.exports = require_react_development([a-z_]*)\(\);/,
86
+ replace: "return require_react_development$1();"
87
+ }, {
88
+ find: `process.env.VXRN_REACT_19`,
89
+ optional: true,
90
+ replace: "false"
91
+ }, {
92
+ find: `Object.assign(exports, eval("require('@vxrn/vendor/react-19')"));`,
93
+ optional: true,
94
+ replace: ``
95
+ }])}
96
+ }
97
+ const __mod__ = run()
98
+ ${RExports.map(n => `export const ${n} = __mod__.${n}`).join("\n")}
99
+ export default __mod__
100
+ `;
101
+ await FSExtra.writeFile(options.outfile, outCode);
102
+ });
103
+ }
104
+ async function buildReactNative(options = {}, {
105
+ platform
106
+ }) {
107
+ return build({
108
+ bundle: true,
109
+ entryPoints: [requireResolve("react-native")],
110
+ format: "cjs",
111
+ target: "node20",
112
+ allowOverwrite: true,
113
+ platform: "node",
114
+ external,
115
+ loader: {
116
+ ".png": "dataurl",
117
+ ".jpg": "dataurl",
118
+ ".jpeg": "dataurl",
119
+ ".gif": "dataurl"
120
+ },
121
+ define: {
122
+ __DEV__: "true",
123
+ "process.env.NODE_ENV": `"development"`
124
+ },
125
+ logLevel: "warning",
126
+ resolveExtensions: [`.${platform}.js`, ".native.js", ".js", ".jsx", ".json", ".mjs"],
127
+ ...options,
128
+ plugins: [{
129
+ name: "remove-flow",
130
+ setup(build2) {
131
+ build2.onResolve({
132
+ filter: /HMRClient/
133
+ }, async input => {
134
+ const path = requireResolve("@vxrn/vite-native-hmr");
135
+ const possibleEsmPath = path.replace("/cjs/index.cjs", "/esm/index.native.js");
136
+ if (FSExtra.pathExistsSync(possibleEsmPath)) {
137
+ return {
138
+ path: possibleEsmPath
139
+ };
140
+ }
141
+ return {
142
+ path
143
+ };
144
+ });
145
+ build2.onLoad({
146
+ filter: /.*\.js$/
147
+ }, async input => {
148
+ if (!input.path.includes("react-native") && !input.path.includes(`vite-native-hmr`)) {
149
+ return;
150
+ }
151
+ const code = await readFile(input.path, "utf-8");
152
+ let outagain = await transformFlowBabel(code, {
153
+ development: true,
154
+ path: input.path
155
+ });
156
+ if (input.path.endsWith("react-native/index.js")) {
157
+ outagain = outagain.replace(/module\.exports *= *{/, `
158
+ module.exports = {
159
+ get _vxrnInternalReactNativeVersionDoNotUse() {
160
+ return require("./Libraries/Core/ReactNativeVersion").default;
161
+ },
162
+ `.trim());
163
+ }
164
+ return {
165
+ contents: outagain,
166
+ loader: "jsx"
167
+ };
168
+ });
169
+ }
170
+ }]
171
+ }).then(async () => {
172
+ const bundled = await readFile(options.outfile, "utf-8");
173
+ const outCode = `
174
+ const run = () => {
175
+ ${mustReplace(bundled, [{
176
+ find: esbuildCommonJSFunction,
177
+ replace: `
178
+ // replaced commonjs function to allow importing internals
179
+ var __commonJS = function __commonJS(cb, mod) {
180
+ var path = __getOwnPropNames(cb)[0];
181
+ var modulePath = path.replace(/.*node_modules\\//, '').replace('.js', '');
182
+
183
+ var __require = function __require() {
184
+ if (mod) return mod;
185
+
186
+ var cachedMod = globalThis["__cachedModules"][modulePath];
187
+ if (cachedMod) return cachedMod;
188
+
189
+ var moduleFn = cb[path];
190
+ try {
191
+ mod = {
192
+ exports: {}
193
+ };
194
+ moduleFn(mod.exports, mod);
195
+ mod = mod.exports;
196
+ } catch (e) {
197
+ // match esbuild: don't leave a half-initialized module cached
198
+ throw mod = 0, e;
199
+ }
200
+ // this is one of our patches basically allowing importing the inner contents:
201
+ globalThis["__cachedModules"][modulePath] = mod;
202
+ return mod;
203
+ };
204
+
205
+ // this is another patch basically allowing importing the inner contents:
206
+ if (globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__']) {
207
+ globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__'][modulePath] = __require;
208
+ }
209
+
210
+ return __require;
211
+ };
212
+ `
213
+ }, {
214
+ find: /module\.exports = require_(react_native|index)\(\);/,
215
+ replace: [`const rn = require_$1();`, `rn.AssetRegistry = require_registry();`, `require_ReactFabric();`,
216
+ // This is react-native/Libraries/Renderer/shims/ReactFabric.js, we call it here to ensure shims are initialized since we won't lazy load React Native components. See the NOTE below.
217
+ `if (typeof require_InitializeCore === 'function') { require_InitializeCore(); }`,
218
+ // Since we're accessing the RefreshRuntime directly via `__cachedModules` directly in the RN bundle, we need to ensure it's loaded in time. Note that calling `require_react_refresh_runtime_development()`, `require_setUpReactRefresh()` or `require_setUpDeveloperTools()` directly won't work.
219
+ `return rn;`].join("\n")
220
+ },
221
+ // improve error logs a lot including stack of original error
222
+ {
223
+ find: `originalMessage = e.message || "";`,
224
+ replace: `originalMessage = "" + (e.stack || "");`
225
+ }])}
226
+ }
227
+ const RN = run()
228
+
229
+ export const REACT_NATIVE_ESM_MANUAL_EXPORTS_START = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_START';${ /* NOTE: The `REACT_NATIVE_ESM_MANUAL_EXPORTS_*` vars here are used by other tools to replace exports in this section with a CJS `module.export` which supports dynamic loaded lazy exports, if CJS can be used - such as in a React Native bundle. */
230
+ ""}
231
+ ${RNExportNames.map(n => `export const ${n} = RN.${n}`).join("\n")}
232
+ export const REACT_NATIVE_ESM_MANUAL_EXPORTS_END = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_END';
233
+ `;
234
+ await FSExtra.writeFile(options.outfile, outCode);
235
+ });
236
+ }
237
+ const esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
238
+ try {
239
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
240
+ } catch (e) {
241
+ throw mod = 0, e;
242
+ }
243
+ };`;
244
+ const RNExportNames = ["registerCallableModule", "AccessibilityInfo", "ActivityIndicator", "Button", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "InputAccessoryView", "KeyboardAvoidingView", "Modal", "Pressable", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "StatusBar", "Switch", "Text", "TextInput", "Touchable", "TouchableHighlight", "TouchableNativeFeedback", "TouchableOpacity", "TouchableWithoutFeedback", "View", "VirtualizedList", "VirtualizedSectionList", "ActionSheetIOS", "Alert", "Animated", "Appearance", "AppRegistry", "AppState", "BackHandler", "DeviceInfo", "DevSettings", "Dimensions", "Easing", "findNodeHandle", "I18nManager", "InteractionManager", "Keyboard", "LayoutAnimation", "Linking", "LogBox", "NativeDialogManagerAndroid", "NativeEventEmitter", "Networking", "PanResponder", "PermissionsAndroid", "PixelRatio", "Settings", "Share", "StyleSheet", "Systrace", "ToastAndroid", "TurboModuleRegistry", "UIManager", "unstable_batchedUpdates", "useAnimatedValue", "useAnimatedValueXY", "useAnimatedColor", "useColorScheme", "usePressability", "useWindowDimensions", "UTFSequence", "Vibration", "DeviceEventEmitter", "DynamicColorIOS", "EventEmitter", "NativeAppEventEmitter", "NativeModules", "Platform", "PlatformColor", "processColor", "requireNativeComponent", "RootTagContext", "AssetRegistry"
245
+ // Normally not exported by React Native, but with a hack we make @react-native/assets-registry/registry available here.
246
+ ];
247
+ const RExports = ["Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
248
+ // For React 18
249
+ "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
250
+ // For React 19
251
+ "cloneElement", "createContext", "createElement", "createFactory", "createRef", "forwardRef", "isValidElement", "lazy", "memo", "startTransition", "unstable_act", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition", "version",
252
+ // Added in React 19
253
+ "act", "cache", "unstable_useCacheRefresh", "use", "useActionState", "useOptimistic"];
254
+ export { RExports, RNExportNames, buildReact, buildReactJSX, buildReactNative };
255
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mustReplace","transformFlowBabel","build","FSExtra","readFile","createRequire","requireResolve","import","meta","url","resolve","require","external","buildReactJSX","options","isProd","define","bundle","entryPoints","format","target","jsx","jsxFactory","allowOverwrite","platform","__DEV__","logLevel","then","bundled","outfile","outCode","find","replace","optional","map","n","join","writeFile","buildReact","RExports","buildReactNative","loader","resolveExtensions","plugins","name","setup","onResolve","filter","input","path","possibleEsmPath","pathExistsSync","onLoad","includes","code","outagain","development","endsWith","trim","contents","esbuildCommonJSFunction","RNExportNames"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,kBAAA,QAA0B;AACnC,SAASC,KAAA,QAAgC;AACzC,OAAOC,OAAA,MAAa;AACpB,SAASC,QAAA,QAAgB;AAEzB,SAASC,aAAA,QAAqB;AAE9B,MAAMC,cAAA,GACJ,SAASC,MAAA,CAAAC,IAAA,GAAcH,aAAA,CAAcE,MAAA,CAAAC,IAAA,CAAYC,GAAG,EAAEC,OAAA,GAAUC,OAAA,CAAQD,OAAA;AAE1E,MAAME,QAAA,GAAW,CAAC,SAAS,qBAAqB,uBAAuB;AAEvE,eAAsBC,cAAcC,OAAA,GAAwB,CAAC,GAAG;EAC9D,MAAMC,MAAA,GAASD,OAAA,CAAQE,MAAA,GAAS,SAAS,MAAM;EAE/C,OAAOd,KAAA,CAAM;IACXe,MAAA,EAAQ;IACRC,WAAA,EAAa,CAACZ,cAAA,CAAe,uBAAuB,CAAC;IACrDa,MAAA,EAAQ;IACRC,MAAA,EAAQ;IACRC,GAAA,EAAK;IACLC,UAAA,EAAY;IACZC,cAAA,EA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BACA,sBACA,oBACA,kBACA,mBACA,uBACA,eACA,aACA,sBACA,mBACA,gBACA,yBACA,iBACA,YACA,iBACA,gBACA,0BACA,kBACA;AAAA;AAAA,CACF;AAEO,MAAMtB,QAAA,GAAW,CACtB,YACA,aACA,YACA,YACA,iBACA,cACA,YACA;AAAA;AACA;AAAA;AACA,gBACA,iBACA,iBACA,iBACA,aACA,cACA,kBACA,QACA,QACA,mBACA,gBACA,eACA,cACA,iBACA,oBACA,aACA,SACA,uBACA,sBACA,mBACA,WACA,cACA,UACA,YACA,wBACA,iBACA;AAAA;AAEA,OACA,SACA,4BACA,OACA,kBACA,gBACF","ignoreList":[]}