@vxrn/react-native-prebuilt 1.25.3 → 1.25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxrn/react-native-prebuilt",
3
- "version": "1.25.3",
3
+ "version": "1.25.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,9 +31,9 @@
31
31
  "watch": "tamagui-build --watch"
32
32
  },
33
33
  "dependencies": {
34
- "@vxrn/utils": "1.25.3",
35
- "@vxrn/vite-flow": "1.25.3",
36
- "@vxrn/vite-native-hmr": "1.25.3",
34
+ "@vxrn/utils": "1.25.5",
35
+ "@vxrn/vite-flow": "1.25.5",
36
+ "@vxrn/vite-native-hmr": "1.25.5",
37
37
  "esbuild": "^0.25.12",
38
38
  "fs-extra": "^11.2.0",
39
39
  "import-meta-resolve": "^4.1.0"
@@ -1,296 +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;
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(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
34
- var index_exports = {};
35
- __export(index_exports, {
36
- RExports: () => RExports,
37
- RNExportNames: () => RNExportNames,
38
- buildReact: () => buildReact,
39
- buildReactJSX: () => buildReactJSX,
40
- buildReactNative: () => buildReactNative
41
- });
42
- module.exports = __toCommonJS(index_exports);
43
- var import_utils = require("@vxrn/utils");
44
- var import_vite_flow = require("@vxrn/vite-flow");
45
- var import_esbuild = require("esbuild");
46
- var import_fs_extra = __toESM(require("fs-extra"), 1);
47
- var import_promises = require("node:fs/promises");
48
- var import_node_module = require("node:module");
49
- const import_meta = {};
50
- const requireResolve = "url" in import_meta ? (0, import_node_module.createRequire)(import_meta.url).resolve : require.resolve;
51
- const external = ["react", "react/jsx-runtime", "react/jsx-dev-runtime"];
52
- async function buildReactJSX(options = {}) {
53
- const isProd = options.define?.["__DEV__"] === "false";
54
- return (0, import_esbuild.build)({
55
- bundle: true,
56
- entryPoints: [requireResolve("react/jsx-dev-runtime")],
57
- format: "cjs",
58
- target: "node16",
59
- jsx: "transform",
60
- jsxFactory: "react",
61
- allowOverwrite: true,
62
- platform: "node",
63
- define: {
64
- __DEV__: "true",
65
- "process.env.NODE_ENV": `"development"`
66
- },
67
- external,
68
- logLevel: "warning",
69
- ...options
70
- }).then(async () => {
71
- const bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
72
- const outCode = `
73
- const run = () => {
74
- ${(0, import_utils.mustReplace)(bundled, [...(isProd ? [{
75
- // react 18 and 19 (18 has _min)
76
- find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
77
- replace: `return require_react_jsx_runtime_production$1();`
78
- }] : [{
79
- find: `module.exports = require_react_jsx_dev_runtime_development();`,
80
- replace: `return require_react_jsx_dev_runtime_development();`
81
- }]), {
82
- find: `process.env.VXRN_REACT_19`,
83
- replace: "false",
84
- optional: true
85
- }, {
86
- find: `Object.assign(exports, eval("require('@vxrn/vendor/react-jsx-19')"));`,
87
- optional: true,
88
- replace: ``
89
- }])}
90
- }
91
- const __mod__ = run()
92
- ${["jsx", "jsxs", "jsxDEV", "Fragment"].map(n => `export const ${n} = __mod__.${n} || __mod__.jsx || ${(() => {
93
- if (n === "jsxs") {
94
- return "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }";
95
- }
96
- return "__mod__.jsxDEV";
97
- })()}`).join("\n")}
98
- `;
99
- await import_fs_extra.default.writeFile(options.outfile, outCode);
100
- });
101
- }
102
- async function buildReact(options = {}) {
103
- const isProd = options.define?.["__DEV__"] === "false";
104
- return (0, import_esbuild.build)({
105
- bundle: true,
106
- entryPoints: [requireResolve("react")],
107
- format: "cjs",
108
- target: "node16",
109
- jsx: "transform",
110
- jsxFactory: "react",
111
- allowOverwrite: true,
112
- platform: "node",
113
- define: {
114
- __DEV__: "true",
115
- "process.env.NODE_ENV": `"development"`
116
- },
117
- logLevel: "warning",
118
- external,
119
- ...options
120
- }).then(async () => {
121
- const bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
122
- const outCode = `
123
- const run = () => {
124
- ${(0, import_utils.mustReplace)(bundled, [isProd ? {
125
- find: /module\.exports = require_react_production([a-z_]*)\(\);/,
126
- replace: "return require_react_production$1();"
127
- } : {
128
- find: /module\.exports = require_react_development([a-z_]*)\(\);/,
129
- replace: "return require_react_development$1();"
130
- }, {
131
- find: `process.env.VXRN_REACT_19`,
132
- optional: true,
133
- replace: "false"
134
- }, {
135
- find: `Object.assign(exports, eval("require('@vxrn/vendor/react-19')"));`,
136
- optional: true,
137
- replace: ``
138
- }])}
139
- }
140
- const __mod__ = run()
141
- ${RExports.map(n => `export const ${n} = __mod__.${n}`).join("\n")}
142
- export default __mod__
143
- `;
144
- await import_fs_extra.default.writeFile(options.outfile, outCode);
145
- });
146
- }
147
- async function buildReactNative(options = {}, {
148
- platform
149
- }) {
150
- return (0, import_esbuild.build)({
151
- bundle: true,
152
- entryPoints: [requireResolve("react-native")],
153
- format: "cjs",
154
- target: "node20",
155
- allowOverwrite: true,
156
- platform: "node",
157
- external,
158
- loader: {
159
- ".png": "dataurl",
160
- ".jpg": "dataurl",
161
- ".jpeg": "dataurl",
162
- ".gif": "dataurl"
163
- },
164
- define: {
165
- __DEV__: "true",
166
- "process.env.NODE_ENV": `"development"`
167
- },
168
- logLevel: "warning",
169
- resolveExtensions: [`.${platform}.js`, ".native.js", ".js", ".jsx", ".json", ".mjs"],
170
- ...options,
171
- plugins: [{
172
- name: "remove-flow",
173
- setup(build2) {
174
- build2.onResolve({
175
- filter: /HMRClient/
176
- }, async input => {
177
- const path = requireResolve("@vxrn/vite-native-hmr");
178
- const possibleEsmPath = path.replace("/cjs/index.cjs", "/esm/index.native.js");
179
- if (import_fs_extra.default.pathExistsSync(possibleEsmPath)) {
180
- return {
181
- path: possibleEsmPath
182
- };
183
- }
184
- return {
185
- path
186
- };
187
- });
188
- build2.onLoad({
189
- filter: /.*\.js$/
190
- }, async input => {
191
- if (!input.path.includes("react-native") && !input.path.includes(`vite-native-hmr`)) {
192
- return;
193
- }
194
- const code = await (0, import_promises.readFile)(input.path, "utf-8");
195
- let outagain = await (0, import_vite_flow.transformFlowBabel)(code, {
196
- development: true,
197
- path: input.path
198
- });
199
- if (input.path.endsWith("react-native/index.js")) {
200
- outagain = outagain.replace(/module\.exports *= *{/, `
201
- module.exports = {
202
- get _vxrnInternalReactNativeVersionDoNotUse() {
203
- return require("./Libraries/Core/ReactNativeVersion").default;
204
- },
205
- `.trim());
206
- }
207
- return {
208
- contents: outagain,
209
- loader: "jsx"
210
- };
211
- });
212
- }
213
- }]
214
- }).then(async () => {
215
- const bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
216
- const outCode = `
217
- const run = () => {
218
- ${(0, import_utils.mustReplace)(bundled, [{
219
- find: esbuildCommonJSFunction,
220
- replace: `
221
- // replaced commonjs function to allow importing internals
222
- var __commonJS = function __commonJS(cb, mod) {
223
- var path = __getOwnPropNames(cb)[0];
224
- var modulePath = path.replace(/.*node_modules\\//, '').replace('.js', '');
225
-
226
- var __require = function __require() {
227
- if (mod) return mod;
228
-
229
- var cachedMod = globalThis["__cachedModules"][modulePath];
230
- if (cachedMod) return cachedMod;
231
-
232
- var moduleFn = cb[path];
233
- try {
234
- mod = {
235
- exports: {}
236
- };
237
- moduleFn(mod.exports, mod);
238
- mod = mod.exports;
239
- } catch (e) {
240
- // match esbuild: don't leave a half-initialized module cached
241
- throw mod = 0, e;
242
- }
243
- // this is one of our patches basically allowing importing the inner contents:
244
- globalThis["__cachedModules"][modulePath] = mod;
245
- return mod;
246
- };
247
-
248
- // this is another patch basically allowing importing the inner contents:
249
- if (globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__']) {
250
- globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__'][modulePath] = __require;
251
- }
252
-
253
- return __require;
254
- };
255
- `
256
- }, {
257
- find: /module\.exports = require_(react_native|index)\(\);/,
258
- replace: [`const rn = require_$1();`, `rn.AssetRegistry = require_registry();`, `require_ReactFabric();`,
259
- // 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.
260
- `if (typeof require_InitializeCore === 'function') { require_InitializeCore(); }`,
261
- // 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.
262
- `return rn;`].join("\n")
263
- },
264
- // improve error logs a lot including stack of original error
265
- {
266
- find: `originalMessage = e.message || "";`,
267
- replace: `originalMessage = "" + (e.stack || "");`
268
- }])}
269
- }
270
- const RN = run()
271
-
272
- 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. */
273
- ""}
274
- ${RNExportNames.map(n => `export const ${n} = RN.${n}`).join("\n")}
275
- export const REACT_NATIVE_ESM_MANUAL_EXPORTS_END = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_END';
276
- `;
277
- await import_fs_extra.default.writeFile(options.outfile, outCode);
278
- });
279
- }
280
- const esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
281
- try {
282
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
283
- } catch (e) {
284
- throw mod = 0, e;
285
- }
286
- };`;
287
- 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"
288
- // Normally not exported by React Native, but with a hack we make @react-native/assets-registry/registry available here.
289
- ];
290
- const RExports = ["Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
291
- // For React 18
292
- "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
293
- // For React 19
294
- "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",
295
- // Added in React 19
296
- "act", "cache", "unstable_useCacheRefresh", "use", "useActionState", "useOptimistic"];
@@ -1,309 +0,0 @@
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 __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
36
- var index_exports = {};
37
- __export(index_exports, {
38
- RExports: () => RExports,
39
- RNExportNames: () => RNExportNames,
40
- buildReact: () => buildReact,
41
- buildReactJSX: () => buildReactJSX,
42
- buildReactNative: () => buildReactNative
43
- });
44
- module.exports = __toCommonJS(index_exports);
45
- var import_utils = require("@vxrn/utils");
46
- var import_vite_flow = require("@vxrn/vite-flow");
47
- var import_esbuild = require("esbuild");
48
- var import_fs_extra = __toESM(require("fs-extra"), 1);
49
- var import_promises = require("fs/promises");
50
- var import_module = require("module");
51
- const import_meta = {};
52
- var requireResolve = "url" in import_meta ? (0, import_module.createRequire)(import_meta.url).resolve : require.resolve;
53
- var external = ["react", "react/jsx-runtime", "react/jsx-dev-runtime"];
54
- async function buildReactJSX() {
55
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
56
- var _options_define;
57
- var isProd = ((_options_define = options.define) === null || _options_define === void 0 ? void 0 : _options_define["__DEV__"]) === "false";
58
- return (0, import_esbuild.build)({
59
- bundle: true,
60
- entryPoints: [requireResolve("react/jsx-dev-runtime")],
61
- format: "cjs",
62
- target: "node16",
63
- jsx: "transform",
64
- jsxFactory: "react",
65
- allowOverwrite: true,
66
- platform: "node",
67
- define: {
68
- __DEV__: "true",
69
- "process.env.NODE_ENV": `"development"`
70
- },
71
- external,
72
- logLevel: "warning",
73
- ...options
74
- }).then(async function () {
75
- var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
76
- var outCode = `
77
- const run = () => {
78
- ${(0, import_utils.mustReplace)(bundled, [...(isProd ? [{
79
- // react 18 and 19 (18 has _min)
80
- find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
81
- replace: `return require_react_jsx_runtime_production$1();`
82
- }] : [{
83
- find: `module.exports = require_react_jsx_dev_runtime_development();`,
84
- replace: `return require_react_jsx_dev_runtime_development();`
85
- }]), {
86
- find: `process.env.VXRN_REACT_19`,
87
- replace: "false",
88
- optional: true
89
- }, {
90
- find: `Object.assign(exports, eval("require('@vxrn/vendor/react-jsx-19')"));`,
91
- optional: true,
92
- replace: ``
93
- }])}
94
- }
95
- const __mod__ = run()
96
- ${["jsx", "jsxs", "jsxDEV", "Fragment"].map(function (n) {
97
- return `export const ${n} = __mod__.${n} || __mod__.jsx || ${function () {
98
- if (n === "jsxs") {
99
- return "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }";
100
- }
101
- return "__mod__.jsxDEV";
102
- }()}`;
103
- }).join("\n")}
104
- `;
105
- await import_fs_extra.default.writeFile(options.outfile, outCode);
106
- });
107
- }
108
- async function buildReact() {
109
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
110
- var _options_define;
111
- var isProd = ((_options_define = options.define) === null || _options_define === void 0 ? void 0 : _options_define["__DEV__"]) === "false";
112
- return (0, import_esbuild.build)({
113
- bundle: true,
114
- entryPoints: [requireResolve("react")],
115
- format: "cjs",
116
- target: "node16",
117
- jsx: "transform",
118
- jsxFactory: "react",
119
- allowOverwrite: true,
120
- platform: "node",
121
- define: {
122
- __DEV__: "true",
123
- "process.env.NODE_ENV": `"development"`
124
- },
125
- logLevel: "warning",
126
- external,
127
- ...options
128
- }).then(async function () {
129
- var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
130
- var outCode = `
131
- const run = () => {
132
- ${(0, import_utils.mustReplace)(bundled, [isProd ? {
133
- find: /module\.exports = require_react_production([a-z_]*)\(\);/,
134
- replace: "return require_react_production$1();"
135
- } : {
136
- find: /module\.exports = require_react_development([a-z_]*)\(\);/,
137
- replace: "return require_react_development$1();"
138
- }, {
139
- find: `process.env.VXRN_REACT_19`,
140
- optional: true,
141
- replace: "false"
142
- }, {
143
- find: `Object.assign(exports, eval("require('@vxrn/vendor/react-19')"));`,
144
- optional: true,
145
- replace: ``
146
- }])}
147
- }
148
- const __mod__ = run()
149
- ${RExports.map(function (n) {
150
- return `export const ${n} = __mod__.${n}`;
151
- }).join("\n")}
152
- export default __mod__
153
- `;
154
- await import_fs_extra.default.writeFile(options.outfile, outCode);
155
- });
156
- }
157
- async function buildReactNative() {
158
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
159
- {
160
- platform
161
- } = arguments.length > 1 ? arguments[1] : void 0;
162
- return (0, import_esbuild.build)({
163
- bundle: true,
164
- entryPoints: [requireResolve("react-native")],
165
- format: "cjs",
166
- target: "node20",
167
- allowOverwrite: true,
168
- platform: "node",
169
- external,
170
- loader: {
171
- ".png": "dataurl",
172
- ".jpg": "dataurl",
173
- ".jpeg": "dataurl",
174
- ".gif": "dataurl"
175
- },
176
- define: {
177
- __DEV__: "true",
178
- "process.env.NODE_ENV": `"development"`
179
- },
180
- logLevel: "warning",
181
- resolveExtensions: [`.${platform}.js`, ".native.js", ".js", ".jsx", ".json", ".mjs"],
182
- ...options,
183
- plugins: [{
184
- name: "remove-flow",
185
- setup(build2) {
186
- build2.onResolve({
187
- filter: /HMRClient/
188
- }, async function (input) {
189
- var path = requireResolve("@vxrn/vite-native-hmr");
190
- var possibleEsmPath = path.replace("/cjs/index.cjs", "/esm/index.native.js");
191
- if (import_fs_extra.default.pathExistsSync(possibleEsmPath)) {
192
- return {
193
- path: possibleEsmPath
194
- };
195
- }
196
- return {
197
- path
198
- };
199
- });
200
- build2.onLoad({
201
- filter: /.*\.js$/
202
- }, async function (input) {
203
- if (!input.path.includes("react-native") && !input.path.includes(`vite-native-hmr`)) {
204
- return;
205
- }
206
- var code = await (0, import_promises.readFile)(input.path, "utf-8");
207
- var outagain = await (0, import_vite_flow.transformFlowBabel)(code, {
208
- development: true,
209
- path: input.path
210
- });
211
- if (input.path.endsWith("react-native/index.js")) {
212
- outagain = outagain.replace(/module\.exports *= *{/, `
213
- module.exports = {
214
- get _vxrnInternalReactNativeVersionDoNotUse() {
215
- return require("./Libraries/Core/ReactNativeVersion").default;
216
- },
217
- `.trim());
218
- }
219
- return {
220
- contents: outagain,
221
- loader: "jsx"
222
- };
223
- });
224
- }
225
- }]
226
- }).then(async function () {
227
- var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8");
228
- var outCode = `
229
- const run = () => {
230
- ${(0, import_utils.mustReplace)(bundled, [{
231
- find: esbuildCommonJSFunction,
232
- replace: `
233
- // replaced commonjs function to allow importing internals
234
- var __commonJS = function __commonJS(cb, mod) {
235
- var path = __getOwnPropNames(cb)[0];
236
- var modulePath = path.replace(/.*node_modules\\//, '').replace('.js', '');
237
-
238
- var __require = function __require() {
239
- if (mod) return mod;
240
-
241
- var cachedMod = globalThis["__cachedModules"][modulePath];
242
- if (cachedMod) return cachedMod;
243
-
244
- var moduleFn = cb[path];
245
- try {
246
- mod = {
247
- exports: {}
248
- };
249
- moduleFn(mod.exports, mod);
250
- mod = mod.exports;
251
- } catch (e) {
252
- // match esbuild: don't leave a half-initialized module cached
253
- throw mod = 0, e;
254
- }
255
- // this is one of our patches basically allowing importing the inner contents:
256
- globalThis["__cachedModules"][modulePath] = mod;
257
- return mod;
258
- };
259
-
260
- // this is another patch basically allowing importing the inner contents:
261
- if (globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__']) {
262
- globalThis['__RN_INTERNAL_MODULE_REQUIRES_MAP__'][modulePath] = __require;
263
- }
264
-
265
- return __require;
266
- };
267
- `
268
- }, {
269
- find: /module\.exports = require_(react_native|index)\(\);/,
270
- replace: [`const rn = require_$1();`, `rn.AssetRegistry = require_registry();`, `require_ReactFabric();`,
271
- // 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.
272
- `if (typeof require_InitializeCore === 'function') { require_InitializeCore(); }`,
273
- // 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.
274
- `return rn;`].join("\n")
275
- },
276
- // improve error logs a lot including stack of original error
277
- {
278
- find: `originalMessage = e.message || "";`,
279
- replace: `originalMessage = "" + (e.stack || "");`
280
- }])}
281
- }
282
- const RN = run()
283
-
284
- 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. */
285
- ""}
286
- ${RNExportNames.map(function (n) {
287
- return `export const ${n} = RN.${n}`;
288
- }).join("\n")}
289
- export const REACT_NATIVE_ESM_MANUAL_EXPORTS_END = 'REACT_NATIVE_ESM_MANUAL_EXPORTS_END';
290
- `;
291
- await import_fs_extra.default.writeFile(options.outfile, outCode);
292
- });
293
- }
294
- var esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
295
- try {
296
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
297
- } catch (e) {
298
- throw mod = 0, e;
299
- }
300
- };`;
301
- var 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"];
302
- var RExports = ["Children", "Component", "Fragment", "Profiler", "PureComponent", "StrictMode", "Suspense", "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
303
- // For React 18
304
- "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
305
- // For React 19
306
- "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",
307
- // Added in React 19
308
- "act", "cache", "unstable_useCacheRefresh", "use", "useActionState", "useOptimistic"];
309
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","RExports","RNExportNames","buildReact","buildReactJSX","buildReactNative","module","exports","import_utils","require","import_vite_flow","import_esbuild","import_fs_extra","__toESM","import_promises","import_module","import_meta","requireResolve","createRequire","url","resolve","external","options","arguments","length","_options_define","isProd","define","build","bundle","entryPoints","format","target","jsx","jsxFactory","allowOverwrite","platform","__DEV__","logLevel","then","bundled","readFile","outfile","outCode","mustReplace","find","replace","optional","map","n","join","default","writeFile","loader","resolveExtensions","plugins","name","setup","build2","onResolve","filter","input","path","possibleEsmPath","pathExistsSync","onLoad","includes","code","outagain","transformFlowBabel","development","endsWith","trim","contents","esbuildCommonJSFunction"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAb,YAA4B,CAAAK,aAAA;AAC5B,IAAAS,YAAA,GAAAC,OAAmC;AACnC,IAAAC,gBAAA,GAAyCD,OAAA;AACzC,IAAAE,cAAA,GAAAF,OAAoB;AACpB,IAAAG,eAAA,GAAyBC,OAAA,CAAAJ,OAAA;AAEzB,IAAAK,eAAA,GAAAL,OAA8B;AAN9B,IAAAM,aAAA,GAAAN,OAAA;AAQA,MAAMO,WAAA;AAGN,IAAAC,cAAkB,YAASD,WAAA,OAAqBD,aAAA,CAAAG,aAAuB,EAAAF,WAAA,CAAAG,GAAA,EAAAC,OAAA,GAAAX,OAAA,CAAAW,OAAA;AAEvE,IAAAC,QAAA,GAAsB,CACpB,OAAM,EAEN,mBAAO,EAAM,uBACH;AAC6C,eAC7CjB,cAAA;EAAA,IACRkB,OAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,iBAAAA,SAAA;EAAA,IACRE,eAAK;EAAA,IACLC,MAAA,IAAY,CAAAD,eAAA,GAAAH,OAAA,CAAAK,MAAA,cAAAF,eAAA,uBAAAA,eAAA;EAAA,OACZ,IAAAd,cAAg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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCX;AACA;AACQ;AACG;AACP;AACA;AACA;AAAA;AACA;AAAA;AACA;AACS;AACb;AAAA;AAGA;AACQ;AACG;AACX;AACA;AAAA;AAAA;AAAA;AAAA;AAIoV;AACpR;IAAA,GAGpE;MACDD,IAAA;MACHC,OAAA,GAEM,0BAA0B;MAAA;MAAA;MAAA;MAAA,aAQnB,CAAAI,IAAA;IACX;IACA;IACA;MACAL,IAAA;MACAC,OAAA;IACA,EACA;AAAA;AACA;AACA;AACA,mGAHA,CAIA;IACA;AAAA,MACA5C,aAAA,CAAA8C,GAAA,WAAAC,CAAA;MACA,uBAAAA,CAAA,SAAAA,CAAA;IACA,GAAAC,IAAA;AAAA;AACA,KACA;IACA,MAAAtC,eAAA,CAAAuC,OAAA,CAAAC,SAAA,CAAA9B,OAAA,CAAAoB,OAAA,EAAAC,OAAA;EACA;AAAA;AACA,IACA+B,uBAAA;AAAA;AACA;AACA;AACA;AACA;AACA,GACA;AAAA,IACAxE,aAAA,IACA,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,oCACF,YAEO,OAAM,EACX,cACA,YACA,gBACA,uBACA,aACA,2BACA,oBACA,0CACA,qCACA,uBACA,eACA,aACA,sBACA,mBACA,gBACA,yBACA,iBACA,YACA,iBACA,gBACA,0BACA,kBACA;AACA,IACAD,QAAA,IACA,YACA,aACA,YACA,YACA,iBACA,cACA,YACA;AACA;AACA;AACA;AAAA,gBAEA,iBACA,iBACA,iBACA,aACA,cACA,kBACF,Q","ignoreList":[]}