babel-preset-expo 13.1.8 → 13.2.0-canary-20250428-4156f88
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.
|
@@ -8,12 +8,10 @@ exports.reactClientReferencesPlugin = reactClientReferencesPlugin;
|
|
|
8
8
|
* Copyright © 2024 650 Industries.
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@babel/core");
|
|
11
|
-
const node_path_1 = require("node:path");
|
|
12
11
|
const node_url_1 = __importDefault(require("node:url"));
|
|
13
12
|
const common_1 = require("./common");
|
|
14
13
|
function reactClientReferencesPlugin(api) {
|
|
15
14
|
const isReactServer = api.caller(common_1.getIsReactServer);
|
|
16
|
-
const possibleProjectRoot = api.caller(common_1.getPossibleProjectRoot);
|
|
17
15
|
return {
|
|
18
16
|
name: 'expo-client-references',
|
|
19
17
|
visitor: {
|
|
@@ -34,12 +32,7 @@ function reactClientReferencesPlugin(api) {
|
|
|
34
32
|
// This can happen in tests or systems that use Babel standalone.
|
|
35
33
|
throw new Error('[Babel] Expected a filename to be set in the state');
|
|
36
34
|
}
|
|
37
|
-
const
|
|
38
|
-
// TODO: Replace with opaque paths in production.
|
|
39
|
-
const outputKey = './' + (0, common_1.toPosixPath)((0, node_path_1.relative)(projectRoot, filePath));
|
|
40
|
-
// const outputKey = isProd
|
|
41
|
-
// ? './' + getRelativePath(projectRoot, filePath)
|
|
42
|
-
// : url.pathToFileURL(filePath).href;
|
|
35
|
+
const outputKey = node_url_1.default.pathToFileURL(filePath).href;
|
|
43
36
|
function iterateExports(callback, type) {
|
|
44
37
|
const exportNames = new Set();
|
|
45
38
|
// Collect all of the exports
|
|
@@ -164,7 +157,7 @@ function reactClientReferencesPlugin(api) {
|
|
|
164
157
|
// Store the proxy export names for testing purposes.
|
|
165
158
|
state.file.metadata.proxyExports = [...proxyExports];
|
|
166
159
|
// Save the server action reference in the metadata.
|
|
167
|
-
state.file.metadata.reactServerReference =
|
|
160
|
+
state.file.metadata.reactServerReference = outputKey;
|
|
168
161
|
}
|
|
169
162
|
else if (isUseClient) {
|
|
170
163
|
if (!isReactServer) {
|
|
@@ -215,7 +208,7 @@ function reactClientReferencesPlugin(api) {
|
|
|
215
208
|
// Store the proxy export names for testing purposes.
|
|
216
209
|
state.file.metadata.proxyExports = [...proxyExports];
|
|
217
210
|
// Save the client reference in the metadata.
|
|
218
|
-
state.file.metadata.reactClientReference =
|
|
211
|
+
state.file.metadata.reactClientReference = outputKey;
|
|
219
212
|
}
|
|
220
213
|
},
|
|
221
214
|
},
|
package/build/common.d.ts
CHANGED
|
@@ -18,7 +18,3 @@ export declare function getExpoRouterAbsoluteAppRoot(caller?: any): string;
|
|
|
18
18
|
export declare function getInlineEnvVarsEnabled(caller?: any): boolean;
|
|
19
19
|
export declare function getAsyncRoutes(caller?: any): boolean;
|
|
20
20
|
export declare function createAddNamedImportOnce(t: typeof import('@babel/types')): (path: NodePath<t.Node>, name: string, source: string) => any;
|
|
21
|
-
/**
|
|
22
|
-
* Convert any platform-specific path to a POSIX path.
|
|
23
|
-
*/
|
|
24
|
-
export declare function toPosixPath(filePath: string): string;
|
package/build/common.js
CHANGED
|
@@ -19,7 +19,6 @@ exports.getExpoRouterAbsoluteAppRoot = getExpoRouterAbsoluteAppRoot;
|
|
|
19
19
|
exports.getInlineEnvVarsEnabled = getInlineEnvVarsEnabled;
|
|
20
20
|
exports.getAsyncRoutes = getAsyncRoutes;
|
|
21
21
|
exports.createAddNamedImportOnce = createAddNamedImportOnce;
|
|
22
|
-
exports.toPosixPath = toPosixPath;
|
|
23
22
|
// @ts-expect-error: missing types
|
|
24
23
|
const helper_module_imports_1 = require("@babel/helper-module-imports");
|
|
25
24
|
const node_path_1 = __importDefault(require("node:path"));
|
|
@@ -165,10 +164,3 @@ function createAddNamedImportOnce(t) {
|
|
|
165
164
|
return didCreate ? identifier : t.cloneNode(identifier);
|
|
166
165
|
};
|
|
167
166
|
}
|
|
168
|
-
const REGEXP_REPLACE_SLASHES = /\\/g;
|
|
169
|
-
/**
|
|
170
|
-
* Convert any platform-specific path to a POSIX path.
|
|
171
|
-
*/
|
|
172
|
-
function toPosixPath(filePath) {
|
|
173
|
-
return filePath.replace(REGEXP_REPLACE_SLASHES, '/');
|
|
174
|
-
}
|
|
@@ -41,15 +41,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
41
41
|
return result;
|
|
42
42
|
};
|
|
43
43
|
})();
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
45
|
exports.reactServerActionsPlugin = reactServerActionsPlugin;
|
|
49
46
|
const core_1 = require("@babel/core");
|
|
50
47
|
const t = __importStar(require("@babel/types"));
|
|
51
48
|
const node_path_1 = require("node:path");
|
|
52
|
-
const node_url_1 =
|
|
49
|
+
const node_url_1 = __importStar(require("node:url"));
|
|
53
50
|
const common_1 = require("./common");
|
|
54
51
|
const debug = require('debug')('expo:babel:server-actions');
|
|
55
52
|
const LAZY_WRAPPER_VALUE_KEY = 'value';
|
|
@@ -196,7 +193,7 @@ function reactServerActionsPlugin(api) {
|
|
|
196
193
|
};
|
|
197
194
|
getActionModuleId = once(() => {
|
|
198
195
|
// Create relative file path hash.
|
|
199
|
-
return
|
|
196
|
+
return (0, node_url_1.pathToFileURL)((0, node_path_1.relative)(projectRoot, file.opts.filename)).href;
|
|
200
197
|
});
|
|
201
198
|
const defineBoundArgsWrapperHelper = once(() => {
|
|
202
199
|
const id = this.file.path.scope.generateUidIdentifier('wrapBoundArgs');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-preset-expo",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0-canary-20250428-4156f88",
|
|
4
4
|
"description": "The Babel preset for Expo projects",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
"@babel/traverse": "^7.9.0",
|
|
77
77
|
"@babel/types": "^7.9.0",
|
|
78
78
|
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
|
|
79
|
-
"expo-module-scripts": "
|
|
79
|
+
"expo-module-scripts": "4.1.6-canary-20250428-4156f88",
|
|
80
80
|
"jest": "^29.2.1"
|
|
81
|
-
}
|
|
82
|
-
"gitHead": "a639a661a5329e58f916cf69b8f1a7718bbdd26e"
|
|
81
|
+
}
|
|
83
82
|
}
|