@mui/internal-docs-infra 0.2.3-canary.13 → 0.2.3-canary.15
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/README.md +3 -2
- package/esm/pipeline/getFileConventions/fileConventions.d.ts +4 -0
- package/esm/pipeline/getFileConventions/fileConventions.js +4 -0
- package/esm/pipeline/getFileConventions/getFileConventions.d.ts +4 -0
- package/esm/pipeline/getFileConventions/getFileConventions.js +17 -0
- package/esm/pipeline/getFileConventions/index.d.ts +1 -0
- package/esm/pipeline/getFileConventions/index.js +1 -0
- package/esm/pipeline/loadCodeVariant/calculateMainFilePath.js +1 -1
- package/esm/pipeline/loadCodeVariant/loadCodeFallback.js +164 -90
- package/esm/pipeline/loadCodeVariant/loadCodeVariant.js +111 -38
- package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +5 -0
- package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +80 -7
- package/esm/pipeline/loadPrecomputedCodeHighlighter/performanceLogger.d.ts +30 -0
- package/esm/pipeline/loadPrecomputedCodeHighlighter/performanceLogger.js +77 -0
- package/esm/pipeline/transformMarkdownBlockquoteCallouts/index.d.ts +2 -0
- package/esm/pipeline/transformMarkdownBlockquoteCallouts/index.js +4 -0
- package/esm/pipeline/transformMarkdownBlockquoteCallouts/transformMarkdownBlockquoteCallouts.d.ts +16 -0
- package/esm/pipeline/transformMarkdownBlockquoteCallouts/transformMarkdownBlockquoteCallouts.js +58 -0
- package/esm/pipeline/transformMarkdownDemoLinks/index.d.ts +2 -0
- package/esm/pipeline/transformMarkdownDemoLinks/index.js +4 -0
- package/esm/pipeline/transformMarkdownDemoLinks/transformMarkdownDemoLinks.d.ts +26 -0
- package/esm/pipeline/transformMarkdownDemoLinks/transformMarkdownDemoLinks.js +107 -0
- package/esm/pipeline/transformMarkdownRelativePaths/index.d.ts +2 -0
- package/esm/pipeline/transformMarkdownRelativePaths/index.js +4 -0
- package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.d.ts +13 -0
- package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.js +35 -0
- package/esm/useCode/Pre.js +8 -1
- package/esm/useCopier/index.js +5 -4
- package/esm/useErrors/useErrors.d.ts +1 -1
- package/esm/useErrors/useErrors.js +6 -2
- package/esm/withDocsInfra/withDocsInfra.d.ts +8 -0
- package/esm/withDocsInfra/withDocsInfra.js +31 -5
- package/package.json +26 -2
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ This package hosts the tools that help create the documentation.
|
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
This is stored in the `docs` directory.
|
|
7
|
+
This is stored in the `docs` top-level directory.
|
|
8
8
|
|
|
9
|
-
[Read
|
|
9
|
+
[Read in Markdown](../../docs/app/docs-infra/page.mdx)
|
|
10
|
+
[Read in Browser](https://infra.mui.com/docs-infra)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _regenerator from "@babel/runtime/helpers/esm/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import { fileConventions } from "./fileConventions.js";
|
|
4
|
+
export function getFileConventions() {
|
|
5
|
+
return _getFileConventions.apply(this, arguments);
|
|
6
|
+
}
|
|
7
|
+
function _getFileConventions() {
|
|
8
|
+
_getFileConventions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
9
|
+
return _regenerator().w(function (_context) {
|
|
10
|
+
while (1) switch (_context.n) {
|
|
11
|
+
case 0:
|
|
12
|
+
return _context.a(2, fileConventions);
|
|
13
|
+
}
|
|
14
|
+
}, _callee);
|
|
15
|
+
}));
|
|
16
|
+
return _getFileConventions.apply(this, arguments);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getFileConventions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./getFileConventions.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import { createSyntheticDirectories, buildPath } from
|
|
2
|
+
import { createSyntheticDirectories, buildPath } from "./pathUtils.js";
|
|
3
3
|
export function calculateMainFilePath(url, maxBackNav, maxSourceBackNav, metadataPrefix, fileName) {
|
|
4
4
|
// Handle optional parameters with defaults
|
|
5
5
|
var actualMaxSourceBackNav = maxSourceBackNav != null ? maxSourceBackNav : maxBackNav;
|
|
@@ -6,6 +6,7 @@ import _regenerator from "@babel/runtime/helpers/esm/regenerator";
|
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
7
|
import { loadCodeVariant } from "./loadCodeVariant.js";
|
|
8
8
|
import { getFileNameFromUrl } from "../loaderUtils/index.js";
|
|
9
|
+
import { performanceMeasure } from "../loadPrecomputedCodeHighlighter/performanceLogger.js";
|
|
9
10
|
|
|
10
11
|
// Helper function to get the source for a specific filename from a variant
|
|
11
12
|
function getFileSource(_x, _x2, _x3) {
|
|
@@ -100,6 +101,8 @@ function _loadCodeFallback() {
|
|
|
100
101
|
variants,
|
|
101
102
|
globalsCode,
|
|
102
103
|
output,
|
|
104
|
+
functionName,
|
|
105
|
+
currentMark,
|
|
103
106
|
initial,
|
|
104
107
|
_allFileNames,
|
|
105
108
|
fileSource,
|
|
@@ -107,11 +110,13 @@ function _loadCodeFallback() {
|
|
|
107
110
|
result,
|
|
108
111
|
parseSource,
|
|
109
112
|
quickVariant,
|
|
113
|
+
beforeInitialVariantMark,
|
|
110
114
|
_allFileNames2,
|
|
111
115
|
_fileSource,
|
|
112
116
|
_actualFilename,
|
|
113
117
|
_result,
|
|
114
118
|
_parseSource,
|
|
119
|
+
beforeGlobalsMark,
|
|
115
120
|
globalsCodeObjects,
|
|
116
121
|
hasStringUrls,
|
|
117
122
|
globalsPromises,
|
|
@@ -123,6 +128,7 @@ function _loadCodeFallback() {
|
|
|
123
128
|
_yield$loadCodeVarian,
|
|
124
129
|
loadedVariant,
|
|
125
130
|
allFileNames,
|
|
131
|
+
beforeAllVariantMark,
|
|
126
132
|
allVariants,
|
|
127
133
|
variantPromises,
|
|
128
134
|
variantResults,
|
|
@@ -145,11 +151,14 @@ function _loadCodeFallback() {
|
|
|
145
151
|
options = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {};
|
|
146
152
|
shouldHighlight = options.shouldHighlight, fallbackUsesExtraFiles = options.fallbackUsesExtraFiles, fallbackUsesAllVariants = options.fallbackUsesAllVariants, sourceParser = options.sourceParser, loadSource = options.loadSource, loadVariantMeta = options.loadVariantMeta, loadCodeMeta = options.loadCodeMeta, initialFilename = options.initialFilename, variants = options.variants, globalsCode = options.globalsCode, output = options.output;
|
|
147
153
|
loaded = _extends({}, loaded);
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
functionName = 'Load Fallback Code';
|
|
155
|
+
currentMark = performanceMeasure(undefined, {
|
|
156
|
+
mark: 'Start',
|
|
157
|
+
measure: 'Start'
|
|
158
|
+
}, [functionName, url], true); // Step 1: Ensure we have the initial variant loaded
|
|
150
159
|
initial = loaded[initialVariant];
|
|
151
160
|
if (initial) {
|
|
152
|
-
_context4.n =
|
|
161
|
+
_context4.n = 6;
|
|
153
162
|
break;
|
|
154
163
|
}
|
|
155
164
|
if (loadCodeMeta) {
|
|
@@ -177,8 +186,13 @@ function _loadCodeFallback() {
|
|
|
177
186
|
}
|
|
178
187
|
throw new Error("Initial variant \"".concat(initialVariant, "\" not found in loaded code."));
|
|
179
188
|
case 5:
|
|
189
|
+
currentMark = performanceMeasure(currentMark, {
|
|
190
|
+
mark: 'Loaded Code Meta',
|
|
191
|
+
measure: 'Code Meta Loading'
|
|
192
|
+
}, [functionName, url]);
|
|
193
|
+
case 6:
|
|
180
194
|
if (!(typeof initial !== 'string' && initial.allFilesListed && !fallbackUsesExtraFiles && !fallbackUsesAllVariants)) {
|
|
181
|
-
_context4.n =
|
|
195
|
+
_context4.n = 17;
|
|
182
196
|
break;
|
|
183
197
|
}
|
|
184
198
|
// Collect all file names from the loaded code
|
|
@@ -193,40 +207,50 @@ function _loadCodeFallback() {
|
|
|
193
207
|
}
|
|
194
208
|
|
|
195
209
|
// Get the source for the requested filename (or main file if not specified)
|
|
196
|
-
_context4.p =
|
|
197
|
-
_context4.n =
|
|
210
|
+
_context4.p = 7;
|
|
211
|
+
_context4.n = 8;
|
|
198
212
|
return getFileSource(initial, initialFilename, loadSource);
|
|
199
|
-
case
|
|
213
|
+
case 8:
|
|
200
214
|
result = _context4.v;
|
|
201
215
|
fileSource = result.source;
|
|
202
216
|
actualFilename = result.filename;
|
|
203
|
-
_context4.n =
|
|
217
|
+
_context4.n = 10;
|
|
204
218
|
break;
|
|
205
|
-
case
|
|
206
|
-
_context4.p =
|
|
219
|
+
case 9:
|
|
220
|
+
_context4.p = 9;
|
|
207
221
|
_t5 = _context4.v;
|
|
208
222
|
throw new Error("Failed to get source for file ".concat(initialFilename || initial.fileName, " in variant ").concat(initialVariant, ": ").concat(_t5));
|
|
209
|
-
case
|
|
223
|
+
case 10:
|
|
224
|
+
currentMark = performanceMeasure(currentMark, {
|
|
225
|
+
mark: 'Loaded Main File',
|
|
226
|
+
measure: 'Main File Loading'
|
|
227
|
+
}, [functionName, url]);
|
|
228
|
+
|
|
229
|
+
// If we need highlighting and have a string source, parse it
|
|
210
230
|
if (!(shouldHighlight && typeof fileSource === 'string' && sourceParser && actualFilename)) {
|
|
211
|
-
_context4.n =
|
|
231
|
+
_context4.n = 15;
|
|
212
232
|
break;
|
|
213
233
|
}
|
|
214
|
-
_context4.p =
|
|
215
|
-
_context4.n =
|
|
234
|
+
_context4.p = 11;
|
|
235
|
+
_context4.n = 12;
|
|
216
236
|
return sourceParser;
|
|
217
|
-
case
|
|
237
|
+
case 12:
|
|
218
238
|
parseSource = _context4.v;
|
|
219
239
|
fileSource = parseSource(fileSource, actualFilename);
|
|
220
|
-
_context4.n =
|
|
240
|
+
_context4.n = 14;
|
|
221
241
|
break;
|
|
222
|
-
case
|
|
223
|
-
_context4.p =
|
|
242
|
+
case 13:
|
|
243
|
+
_context4.p = 13;
|
|
224
244
|
_t6 = _context4.v;
|
|
225
245
|
throw new Error("Failed to parse source for highlighting (variant: ".concat(initialVariant, ", file: ").concat(actualFilename, "): ").concat(JSON.stringify(_t6)));
|
|
226
|
-
case 13:
|
|
227
|
-
_context4.n = 15;
|
|
228
|
-
break;
|
|
229
246
|
case 14:
|
|
247
|
+
currentMark = performanceMeasure(currentMark, {
|
|
248
|
+
mark: 'Parsed Main File',
|
|
249
|
+
measure: 'Main File Parsing'
|
|
250
|
+
}, [functionName, url]);
|
|
251
|
+
_context4.n = 16;
|
|
252
|
+
break;
|
|
253
|
+
case 15:
|
|
230
254
|
if (shouldHighlight && typeof fileSource === 'string' && !actualFilename) {
|
|
231
255
|
// Create basic HAST node when we can't parse due to missing filename
|
|
232
256
|
// This marks that the source has passed through the parsing pipeline
|
|
@@ -238,7 +262,7 @@ function _loadCodeFallback() {
|
|
|
238
262
|
}]
|
|
239
263
|
};
|
|
240
264
|
}
|
|
241
|
-
case
|
|
265
|
+
case 16:
|
|
242
266
|
// Update the loaded code with any changes we made
|
|
243
267
|
if (actualFilename && actualFilename === initial.fileName) {
|
|
244
268
|
initial = _extends(_extends({}, initial), {}, {
|
|
@@ -261,35 +285,40 @@ function _loadCodeFallback() {
|
|
|
261
285
|
initialExtraFiles: initial.extraFiles || {},
|
|
262
286
|
allFileNames: Array.from(_allFileNames)
|
|
263
287
|
});
|
|
264
|
-
case
|
|
288
|
+
case 17:
|
|
265
289
|
if (!(typeof initial === 'string')) {
|
|
266
|
-
_context4.n =
|
|
290
|
+
_context4.n = 34;
|
|
267
291
|
break;
|
|
268
292
|
}
|
|
269
|
-
_context4.p =
|
|
293
|
+
_context4.p = 18;
|
|
270
294
|
if (!loadVariantMeta) {
|
|
271
|
-
_context4.n =
|
|
295
|
+
_context4.n = 20;
|
|
272
296
|
break;
|
|
273
297
|
}
|
|
274
|
-
_context4.n =
|
|
298
|
+
_context4.n = 19;
|
|
275
299
|
return loadVariantMeta(initialVariant, initial);
|
|
276
|
-
case
|
|
300
|
+
case 19:
|
|
277
301
|
quickVariant = _context4.v;
|
|
278
|
-
|
|
302
|
+
currentMark = performanceMeasure(currentMark, {
|
|
303
|
+
mark: 'Loaded Initial Variant Meta',
|
|
304
|
+
measure: 'Initial Variant Meta Loading'
|
|
305
|
+
}, [functionName, url]);
|
|
306
|
+
_context4.n = 21;
|
|
279
307
|
break;
|
|
280
|
-
case
|
|
308
|
+
case 20:
|
|
281
309
|
// Create a basic variant using fallback logic
|
|
282
310
|
quickVariant = {
|
|
283
311
|
url: initial,
|
|
284
312
|
fileName: getFileNameFromUrl(initial).fileName
|
|
285
313
|
};
|
|
286
|
-
case
|
|
314
|
+
case 21:
|
|
315
|
+
beforeInitialVariantMark = currentMark;
|
|
287
316
|
loaded = _extends(_extends({}, loaded), {}, _defineProperty({}, initialVariant, quickVariant));
|
|
288
317
|
initial = quickVariant;
|
|
289
318
|
|
|
290
319
|
// If we have all files listed and don't need extra file processing, we can optimize
|
|
291
320
|
if (!(quickVariant.allFilesListed && !fallbackUsesExtraFiles && !fallbackUsesAllVariants)) {
|
|
292
|
-
_context4.n =
|
|
321
|
+
_context4.n = 32;
|
|
293
322
|
break;
|
|
294
323
|
}
|
|
295
324
|
// Collect all file names from the quick load
|
|
@@ -304,40 +333,48 @@ function _loadCodeFallback() {
|
|
|
304
333
|
}
|
|
305
334
|
|
|
306
335
|
// Get the source for the requested filename (or main file if not specified)
|
|
307
|
-
_context4.p =
|
|
308
|
-
_context4.n =
|
|
336
|
+
_context4.p = 22;
|
|
337
|
+
_context4.n = 23;
|
|
309
338
|
return getFileSource(quickVariant, initialFilename, loadSource);
|
|
310
|
-
case
|
|
339
|
+
case 23:
|
|
311
340
|
_result = _context4.v;
|
|
312
341
|
_fileSource = _result.source;
|
|
313
342
|
_actualFilename = _result.filename;
|
|
314
|
-
|
|
343
|
+
currentMark = performanceMeasure(currentMark, {
|
|
344
|
+
mark: 'Loaded Initial File',
|
|
345
|
+
measure: 'Initial File Loading'
|
|
346
|
+
}, [functionName, initialFilename || 'unknown', url]);
|
|
347
|
+
_context4.n = 25;
|
|
315
348
|
break;
|
|
316
|
-
case
|
|
317
|
-
_context4.p =
|
|
349
|
+
case 24:
|
|
350
|
+
_context4.p = 24;
|
|
318
351
|
_t7 = _context4.v;
|
|
319
352
|
throw new Error("Failed to get source for file ".concat(initialFilename || quickVariant.fileName, " in variant ").concat(initialVariant, ": ").concat(_t7));
|
|
320
|
-
case
|
|
353
|
+
case 25:
|
|
321
354
|
if (!(shouldHighlight && typeof _fileSource === 'string' && sourceParser && _actualFilename)) {
|
|
322
|
-
_context4.n =
|
|
355
|
+
_context4.n = 30;
|
|
323
356
|
break;
|
|
324
357
|
}
|
|
325
|
-
_context4.p =
|
|
326
|
-
_context4.n =
|
|
358
|
+
_context4.p = 26;
|
|
359
|
+
_context4.n = 27;
|
|
327
360
|
return sourceParser;
|
|
328
|
-
case
|
|
361
|
+
case 27:
|
|
329
362
|
_parseSource = _context4.v;
|
|
330
363
|
_fileSource = _parseSource(_fileSource, _actualFilename);
|
|
331
|
-
|
|
364
|
+
currentMark = performanceMeasure(currentMark, {
|
|
365
|
+
mark: 'Parsed Initial File',
|
|
366
|
+
measure: 'Initial File Parsing'
|
|
367
|
+
}, [functionName, initialFilename || 'unknown', url]);
|
|
368
|
+
_context4.n = 29;
|
|
332
369
|
break;
|
|
333
|
-
case
|
|
334
|
-
_context4.p =
|
|
370
|
+
case 28:
|
|
371
|
+
_context4.p = 28;
|
|
335
372
|
_t8 = _context4.v;
|
|
336
373
|
throw new Error("Failed to parse source for highlighting (variant: ".concat(initialVariant, ", file: ").concat(_actualFilename, "): ").concat(JSON.stringify(_t8)));
|
|
337
|
-
case 28:
|
|
338
|
-
_context4.n = 30;
|
|
339
|
-
break;
|
|
340
374
|
case 29:
|
|
375
|
+
_context4.n = 31;
|
|
376
|
+
break;
|
|
377
|
+
case 30:
|
|
341
378
|
if (shouldHighlight && typeof _fileSource === 'string' && !_actualFilename) {
|
|
342
379
|
// Create basic HAST node when we can't parse due to missing filename
|
|
343
380
|
// This marks that the source has passed through the parsing pipeline
|
|
@@ -349,7 +386,7 @@ function _loadCodeFallback() {
|
|
|
349
386
|
}]
|
|
350
387
|
};
|
|
351
388
|
}
|
|
352
|
-
case
|
|
389
|
+
case 31:
|
|
353
390
|
// Update the loaded code with any changes we made
|
|
354
391
|
if (_actualFilename && _actualFilename === quickVariant.fileName) {
|
|
355
392
|
initial = _extends(_extends({}, quickVariant), {}, {
|
|
@@ -363,6 +400,10 @@ function _loadCodeFallback() {
|
|
|
363
400
|
});
|
|
364
401
|
loaded = _extends(_extends({}, loaded), {}, _defineProperty({}, initialVariant, initial));
|
|
365
402
|
}
|
|
403
|
+
currentMark = performanceMeasure(beforeInitialVariantMark, {
|
|
404
|
+
mark: 'Loaded Initial Files',
|
|
405
|
+
measure: 'Initial Files Loading'
|
|
406
|
+
}, [functionName, url], true);
|
|
366
407
|
|
|
367
408
|
// Early return - we have all the info we need
|
|
368
409
|
return _context4.a(2, {
|
|
@@ -372,31 +413,33 @@ function _loadCodeFallback() {
|
|
|
372
413
|
initialExtraFiles: quickVariant.extraFiles || {},
|
|
373
414
|
allFileNames: Array.from(_allFileNames2)
|
|
374
415
|
});
|
|
375
|
-
case 31:
|
|
376
|
-
_context4.n = 33;
|
|
377
|
-
break;
|
|
378
416
|
case 32:
|
|
379
|
-
_context4.
|
|
417
|
+
_context4.n = 34;
|
|
418
|
+
break;
|
|
419
|
+
case 33:
|
|
420
|
+
_context4.p = 33;
|
|
380
421
|
_t9 = _context4.v;
|
|
381
422
|
throw new Error("Failed to load initial variant code (variant: ".concat(initialVariant, ", url: ").concat(initial, "): ").concat(JSON.stringify(_t9)));
|
|
382
|
-
case
|
|
423
|
+
case 34:
|
|
424
|
+
beforeGlobalsMark = currentMark; // Step 2b: Fall back to full loadCodeVariant processing
|
|
425
|
+
// Load globalsCode - convert string URLs to Code objects, keep Code objects as-is
|
|
383
426
|
if (!(globalsCode && globalsCode.length > 0)) {
|
|
384
|
-
_context4.n =
|
|
427
|
+
_context4.n = 37;
|
|
385
428
|
break;
|
|
386
429
|
}
|
|
387
430
|
hasStringUrls = globalsCode.some(function (item) {
|
|
388
431
|
return typeof item === 'string';
|
|
389
432
|
});
|
|
390
433
|
if (!(hasStringUrls && !loadCodeMeta)) {
|
|
391
|
-
_context4.n =
|
|
434
|
+
_context4.n = 35;
|
|
392
435
|
break;
|
|
393
436
|
}
|
|
394
437
|
throw new Error('loadCodeMeta function is required when globalsCode contains string URLs');
|
|
395
|
-
case
|
|
438
|
+
case 35:
|
|
396
439
|
// Load all string URLs in parallel, keep Code objects as-is
|
|
397
440
|
globalsPromises = globalsCode.map(/*#__PURE__*/function () {
|
|
398
441
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(globalItem) {
|
|
399
|
-
var _t;
|
|
442
|
+
var codeMeta, _t;
|
|
400
443
|
return _regenerator().w(function (_context2) {
|
|
401
444
|
while (1) switch (_context2.p = _context2.n) {
|
|
402
445
|
case 0:
|
|
@@ -408,7 +451,12 @@ function _loadCodeFallback() {
|
|
|
408
451
|
_context2.n = 2;
|
|
409
452
|
return loadCodeMeta(globalItem);
|
|
410
453
|
case 2:
|
|
411
|
-
|
|
454
|
+
codeMeta = _context2.v;
|
|
455
|
+
currentMark = performanceMeasure(currentMark, {
|
|
456
|
+
mark: 'Loaded Global Code Meta',
|
|
457
|
+
measure: 'Global Code Meta Loading'
|
|
458
|
+
}, [functionName, globalItem, url]);
|
|
459
|
+
return _context2.a(2, codeMeta);
|
|
412
460
|
case 3:
|
|
413
461
|
_context2.p = 3;
|
|
414
462
|
_t = _context2.v;
|
|
@@ -424,11 +472,15 @@ function _loadCodeFallback() {
|
|
|
424
472
|
return _ref.apply(this, arguments);
|
|
425
473
|
};
|
|
426
474
|
}());
|
|
427
|
-
_context4.n =
|
|
475
|
+
_context4.n = 36;
|
|
428
476
|
return Promise.all(globalsPromises);
|
|
429
|
-
case 35:
|
|
430
|
-
globalsCodeObjects = _context4.v;
|
|
431
477
|
case 36:
|
|
478
|
+
globalsCodeObjects = _context4.v;
|
|
479
|
+
currentMark = performanceMeasure(beforeGlobalsMark, {
|
|
480
|
+
mark: 'Loaded Globals Meta',
|
|
481
|
+
measure: 'Globals Meta Loading'
|
|
482
|
+
}, [functionName, url], true);
|
|
483
|
+
case 37:
|
|
432
484
|
if (globalsCodeObjects && globalsCodeObjects.length > 0) {
|
|
433
485
|
resolvedGlobalsCode = [];
|
|
434
486
|
_iterator = _createForOfIteratorHelper(globalsCodeObjects);
|
|
@@ -447,8 +499,8 @@ function _loadCodeFallback() {
|
|
|
447
499
|
_iterator.f();
|
|
448
500
|
}
|
|
449
501
|
}
|
|
450
|
-
_context4.p =
|
|
451
|
-
_context4.n =
|
|
502
|
+
_context4.p = 38;
|
|
503
|
+
_context4.n = 39;
|
|
452
504
|
return loadCodeVariant(url, initialVariant, initial, {
|
|
453
505
|
sourceParser: sourceParser,
|
|
454
506
|
loadSource: loadSource,
|
|
@@ -463,19 +515,24 @@ function _loadCodeFallback() {
|
|
|
463
515
|
// Pass resolved globalsCode
|
|
464
516
|
output: output
|
|
465
517
|
});
|
|
466
|
-
case
|
|
518
|
+
case 39:
|
|
467
519
|
_yield$loadCodeVarian = _context4.v;
|
|
468
520
|
loadedVariant = _yield$loadCodeVarian.code;
|
|
521
|
+
currentMark = performanceMeasure(currentMark, {
|
|
522
|
+
mark: 'Loaded Initial Variant',
|
|
523
|
+
measure: 'Initial Variant Loading'
|
|
524
|
+
}, [functionName, url], true);
|
|
525
|
+
|
|
469
526
|
// Update the loaded code with the processed variant
|
|
470
527
|
loaded = _extends(_extends({}, loaded), {}, _defineProperty({}, initialVariant, loadedVariant));
|
|
471
528
|
initial = loadedVariant;
|
|
472
|
-
_context4.n =
|
|
529
|
+
_context4.n = 41;
|
|
473
530
|
break;
|
|
474
|
-
case
|
|
475
|
-
_context4.p =
|
|
531
|
+
case 40:
|
|
532
|
+
_context4.p = 40;
|
|
476
533
|
_t0 = _context4.v;
|
|
477
534
|
throw new Error("Failed to load initial variant using loadCodeVariant (variant: ".concat(initialVariant, ", url: ").concat(url, "): ").concat(JSON.stringify(_t0)));
|
|
478
|
-
case
|
|
535
|
+
case 41:
|
|
479
536
|
// Step 3: Collect all file names
|
|
480
537
|
allFileNames = new Set();
|
|
481
538
|
if (initial.fileName) {
|
|
@@ -491,19 +548,19 @@ function _loadCodeFallback() {
|
|
|
491
548
|
|
|
492
549
|
// Step 4: Handle fallbackUsesAllVariants - load all variants to get all possible files
|
|
493
550
|
if (!fallbackUsesAllVariants) {
|
|
494
|
-
_context4.n =
|
|
551
|
+
_context4.n = 45;
|
|
495
552
|
break;
|
|
496
553
|
}
|
|
497
|
-
// Determine all variants to process - use provided variants or infer from loaded code
|
|
554
|
+
beforeAllVariantMark = currentMark; // Determine all variants to process - use provided variants or infer from loaded code
|
|
498
555
|
allVariants = variants || Object.keys(loaded || {});
|
|
499
556
|
if (!(allVariants.length === 0)) {
|
|
500
|
-
_context4.n =
|
|
557
|
+
_context4.n = 42;
|
|
501
558
|
break;
|
|
502
559
|
}
|
|
503
560
|
console.warn('No variants found for fallbackUsesAllVariants processing');
|
|
504
|
-
_context4.n =
|
|
561
|
+
_context4.n = 44;
|
|
505
562
|
break;
|
|
506
|
-
case
|
|
563
|
+
case 42:
|
|
507
564
|
// Process all required variants, not just the ones already loaded
|
|
508
565
|
variantPromises = allVariants.map(/*#__PURE__*/function () {
|
|
509
566
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(variantName) {
|
|
@@ -535,6 +592,10 @@ function _loadCodeFallback() {
|
|
|
535
592
|
variant = allCode[variantName];
|
|
536
593
|
// Update loaded with all variants from loadCodeMeta
|
|
537
594
|
loaded = _extends(_extends({}, loaded), allCode);
|
|
595
|
+
currentMark = performanceMeasure(currentMark, {
|
|
596
|
+
mark: 'Loaded Initial Code Meta',
|
|
597
|
+
measure: 'Initial Code Meta Loading'
|
|
598
|
+
}, [functionName, url]);
|
|
538
599
|
_context3.n = 5;
|
|
539
600
|
break;
|
|
540
601
|
case 4:
|
|
@@ -599,6 +660,10 @@ function _loadCodeFallback() {
|
|
|
599
660
|
if (_loadedVariant.extraFiles) {
|
|
600
661
|
fileNames.push.apply(fileNames, _toConsumableArray(Object.keys(_loadedVariant.extraFiles)));
|
|
601
662
|
}
|
|
663
|
+
currentMark = performanceMeasure(currentMark, {
|
|
664
|
+
mark: 'Loaded Initial Variant',
|
|
665
|
+
measure: 'Initial Variant Loading'
|
|
666
|
+
}, [functionName, variantName, url], true);
|
|
602
667
|
return _context3.a(2, {
|
|
603
668
|
variantName: variantName,
|
|
604
669
|
loadedVariant: _loadedVariant,
|
|
@@ -621,9 +686,9 @@ function _loadCodeFallback() {
|
|
|
621
686
|
return _ref2.apply(this, arguments);
|
|
622
687
|
};
|
|
623
688
|
}());
|
|
624
|
-
_context4.n =
|
|
689
|
+
_context4.n = 43;
|
|
625
690
|
return Promise.all(variantPromises);
|
|
626
|
-
case
|
|
691
|
+
case 43:
|
|
627
692
|
variantResults = _context4.v;
|
|
628
693
|
// Update loaded code and collect file names
|
|
629
694
|
variantResults.forEach(function (_ref3) {
|
|
@@ -637,37 +702,46 @@ function _loadCodeFallback() {
|
|
|
637
702
|
return allFileNames.add(fileName);
|
|
638
703
|
});
|
|
639
704
|
});
|
|
640
|
-
case
|
|
705
|
+
case 44:
|
|
706
|
+
currentMark = performanceMeasure(beforeAllVariantMark, {
|
|
707
|
+
mark: 'Loaded Initial Variants',
|
|
708
|
+
measure: 'Initial Variants Loading'
|
|
709
|
+
}, [functionName, url], true);
|
|
710
|
+
case 45:
|
|
641
711
|
// Ensure we have the latest initial variant data
|
|
642
712
|
finalInitial = loaded[initialVariant];
|
|
643
713
|
if (!(!finalInitial || typeof finalInitial === 'string')) {
|
|
644
|
-
_context4.n =
|
|
714
|
+
_context4.n = 46;
|
|
645
715
|
break;
|
|
646
716
|
}
|
|
647
717
|
throw new Error("Failed to process initial variant: ".concat(initialVariant));
|
|
648
|
-
case
|
|
649
|
-
_context4.p =
|
|
650
|
-
_context4.n =
|
|
718
|
+
case 46:
|
|
719
|
+
_context4.p = 46;
|
|
720
|
+
_context4.n = 47;
|
|
651
721
|
return getFileSource(finalInitial, initialFilename, loadSource);
|
|
652
|
-
case
|
|
722
|
+
case 47:
|
|
653
723
|
_result2 = _context4.v;
|
|
654
724
|
finalFileSource = _result2.source;
|
|
655
725
|
finalFilename = _result2.filename;
|
|
656
|
-
_context4.n =
|
|
726
|
+
_context4.n = 50;
|
|
657
727
|
break;
|
|
658
|
-
case
|
|
659
|
-
_context4.p =
|
|
728
|
+
case 48:
|
|
729
|
+
_context4.p = 48;
|
|
660
730
|
_t1 = _context4.v;
|
|
661
731
|
if (!(!finalInitial.fileName && !finalInitial.source)) {
|
|
662
|
-
_context4.n =
|
|
732
|
+
_context4.n = 49;
|
|
663
733
|
break;
|
|
664
734
|
}
|
|
665
735
|
throw new Error("Cannot determine filename for initial variant \"".concat(initialVariant, "\". ") + "No fileName available in variant definition, no initialFilename provided, and no source available.");
|
|
666
|
-
case
|
|
736
|
+
case 49:
|
|
667
737
|
// Fall back to the main file with proper validation
|
|
668
738
|
finalFileSource = finalInitial.source || '';
|
|
669
739
|
finalFilename = finalInitial.fileName;
|
|
670
|
-
case
|
|
740
|
+
case 50:
|
|
741
|
+
currentMark = performanceMeasure(currentMark, {
|
|
742
|
+
mark: 'Loaded Initial File',
|
|
743
|
+
measure: 'Initial File Loading'
|
|
744
|
+
}, [functionName, url]);
|
|
671
745
|
return _context4.a(2, {
|
|
672
746
|
code: loaded,
|
|
673
747
|
initialFilename: finalFilename,
|
|
@@ -677,7 +751,7 @@ function _loadCodeFallback() {
|
|
|
677
751
|
processedGlobalsCode: globalsCodeObjects
|
|
678
752
|
});
|
|
679
753
|
}
|
|
680
|
-
}, _callee4, null, [[
|
|
754
|
+
}, _callee4, null, [[46, 48], [38, 40], [26, 28], [22, 24], [18, 33], [11, 13], [7, 9], [1, 3]]);
|
|
681
755
|
}));
|
|
682
756
|
return _loadCodeFallback.apply(this, arguments);
|
|
683
757
|
}
|