@expo/metro-config 58.0.1 → 58.0.3
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/build/ExpoMetroConfig.d.ts +4 -4
- package/build/ExpoMetroConfig.js +18 -7
- package/build/ExpoMetroConfig.js.map +1 -1
- package/build/build-cache-store.d.ts +12 -0
- package/build/build-cache-store.js +46 -0
- package/build/build-cache-store.js.map +1 -0
- package/build/cache-vary/LruCache.d.ts +8 -0
- package/build/cache-vary/LruCache.js +39 -0
- package/build/cache-vary/LruCache.js.map +1 -0
- package/build/cache-vary/VaryingCacheStore.d.ts +34 -0
- package/build/cache-vary/VaryingCacheStore.js +265 -0
- package/build/cache-vary/VaryingCacheStore.js.map +1 -0
- package/build/cache-vary/ambient.d.ts +15 -0
- package/build/cache-vary/ambient.js +90 -0
- package/build/cache-vary/ambient.js.map +1 -0
- package/build/env.d.ts +4 -0
- package/build/env.js +6 -0
- package/build/env.js.map +1 -1
- package/build/serializer/environmentVariableSerializerPlugin.js +4 -2
- package/build/serializer/environmentVariableSerializerPlugin.js.map +1 -1
- package/build/serializer/jsOutput.d.ts +5 -6
- package/build/serializer/jsOutput.js.map +1 -1
- package/build/serializer/reconcileTransformSerializerPlugin.js +14 -15
- package/build/serializer/reconcileTransformSerializerPlugin.js.map +1 -1
- package/build/serializer/sourceMap.d.ts +40 -4
- package/build/serializer/sourceMap.js +85 -155
- package/build/serializer/sourceMap.js.map +1 -1
- package/build/transform-worker/metro-transform-worker.d.ts +2 -3
- package/build/transform-worker/metro-transform-worker.js +48 -42
- package/build/transform-worker/metro-transform-worker.js.map +1 -1
- package/build/transform-worker/noxcturnal/noxcturnal-transformer.d.ts +2 -1
- package/build/transform-worker/noxcturnal/noxcturnal-transformer.js +5 -0
- package/build/transform-worker/noxcturnal/noxcturnal-transformer.js.map +1 -1
- package/build/transform-worker/noxcturnal/plugins/cache-vary.d.ts +7 -0
- package/build/transform-worker/noxcturnal/plugins/cache-vary.js +49 -0
- package/build/transform-worker/noxcturnal/plugins/cache-vary.js.map +1 -0
- package/build/transform-worker/noxcturnal/plugins/define.js +7 -0
- package/build/transform-worker/noxcturnal/plugins/define.js.map +1 -1
- package/build/transform-worker/noxcturnal/plugins/metro-dependency.js +1 -1
- package/build/transform-worker/noxcturnal/plugins/metro-dependency.js.map +1 -1
- package/build/transform-worker/noxcturnal/plugins/process-env.js +7 -0
- package/build/transform-worker/noxcturnal/plugins/process-env.js.map +1 -1
- package/build/transform-worker/transform-worker.js.map +1 -1
- package/build/transform-worker/transformShim.js +3 -4
- package/build/transform-worker/transformShim.js.map +1 -1
- package/build/transform-worker/types.d.ts +4 -0
- package/package.json +4 -4
- package/build/serializer/packedMap.d.ts +0 -48
- package/build/serializer/packedMap.js +0 -440
- package/build/serializer/packedMap.js.map +0 -1
|
@@ -10,10 +10,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
0 && (module.exports = {
|
|
11
11
|
appendDebugIdToSourceMap: null,
|
|
12
12
|
composeSourceMaps: null,
|
|
13
|
-
|
|
13
|
+
flattenSourceMap: null,
|
|
14
14
|
rawMappingsToEncodedMap: null,
|
|
15
15
|
sourceMapString: null,
|
|
16
|
-
sourceMapStringNonBlocking: null
|
|
16
|
+
sourceMapStringNonBlocking: null,
|
|
17
|
+
vlqMapFromDecodedMap: null,
|
|
18
|
+
vlqMapFromEncodedMap: null
|
|
17
19
|
});
|
|
18
20
|
function _export(target, all) {
|
|
19
21
|
for(var name in all)Object.defineProperty(target, name, {
|
|
@@ -28,8 +30,8 @@ _export(exports, {
|
|
|
28
30
|
get composeSourceMaps () {
|
|
29
31
|
return composeSourceMaps;
|
|
30
32
|
},
|
|
31
|
-
get
|
|
32
|
-
return
|
|
33
|
+
get flattenSourceMap () {
|
|
34
|
+
return flattenSourceMap;
|
|
33
35
|
},
|
|
34
36
|
get rawMappingsToEncodedMap () {
|
|
35
37
|
return rawMappingsToEncodedMap;
|
|
@@ -39,9 +41,14 @@ _export(exports, {
|
|
|
39
41
|
},
|
|
40
42
|
get sourceMapStringNonBlocking () {
|
|
41
43
|
return sourceMapStringNonBlocking;
|
|
44
|
+
},
|
|
45
|
+
get vlqMapFromDecodedMap () {
|
|
46
|
+
return vlqMapFromDecodedMap;
|
|
47
|
+
},
|
|
48
|
+
get vlqMapFromEncodedMap () {
|
|
49
|
+
return vlqMapFromEncodedMap;
|
|
42
50
|
}
|
|
43
51
|
});
|
|
44
|
-
const _packedMap = require("./packedMap");
|
|
45
52
|
let _remapping;
|
|
46
53
|
function loadRemapping() {
|
|
47
54
|
if (!_remapping) {
|
|
@@ -56,174 +63,96 @@ function loadSourcemapCodec() {
|
|
|
56
63
|
}
|
|
57
64
|
return _sourcemapCodec;
|
|
58
65
|
}
|
|
59
|
-
let
|
|
60
|
-
function
|
|
61
|
-
if (!
|
|
62
|
-
|
|
66
|
+
let _metroSourceMap;
|
|
67
|
+
function loadMetroSourceMap() {
|
|
68
|
+
if (!_metroSourceMap) {
|
|
69
|
+
_metroSourceMap = require('@expo/metro/metro-source-map');
|
|
63
70
|
}
|
|
64
|
-
return
|
|
71
|
+
return _metroSourceMap;
|
|
65
72
|
}
|
|
66
|
-
let
|
|
67
|
-
function
|
|
68
|
-
if (!
|
|
69
|
-
|
|
73
|
+
let _metroSourceMapString;
|
|
74
|
+
function loadMetroSourceMapString() {
|
|
75
|
+
if (!_metroSourceMapString) {
|
|
76
|
+
_metroSourceMapString = require('@expo/metro/metro/DeltaBundler/Serializers/sourceMapString');
|
|
70
77
|
}
|
|
71
|
-
return
|
|
72
|
-
isJsModule: _isJsModule
|
|
73
|
-
};
|
|
78
|
+
return _metroSourceMapString;
|
|
74
79
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const column = tuple[1];
|
|
80
|
-
if (tuple.length === 2) {
|
|
81
|
-
generator.addSimpleMapping(line, column);
|
|
82
|
-
} else if (tuple.length === 4) {
|
|
83
|
-
generator.addSourceMapping(line, column, tuple[2], tuple[3]);
|
|
84
|
-
} else {
|
|
85
|
-
generator.addNamedSourceMapping(line, column, tuple[2], tuple[3], tuple[4]);
|
|
86
|
-
}
|
|
80
|
+
let _traceMapping;
|
|
81
|
+
function loadTraceMapping() {
|
|
82
|
+
if (!_traceMapping) {
|
|
83
|
+
_traceMapping = require('@jridgewell/trace-mapping');
|
|
87
84
|
}
|
|
85
|
+
return _traceMapping;
|
|
88
86
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
generator.addSimpleMapping(line, column);
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
const srcCol = buf[off + 3];
|
|
107
|
-
const nameIdx = buf[off + 4];
|
|
108
|
-
if (nameIdx === _packedMap.SENTINEL) {
|
|
109
|
-
generator.addSourceMapping(line, column, srcLine, srcCol);
|
|
110
|
-
} else {
|
|
111
|
-
generator.addNamedSourceMapping(line, column, srcLine, srcCol, names[nameIdx]);
|
|
112
|
-
}
|
|
87
|
+
function flattenSourceMap(map) {
|
|
88
|
+
if (!('sections' in map)) {
|
|
89
|
+
return map;
|
|
90
|
+
}
|
|
91
|
+
const { FlattenMap, encodedMap } = loadTraceMapping();
|
|
92
|
+
const flat = encodedMap(new FlattenMap(map));
|
|
93
|
+
const result = {
|
|
94
|
+
version: flat.version,
|
|
95
|
+
mappings: flat.mappings,
|
|
96
|
+
names: flat.names,
|
|
97
|
+
sources: flat.sources
|
|
98
|
+
};
|
|
99
|
+
if (flat.file != null) {
|
|
100
|
+
result.file = flat.file;
|
|
113
101
|
}
|
|
102
|
+
if (flat.sourcesContent) {
|
|
103
|
+
result.sourcesContent = flat.sourcesContent;
|
|
104
|
+
}
|
|
105
|
+
if (flat.ignoreList && flat.ignoreList.length > 0) {
|
|
106
|
+
result.ignoreList = flat.ignoreList;
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// fast path below doesn't need it.
|
|
123
|
-
let packed = data.data.__packedMap;
|
|
124
|
-
let map;
|
|
125
|
-
if (!packed) {
|
|
126
|
-
map = data.data.map;
|
|
127
|
-
// Self-heal a `SerializableSourceMap` `data.map` that bypassed the wrapper.
|
|
128
|
-
if ((0, _packedMap.isSerializableSourceMap)(map)) {
|
|
129
|
-
packed = _packedMap.PackedMap.deserialize(map);
|
|
130
|
-
map = undefined;
|
|
131
|
-
}
|
|
110
|
+
const NEWLINE = /\r\n?|\n|\u2028|\u2029/g;
|
|
111
|
+
function countLinesAndLastLineColumn(code) {
|
|
112
|
+
let lineCount = 1;
|
|
113
|
+
let lastLineStart = 0;
|
|
114
|
+
for (const match of code.matchAll(NEWLINE)){
|
|
115
|
+
lineCount++;
|
|
116
|
+
lastLineStart = match.index + match[0].length;
|
|
132
117
|
}
|
|
133
118
|
return {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
functionMap: data.data.functionMap,
|
|
137
|
-
isIgnored: options.shouldAddToIgnoreList(module1),
|
|
138
|
-
map,
|
|
139
|
-
packed,
|
|
140
|
-
lineCount: data.data.lineCount
|
|
119
|
+
lineCount,
|
|
120
|
+
lastLineColumn: code.length - lastLineStart
|
|
141
121
|
};
|
|
142
122
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
157
|
-
if (info.packed) {
|
|
158
|
-
feedModuleSegmentsPacked(generator, info.packed, carryOver);
|
|
159
|
-
} else if (Array.isArray(info.map)) {
|
|
160
|
-
// Legacy plain-tuple path — hits for cache entries written before
|
|
161
|
-
// `data.map` switched to `SerializableSourceMap`, and for modules from custom
|
|
162
|
-
// transformers that don't emit packed format.
|
|
163
|
-
feedModuleSegments(generator, info.map, carryOver);
|
|
164
|
-
}
|
|
165
|
-
generator.endFile();
|
|
166
|
-
return carryOver + info.lineCount;
|
|
123
|
+
function vlqMapFromDecodedMap(decodedMap, code) {
|
|
124
|
+
const { lineCount, lastLineColumn } = countLinesAndLastLineColumn(code);
|
|
125
|
+
const map = loadMetroSourceMap().vlqMapFromBabelDecodedMap(decodedMap ?? {
|
|
126
|
+
mappings: [],
|
|
127
|
+
names: []
|
|
128
|
+
}, [
|
|
129
|
+
lineCount,
|
|
130
|
+
lastLineColumn
|
|
131
|
+
]);
|
|
132
|
+
return {
|
|
133
|
+
lineCount,
|
|
134
|
+
map
|
|
135
|
+
};
|
|
167
136
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return out;
|
|
137
|
+
function vlqMapFromEncodedMap(encoded, code) {
|
|
138
|
+
const mappings = loadSourcemapCodec().decode(encoded.mappings);
|
|
139
|
+
return vlqMapFromDecodedMap({
|
|
140
|
+
mappings,
|
|
141
|
+
names: encoded.names
|
|
142
|
+
}, code);
|
|
177
143
|
}
|
|
178
144
|
function appendDebugIdToSourceMap(sourceMap, debugId) {
|
|
179
145
|
return sourceMap.slice(0, -1) + `,"debugId":${JSON.stringify(debugId)}}`;
|
|
180
146
|
}
|
|
181
|
-
function emitGeneratorJson(generator, options) {
|
|
182
|
-
const json = generator.toString(undefined, {
|
|
183
|
-
excludeSource: options.excludeSource
|
|
184
|
-
});
|
|
185
|
-
return options.debugId ? appendDebugIdToSourceMap(json, options.debugId) : json;
|
|
186
|
-
}
|
|
187
147
|
function sourceMapString(modules, options) {
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
let carryOver = 0;
|
|
192
|
-
for (const mod of filtered){
|
|
193
|
-
carryOver = processModuleIntoGenerator(generator, mod, options, carryOver);
|
|
194
|
-
}
|
|
195
|
-
return emitGeneratorJson(generator, options);
|
|
148
|
+
const { debugId, ...generatorOptions } = options;
|
|
149
|
+
const json = loadMetroSourceMapString().sourceMapString(modules, generatorOptions);
|
|
150
|
+
return debugId ? appendDebugIdToSourceMap(json, debugId) : json;
|
|
196
151
|
}
|
|
197
152
|
async function sourceMapStringNonBlocking(modules, options) {
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
const NS_IN_MS = 1_000_000;
|
|
202
|
-
const SLICE_NS = 50 * NS_IN_MS;
|
|
203
|
-
let carryOver = 0;
|
|
204
|
-
let i = 0;
|
|
205
|
-
await new Promise((resolve)=>{
|
|
206
|
-
const tick = ()=>{
|
|
207
|
-
const start = process.hrtime();
|
|
208
|
-
while(i < filtered.length){
|
|
209
|
-
carryOver = processModuleIntoGenerator(generator, filtered[i], options, carryOver);
|
|
210
|
-
i++;
|
|
211
|
-
const diff = process.hrtime(start);
|
|
212
|
-
if (diff[1] > SLICE_NS || diff[0] > 0) {
|
|
213
|
-
setImmediate(tick);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
resolve();
|
|
218
|
-
};
|
|
219
|
-
tick();
|
|
220
|
-
});
|
|
221
|
-
return emitGeneratorJson(generator, options);
|
|
222
|
-
}
|
|
223
|
-
function patchMetroSourceMapStringForPackedMaps() {
|
|
224
|
-
const stock = require('@expo/metro/metro/DeltaBundler/Serializers/sourceMapString');
|
|
225
|
-
stock.sourceMapString = sourceMapString;
|
|
226
|
-
stock.sourceMapStringNonBlocking = sourceMapStringNonBlocking;
|
|
153
|
+
const { debugId, ...generatorOptions } = options;
|
|
154
|
+
const json = await loadMetroSourceMapString().sourceMapStringNonBlocking(modules, generatorOptions);
|
|
155
|
+
return debugId ? appendDebugIdToSourceMap(json, debugId) : json;
|
|
227
156
|
}
|
|
228
157
|
function repairInvalidNegativeIndices(map) {
|
|
229
158
|
const { decode, encode } = loadSourcemapCodec();
|
|
@@ -252,7 +181,8 @@ function composeSourceMaps(maps) {
|
|
|
252
181
|
if (maps.length < 1) {
|
|
253
182
|
throw new Error('composeSourceMaps: Expected at least one map');
|
|
254
183
|
}
|
|
255
|
-
const normalized = maps.map((
|
|
184
|
+
const normalized = maps.map((input)=>{
|
|
185
|
+
const map = flattenSourceMap(input);
|
|
256
186
|
if (map.ignoreList || !map.x_google_ignoreList) {
|
|
257
187
|
return map;
|
|
258
188
|
}
|
|
@@ -309,7 +239,7 @@ function composeSourceMaps(maps) {
|
|
|
309
239
|
}
|
|
310
240
|
// Required by Hermes for bytecode-frame symbolication. Lives on the
|
|
311
241
|
// most-recent map (the Hermes map) and passes through unchanged.
|
|
312
|
-
const last =
|
|
242
|
+
const last = normalized[normalized.length - 1];
|
|
313
243
|
if (last.x_hermes_function_offsets) {
|
|
314
244
|
result.x_hermes_function_offsets = last.x_hermes_function_offsets;
|
|
315
245
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["serializer/sourceMap.ts"],"sourcesContent":[null],"names":["appendDebugIdToSourceMap","composeSourceMaps","
|
|
1
|
+
{"version":3,"sources":["serializer/sourceMap.ts"],"sourcesContent":[null],"names":["appendDebugIdToSourceMap","composeSourceMaps","flattenSourceMap","rawMappingsToEncodedMap","sourceMapString","sourceMapStringNonBlocking","vlqMapFromDecodedMap","vlqMapFromEncodedMap","_remapping","loadRemapping","require","_sourcemapCodec","loadSourcemapCodec","_metroSourceMap","loadMetroSourceMap","_metroSourceMapString","loadMetroSourceMapString","_traceMapping","loadTraceMapping","map","FlattenMap","encodedMap","flat","result","version","mappings","names","sources","file","sourcesContent","ignoreList","length","NEWLINE","countLinesAndLastLineColumn","code","lineCount","lastLineStart","match","matchAll","index","lastLineColumn","decodedMap","vlqMapFromBabelDecodedMap","encoded","decode","sourceMap","debugId","slice","JSON","stringify","modules","options","generatorOptions","json","repairInvalidNegativeIndices","encode","decoded","changed","line","i","segment","maps","Error","normalized","input","x_google_ignoreList","reverse","remap","composed","error","didRepair","fixed","sourceRoot","last","x_hermes_function_offsets","_genMapping","loadGenMapping","opts","GenMapping","addSegment","setSourceContent","toEncodedMap","filename","source","m","rawMappings","genLine","generated","genCol","column","original","name","undefined"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;;;;;;;;;;;QA8MeA;eAAAA;;QA0DAC;eAAAA;;QA1IAC;eAAAA;;QAyPAC;eAAAA;;QArKAC;eAAAA;;QAMMC;eAAAA;;QAzCNC;eAAAA;;QAaAC;eAAAA;;;AA5HhB,IAAIC;AACJ,SAASC;IACP,IAAI,CAACD,YAAY;QACfA,aAAaE,QAAQ;IACvB;IACA,OAAOF;AACT;AAEA,IAAIG;AACJ,SAASC;IACP,IAAI,CAACD,iBAAiB;QACpBA,kBAAkBD,QAAQ;IAC5B;IACA,OAAOC;AACT;AAIA,IAAIE;AACJ,SAASC;IACP,IAAI,CAACD,iBAAiB;QACpBA,kBAAkBH,QAAQ;IAC5B;IACA,OAAOG;AACT;AAKA,IAAIE;AACJ,SAASC;IACP,IAAI,CAACD,uBAAuB;QAC1BA,wBAAwBL,QAAQ;IAClC;IACA,OAAOK;AACT;AAIA,IAAIE;AACJ,SAASC;IACP,IAAI,CAACD,eAAe;QAClBA,gBAAgBP,QAAQ;IAC1B;IACA,OAAOO;AACT;AAiBO,SAASf,iBAAiBiB,GAA2C;IAC1E,IAAI,CAAE,CAAA,cAAcA,GAAE,GAAI;QACxB,OAAOA;IACT;IACA,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAE,GAAGH;IACnC,MAAMI,OAAOD,WACX,IAAID,WAAWD;IAEjB,MAAMI,SAA8B;QAClCC,SAASF,KAAKE,OAAO;QACrBC,UAAUH,KAAKG,QAAQ;QACvBC,OAAOJ,KAAKI,KAAK;QACjBC,SAASL,KAAKK,OA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EAAwE;IACxE,wEAAwE;IACxE,aAAa;IACb,OAAO;QACLK,SAASmB,QAAQnB,OAAO;QACxBI,MAAMe,QAAQf,IAAI,IAAIgE;QACtBnE,UAAUkB,QAAQlB,QAAQ;QAC1BC,OAAOiB,QAAQjB,KAAK;QACpBC,SAAS;YAACkD,KAAKK,QAAQ;SAAC;QACxBrD,gBAAgBc,QAAQd,cAAc;IACxC;AACF"}
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
import { types as t } from '@babel/core';
|
|
12
12
|
import type { JsTransformerConfig, JsTransformOptions } from '@expo/metro/metro-transform-worker';
|
|
13
13
|
import type { ExpoJsOutput } from '../serializer/jsOutput';
|
|
14
|
-
import { type
|
|
15
|
-
import { type BabelSourceMapSegment, type EncodedTransformerSourceMap } from '../serializer/sourceMap';
|
|
14
|
+
import { type BabelSourceMapSegment, type EncodedMappings, type EncodedTransformerSourceMap } from '../serializer/sourceMap';
|
|
16
15
|
import type { CollectedDependencies, Options as CollectDependenciesOptions } from './collect-dependencies';
|
|
17
16
|
import { InvalidRequireCallError as InternalInvalidRequireCallError } from './collect-dependencies';
|
|
18
17
|
import type { ExpoJsTransformerConfig } from './types';
|
|
@@ -28,7 +27,7 @@ export declare class InvalidRequireCallError extends Error {
|
|
|
28
27
|
}
|
|
29
28
|
export declare const minifyCode: (config: Pick<JsTransformerConfig, "minifierPath" | "minifierConfig">, filename: string, code: string, source: string, rawMappings: readonly BabelSourceMapSegment[], reserved?: string[], inputSourceMap?: EncodedTransformerSourceMap) => Promise<{
|
|
30
29
|
code: string;
|
|
31
|
-
|
|
30
|
+
map: EncodedMappings;
|
|
32
31
|
}>;
|
|
33
32
|
export declare function applyImportSupport<TFile extends t.File>(ast: TFile, { filename, options, importDefault, importAll, collectLocations, performConstantFolding, }: {
|
|
34
33
|
filename: string;
|
|
@@ -115,7 +115,7 @@ function _nodeassert() {
|
|
|
115
115
|
};
|
|
116
116
|
return data;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const _ambient = require("../cache-vary/ambient");
|
|
119
119
|
const _sourceMap = require("../serializer/sourceMap");
|
|
120
120
|
const _transformplugins = require("../transform-plugins");
|
|
121
121
|
const _assettransformer = /*#__PURE__*/ _interop_require_wildcard(require("./asset-transformer"));
|
|
@@ -227,10 +227,10 @@ const minifyCode = async (config, filename, code, source, rawMappings, reserved
|
|
|
227
227
|
});
|
|
228
228
|
return {
|
|
229
229
|
code: minified.code,
|
|
230
|
-
|
|
231
|
-
mappings:
|
|
232
|
-
names:
|
|
233
|
-
}
|
|
230
|
+
map: minified.map ?? {
|
|
231
|
+
mappings: '',
|
|
232
|
+
names: []
|
|
233
|
+
}
|
|
234
234
|
};
|
|
235
235
|
} catch (error) {
|
|
236
236
|
if (error.constructor.name === 'JS_Parse_Error') {
|
|
@@ -396,7 +396,7 @@ async function transformJS(file, { config, options }) {
|
|
|
396
396
|
// Add "use strict" if the file was parsed as a module, and the directive did
|
|
397
397
|
// not exist yet.
|
|
398
398
|
applyUseStrictDirective(ast);
|
|
399
|
-
const
|
|
399
|
+
const unstable_useStaticHermesModuleFactory = Boolean(options.customTransformOptions?.unstable_staticHermesOptimizedRequire);
|
|
400
400
|
// NOTE(@hassankhan): Constant folding can be an expensive/slow operation, so we limit it to
|
|
401
401
|
// production builds, or files that have specifically seen a change in their exports
|
|
402
402
|
if (!options.dev || file.performConstantFolding) {
|
|
@@ -473,10 +473,9 @@ async function transformJS(file, { config, options }) {
|
|
|
473
473
|
wrappedAst = ast;
|
|
474
474
|
} else {
|
|
475
475
|
// TODO: Replace this with a cheaper transform that doesn't require AST.
|
|
476
|
-
({ ast: wrappedAst } = _JsFileWrapping().wrapModule(ast, importDefault, importAll, dependencyMapName, config.globalPrefix,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
unstable_renameRequire === false));
|
|
476
|
+
({ ast: wrappedAst } = _JsFileWrapping().wrapModule(ast, importDefault, importAll, dependencyMapName, config.globalPrefix, {
|
|
477
|
+
unstable_useStaticHermesModuleFactory
|
|
478
|
+
}));
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
481
|
const minify = (0, _resolveOptions.shouldMinify)(options);
|
|
@@ -526,19 +525,21 @@ async function transformJS(file, { config, options }) {
|
|
|
526
525
|
})
|
|
527
526
|
]) : null;
|
|
528
527
|
let code = result.code;
|
|
529
|
-
let
|
|
528
|
+
let lineCount;
|
|
529
|
+
let map;
|
|
530
530
|
// NOTE: We might want to enable this on native + hermes when tree shaking is enabled.
|
|
531
531
|
if (minify) {
|
|
532
|
-
|
|
532
|
+
let minifiedMap;
|
|
533
|
+
({ map: minifiedMap, code } = await minifyCode(config, file.filename, result.code, file.code, rawMappings, reserved, generatedSourceMap ? {
|
|
533
534
|
...generatedSourceMap,
|
|
534
535
|
version: 3,
|
|
535
536
|
sources: generatedSourceMap.sources.map((source)=>source ?? file.filename)
|
|
536
537
|
} : undefined));
|
|
538
|
+
({ lineCount, map } = (0, _sourceMap.vlqMapFromEncodedMap)(minifiedMap, code));
|
|
539
|
+
} else if (generatedSourceMap) {
|
|
540
|
+
({ lineCount, map } = (0, _sourceMap.vlqMapFromEncodedMap)(generatedSourceMap, code));
|
|
537
541
|
} else {
|
|
538
|
-
|
|
539
|
-
mappings: generatedSourceMap.mappings,
|
|
540
|
-
names: generatedSourceMap.names
|
|
541
|
-
}) : (0, _packedMap.packRawMappings)(rawMappings);
|
|
542
|
+
({ lineCount, map } = (0, _sourceMap.vlqMapFromDecodedMap)(result?.decodedMap, code));
|
|
542
543
|
}
|
|
543
544
|
const possibleReconcile = optimize && collectDependenciesOptions ? {
|
|
544
545
|
inlineRequires: options.inlineRequires,
|
|
@@ -555,10 +556,8 @@ async function transformJS(file, { config, options }) {
|
|
|
555
556
|
unstable_dependencyMapReservedName: config.unstable_dependencyMapReservedName,
|
|
556
557
|
optimizationSizeLimit: config.optimizationSizeLimit,
|
|
557
558
|
unstable_disableNormalizePseudoGlobals: config.unstable_disableNormalizePseudoGlobals,
|
|
558
|
-
|
|
559
|
+
unstable_useStaticHermesModuleFactory
|
|
559
560
|
} : undefined;
|
|
560
|
-
let lineCount;
|
|
561
|
-
({ lineCount, sourceMap } = (0, _packedMap.countLinesAndTerminateSourceMap)(code, sourceMap));
|
|
562
561
|
// Clean the AST for tree shaking by stripping non-serializable values (Symbols, functions, etc.)
|
|
563
562
|
// that React Compiler and other Babel plugins may add.
|
|
564
563
|
const output = [
|
|
@@ -566,17 +565,18 @@ async function transformJS(file, { config, options }) {
|
|
|
566
565
|
data: {
|
|
567
566
|
code,
|
|
568
567
|
lineCount,
|
|
569
|
-
// Reconcile re-runs Babel codegen and replaces `data.map`
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
568
|
+
// Reconcile re-runs Babel codegen and replaces `data.map` before any reader sees it.
|
|
569
|
+
map: possibleReconcile ? {
|
|
570
|
+
mappings: '',
|
|
571
|
+
names: []
|
|
572
|
+
} : map,
|
|
574
573
|
functionMap: file.functionMap,
|
|
575
574
|
hasCjsExports: file.hasCjsExports,
|
|
576
575
|
reactServerReference: file.reactServerReference,
|
|
577
576
|
reactClientReference: file.reactClientReference,
|
|
578
577
|
expoDomComponentReference: file.expoDomComponentReference,
|
|
579
578
|
loaderReference: file.loaderReference,
|
|
579
|
+
expoCacheVary: await (0, _ambient.embedCurrentFingerprints)(file.cacheVary),
|
|
580
580
|
...possibleReconcile ? {
|
|
581
581
|
ast: wrappedAst,
|
|
582
582
|
// Store settings for the module that will be used to finish transformation after graph-based optimizations
|
|
@@ -661,6 +661,7 @@ function enableExperimentalImportSupportForReactCompiler(context) {
|
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
async function completeFullNoxcturnalTransform(file, context, fullNoxcturnal) {
|
|
664
|
+
const cacheVary = fullNoxcturnal.result.metadata.cacheVary;
|
|
664
665
|
if (String(context.options.customTransformOptions?.optimize) === 'true') {
|
|
665
666
|
return transformJS({
|
|
666
667
|
...file,
|
|
@@ -675,16 +676,19 @@ async function completeFullNoxcturnalTransform(file, context, fullNoxcturnal) {
|
|
|
675
676
|
reactClientReference: typeof fullNoxcturnal.result.metadata.reactClientReference === 'string' ? fullNoxcturnal.result.metadata.reactClientReference : file.reactClientReference,
|
|
676
677
|
expoDomComponentReference: typeof fullNoxcturnal.result.metadata.expoDomComponentReference === 'string' ? fullNoxcturnal.result.metadata.expoDomComponentReference : file.expoDomComponentReference,
|
|
677
678
|
loaderReference: typeof fullNoxcturnal.result.metadata.loaderReference === 'string' ? fullNoxcturnal.result.metadata.loaderReference : file.loaderReference,
|
|
678
|
-
functionMap: fullNoxcturnal.result.functionMap ?? file.functionMap
|
|
679
|
+
functionMap: fullNoxcturnal.result.functionMap ?? file.functionMap,
|
|
680
|
+
cacheVary
|
|
679
681
|
}, context);
|
|
680
682
|
}
|
|
681
683
|
let code = fullNoxcturnal.result.code;
|
|
682
|
-
let
|
|
684
|
+
let lineCount;
|
|
685
|
+
let map;
|
|
683
686
|
if ((0, _resolveOptions.shouldMinify)(context.options)) {
|
|
684
687
|
const reserved = context.config.unstable_dependencyMapReservedName == null ? [] : [
|
|
685
688
|
context.config.unstable_dependencyMapReservedName
|
|
686
689
|
];
|
|
687
|
-
|
|
690
|
+
let minifiedMap;
|
|
691
|
+
({ code, map: minifiedMap } = await minifyCode(context.config, file.filename, code, file.code, [], reserved, {
|
|
688
692
|
version: 3,
|
|
689
693
|
sources: [
|
|
690
694
|
file.filename
|
|
@@ -695,14 +699,10 @@ async function completeFullNoxcturnalTransform(file, context, fullNoxcturnal) {
|
|
|
695
699
|
names: fullNoxcturnal.result.map.names,
|
|
696
700
|
mappings: fullNoxcturnal.result.map.mappings
|
|
697
701
|
}));
|
|
702
|
+
({ lineCount, map } = (0, _sourceMap.vlqMapFromEncodedMap)(minifiedMap, code));
|
|
698
703
|
} else {
|
|
699
|
-
|
|
700
|
-
mappings: fullNoxcturnal.result.map.mappings,
|
|
701
|
-
names: fullNoxcturnal.result.map.names
|
|
702
|
-
});
|
|
704
|
+
({ lineCount, map } = (0, _sourceMap.vlqMapFromEncodedMap)(fullNoxcturnal.result.map, code));
|
|
703
705
|
}
|
|
704
|
-
let lineCount;
|
|
705
|
-
({ lineCount, sourceMap } = (0, _packedMap.countLinesAndTerminateSourceMap)(code, sourceMap));
|
|
706
706
|
return {
|
|
707
707
|
dependencies: fullNoxcturnal.dependencies,
|
|
708
708
|
output: [
|
|
@@ -711,13 +711,14 @@ async function completeFullNoxcturnalTransform(file, context, fullNoxcturnal) {
|
|
|
711
711
|
data: {
|
|
712
712
|
code,
|
|
713
713
|
lineCount,
|
|
714
|
-
map
|
|
714
|
+
map,
|
|
715
715
|
functionMap: fullNoxcturnal.result.functionMap ?? file.functionMap,
|
|
716
716
|
hasCjsExports: typeof fullNoxcturnal.result.metadata.hasCjsExports === 'boolean' ? fullNoxcturnal.result.metadata.hasCjsExports : file.hasCjsExports,
|
|
717
717
|
reactServerReference: typeof fullNoxcturnal.result.metadata.reactServerReference === 'string' ? fullNoxcturnal.result.metadata.reactServerReference : file.reactServerReference,
|
|
718
718
|
reactClientReference: typeof fullNoxcturnal.result.metadata.reactClientReference === 'string' ? fullNoxcturnal.result.metadata.reactClientReference : file.reactClientReference,
|
|
719
719
|
expoDomComponentReference: typeof fullNoxcturnal.result.metadata.expoDomComponentReference === 'string' ? fullNoxcturnal.result.metadata.expoDomComponentReference : file.expoDomComponentReference,
|
|
720
|
-
loaderReference: typeof fullNoxcturnal.result.metadata.loaderReference === 'string' ? fullNoxcturnal.result.metadata.loaderReference : file.loaderReference
|
|
720
|
+
loaderReference: typeof fullNoxcturnal.result.metadata.loaderReference === 'string' ? fullNoxcturnal.result.metadata.loaderReference : file.loaderReference,
|
|
721
|
+
expoCacheVary: await (0, _ambient.embedCurrentFingerprints)(cacheVary)
|
|
721
722
|
}
|
|
722
723
|
}
|
|
723
724
|
]
|
|
@@ -743,16 +744,20 @@ async function transformJSWithBabelFallback(file, context, transformer) {
|
|
|
743
744
|
reactClientReference: metadata?.reactClientReference,
|
|
744
745
|
expoDomComponentReference: metadata?.expoDomComponentReference,
|
|
745
746
|
loaderReference: metadata?.loaderReference,
|
|
746
|
-
performConstantFolding: metadata?.performConstantFolding
|
|
747
|
+
performConstantFolding: metadata?.performConstantFolding,
|
|
748
|
+
cacheVary: metadata?.cacheVary
|
|
747
749
|
};
|
|
748
750
|
return await transformJS(jsFile, context);
|
|
749
751
|
}
|
|
750
752
|
async function transformJSON(file, { options, config }) {
|
|
751
753
|
let code = config.unstable_disableModuleWrapping === true ? _JsFileWrapping().jsonToCommonJS(file.code) : _JsFileWrapping().wrapJson(file.code, config.globalPrefix);
|
|
752
|
-
let
|
|
754
|
+
let encodedMap = {
|
|
755
|
+
mappings: '',
|
|
756
|
+
names: []
|
|
757
|
+
};
|
|
753
758
|
const minify = (0, _resolveOptions.shouldMinify)(options);
|
|
754
759
|
if (minify) {
|
|
755
|
-
({
|
|
760
|
+
({ map: encodedMap, code } = await minifyCode(config, file.filename, code, file.code, []));
|
|
756
761
|
}
|
|
757
762
|
let jsType;
|
|
758
763
|
if (file.type === 'asset') {
|
|
@@ -762,14 +767,13 @@ async function transformJSON(file, { options, config }) {
|
|
|
762
767
|
} else {
|
|
763
768
|
jsType = 'js/module';
|
|
764
769
|
}
|
|
765
|
-
|
|
766
|
-
({ lineCount, sourceMap } = (0, _packedMap.countLinesAndTerminateSourceMap)(code, sourceMap));
|
|
770
|
+
const { lineCount, map } = (0, _sourceMap.vlqMapFromEncodedMap)(encodedMap, code);
|
|
767
771
|
const output = [
|
|
768
772
|
{
|
|
769
773
|
data: {
|
|
770
774
|
code,
|
|
771
775
|
lineCount,
|
|
772
|
-
map
|
|
776
|
+
map,
|
|
773
777
|
functionMap: null
|
|
774
778
|
},
|
|
775
779
|
type: jsType
|
|
@@ -845,7 +849,9 @@ async function transform(config, projectRoot, filename, data, options) {
|
|
|
845
849
|
}
|
|
846
850
|
// NOTE: Increment if cache becomes incompatible (original value would be '')
|
|
847
851
|
// 1. Added new packed source map format
|
|
848
|
-
|
|
852
|
+
// 3. Replaced the packed source map format with Metro's compact `VlqMap`
|
|
853
|
+
// 4. `expoCacheVary` is embedded in cached transform results
|
|
854
|
+
const CACHE_VERSION = '4';
|
|
849
855
|
function getCacheKey(config, opts) {
|
|
850
856
|
const { // The `expo_customTransformerPath` from `./supervising-transform-worker` should not be part of the cache key
|
|
851
857
|
expo_customTransformerPath: _customTransformerPath, babelTransformerPath, minifierPath, ...remainingConfig } = config;
|