@absolutejs/absolute 0.19.0-beta.782 → 0.19.0-beta.783
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/dist/angular/index.js +118 -31
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +118 -31
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +159 -40
- package/dist/build.js.map +5 -5
- package/dist/cli/index.js +6 -3
- package/dist/index.js +165 -43
- package/dist/index.js.map +6 -6
- package/dist/islands/index.js +118 -31
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +118 -31
- package/dist/react/index.js.map +3 -3
- package/dist/src/build/stylePreprocessor.d.ts +3 -0
- package/dist/svelte/index.js +118 -31
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +118 -31
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +118 -31
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -656,7 +656,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
656
656
|
}
|
|
657
657
|
return links;
|
|
658
658
|
}, fetchRoute = async (baseUrl, path) => {
|
|
659
|
-
const res = await fetch(`${baseUrl}${path}
|
|
659
|
+
const res = await fetch(`${baseUrl}${path}`, { redirect: "manual" });
|
|
660
660
|
if (!res.ok)
|
|
661
661
|
return null;
|
|
662
662
|
const contentType = res.headers.get("content-type") ?? "";
|
|
@@ -691,7 +691,8 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
691
691
|
}, rerenderRoute = async (route, port, prerenderDir) => {
|
|
692
692
|
try {
|
|
693
693
|
const res = await fetch(`http://localhost:${port}${route}`, {
|
|
694
|
-
headers: { [PRERENDER_BYPASS_HEADER]: "1" }
|
|
694
|
+
headers: { [PRERENDER_BYPASS_HEADER]: "1" },
|
|
695
|
+
redirect: "manual"
|
|
695
696
|
});
|
|
696
697
|
if (!res.ok)
|
|
697
698
|
return false;
|
|
@@ -705,7 +706,9 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
705
706
|
return false;
|
|
706
707
|
}
|
|
707
708
|
}, prerenderRoute = async (baseUrl, route, prerenderDir, result, log) => {
|
|
708
|
-
const res = await fetch(`${baseUrl}${route}
|
|
709
|
+
const res = await fetch(`${baseUrl}${route}`, {
|
|
710
|
+
redirect: "manual"
|
|
711
|
+
}).catch(() => null);
|
|
709
712
|
if (!res) {
|
|
710
713
|
log?.(` Failed to pre-render ${route}`);
|
|
711
714
|
return;
|
package/dist/index.js
CHANGED
|
@@ -87,11 +87,14 @@ var WS_READY_STATE_OPEN = 1;
|
|
|
87
87
|
var exports_stylePreprocessor = {};
|
|
88
88
|
__export(exports_stylePreprocessor, {
|
|
89
89
|
stylePreprocessorPlugin: () => stylePreprocessorPlugin,
|
|
90
|
+
recordStyleOutput: () => recordStyleOutput,
|
|
90
91
|
isStylePath: () => isStylePath,
|
|
91
92
|
isStyleModulePath: () => isStyleModulePath,
|
|
92
93
|
isPreprocessableStylePath: () => isPreprocessableStylePath,
|
|
93
94
|
getStyleBaseName: () => getStyleBaseName,
|
|
94
95
|
getCssOutputExtension: () => getCssOutputExtension,
|
|
96
|
+
forgetStyleEntry: () => forgetStyleEntry,
|
|
97
|
+
findStyleEntriesImporting: () => findStyleEntriesImporting,
|
|
95
98
|
createSvelteStylePreprocessor: () => createSvelteStylePreprocessor,
|
|
96
99
|
createStyleTransformConfig: () => createStyleTransformConfig,
|
|
97
100
|
createStylePreprocessorPlugin: () => createStylePreprocessorPlugin,
|
|
@@ -99,10 +102,18 @@ __export(exports_stylePreprocessor, {
|
|
|
99
102
|
compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
|
|
100
103
|
compileStyleFileIfNeeded: () => compileStyleFileIfNeeded
|
|
101
104
|
});
|
|
105
|
+
import { createHash } from "crypto";
|
|
102
106
|
import { existsSync, readFileSync } from "fs";
|
|
103
107
|
import { readFile } from "fs/promises";
|
|
104
108
|
import { createRequire } from "module";
|
|
105
|
-
import {
|
|
109
|
+
import {
|
|
110
|
+
dirname,
|
|
111
|
+
extname,
|
|
112
|
+
isAbsolute,
|
|
113
|
+
join,
|
|
114
|
+
relative,
|
|
115
|
+
resolve
|
|
116
|
+
} from "path";
|
|
106
117
|
import { fileURLToPath } from "url";
|
|
107
118
|
var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less|styl(?:us)?)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less|styl(?:us)?)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
108
119
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
@@ -115,7 +126,22 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
115
126
|
if (normalized === "styl" || normalized === "stylus" || normalized.endsWith(".styl") || normalized.endsWith(".stylus"))
|
|
116
127
|
return "stylus";
|
|
117
128
|
return null;
|
|
118
|
-
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`),
|
|
129
|
+
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), throwPreprocessorError = (error, filePath, language) => {
|
|
130
|
+
if (!(error instanceof Error)) {
|
|
131
|
+
throw new Error(`${language} compile failed in ${filePath}: ${String(error)}`);
|
|
132
|
+
}
|
|
133
|
+
const detail = error;
|
|
134
|
+
const sassLine = detail.span?.start?.line;
|
|
135
|
+
const sassCol = detail.span?.start?.column;
|
|
136
|
+
const line = detail.line ?? sassLine;
|
|
137
|
+
const column = detail.column ?? sassCol;
|
|
138
|
+
const location = typeof line === "number" ? `:${line}${typeof column === "number" ? `:${column}` : ""}` : "";
|
|
139
|
+
const message = detail.formatted ?? detail.message;
|
|
140
|
+
const wrapped = new Error(`${language} compile failed in ${filePath}${location}
|
|
141
|
+
${message}`);
|
|
142
|
+
wrapped.cause = error;
|
|
143
|
+
throw wrapped;
|
|
144
|
+
}, requireOptionalPeerSync = (specifier) => {
|
|
119
145
|
try {
|
|
120
146
|
return requireFromCwd(specifier);
|
|
121
147
|
} catch {
|
|
@@ -154,7 +180,10 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
154
180
|
}, getAliasEntries = (config) => {
|
|
155
181
|
const tsconfig = readTsconfigAliases();
|
|
156
182
|
return {
|
|
157
|
-
aliases: [
|
|
183
|
+
aliases: [
|
|
184
|
+
...normalizeAliasEntries(config?.aliases),
|
|
185
|
+
...tsconfig.aliases
|
|
186
|
+
],
|
|
158
187
|
baseUrl: tsconfig.baseUrl
|
|
159
188
|
};
|
|
160
189
|
}, aliasPatternToRegExp = (pattern) => new RegExp(`^${pattern.split("*").map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("(.+)")}$`), resolveAliasTargets = (specifier, config) => {
|
|
@@ -315,7 +344,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
315
344
|
...postcssConfig.options
|
|
316
345
|
});
|
|
317
346
|
return result.css;
|
|
318
|
-
}, createSassImporter = (entryFile, loadPaths, language, config) => ({
|
|
347
|
+
}, createSassImporter = (entryFile, loadPaths, language, config, deps) => ({
|
|
319
348
|
canonicalize(specifier, options) {
|
|
320
349
|
const fromDirectory = options.containingUrl ? dirname(fileURLToPath(options.containingUrl)) : dirname(entryFile);
|
|
321
350
|
const resolved = resolveImportPath(specifier, fromDirectory, loadPaths, language, config);
|
|
@@ -323,6 +352,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
323
352
|
},
|
|
324
353
|
load(canonicalUrl) {
|
|
325
354
|
const filePath = fileURLToPath(canonicalUrl);
|
|
355
|
+
deps?.add(filePath);
|
|
326
356
|
const fileLanguage = getStyleLanguage(filePath);
|
|
327
357
|
if (fileLanguage !== "scss" && fileLanguage !== "sass" && fileLanguage !== null)
|
|
328
358
|
return null;
|
|
@@ -331,7 +361,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
331
361
|
syntax: filePath.endsWith(".sass") ? "indented" : "scss"
|
|
332
362
|
};
|
|
333
363
|
}
|
|
334
|
-
}), createLessFileManager = (entryFile, loadPaths, config) => ({
|
|
364
|
+
}), createLessFileManager = (entryFile, loadPaths, config, deps) => ({
|
|
335
365
|
install(less, pluginManager) {
|
|
336
366
|
const baseManager = new less.FileManager;
|
|
337
367
|
const manager = Object.create(baseManager);
|
|
@@ -341,6 +371,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
341
371
|
if (!resolved) {
|
|
342
372
|
throw new Error(`Unable to resolve Less import "${filename}"`);
|
|
343
373
|
}
|
|
374
|
+
deps?.add(resolved);
|
|
344
375
|
return {
|
|
345
376
|
contents: preprocessLoadedStyle(await readFile(resolved, "utf-8"), resolved, entryFile, loadPaths, "less", config),
|
|
346
377
|
filename: resolved
|
|
@@ -348,7 +379,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
348
379
|
};
|
|
349
380
|
pluginManager.addFileManager(manager);
|
|
350
381
|
}
|
|
351
|
-
}), renderStylus = async (contents, filePath, loadPaths, options) => {
|
|
382
|
+
}), renderStylus = async (contents, filePath, loadPaths, options, deps) => {
|
|
352
383
|
let stylus;
|
|
353
384
|
try {
|
|
354
385
|
const stylusModule = await importOptionalPeer("stylus");
|
|
@@ -365,15 +396,51 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
365
396
|
for (const path of loadPaths)
|
|
366
397
|
renderer.include(path);
|
|
367
398
|
renderer.render((error, css) => {
|
|
368
|
-
if (error)
|
|
399
|
+
if (error) {
|
|
369
400
|
reject(error);
|
|
370
|
-
|
|
371
|
-
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (deps) {
|
|
404
|
+
const stylusDeps = renderer.deps?.();
|
|
405
|
+
if (Array.isArray(stylusDeps)) {
|
|
406
|
+
for (const dep of stylusDeps)
|
|
407
|
+
deps.add(resolve(dep));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
resolveCss(css ?? "");
|
|
372
411
|
});
|
|
373
412
|
});
|
|
413
|
+
}, styleDependencyGraph, styleOutputHashes, recordStyleDeps = (entry, deps) => {
|
|
414
|
+
const key = resolve(entry);
|
|
415
|
+
const stripped = new Set;
|
|
416
|
+
for (const dep of deps) {
|
|
417
|
+
const resolved = resolve(dep);
|
|
418
|
+
if (resolved !== key)
|
|
419
|
+
stripped.add(resolved);
|
|
420
|
+
}
|
|
421
|
+
styleDependencyGraph.set(key, stripped);
|
|
422
|
+
}, findStyleEntriesImporting = (changedPath) => {
|
|
423
|
+
const target = resolve(changedPath);
|
|
424
|
+
const importers = [];
|
|
425
|
+
for (const [entry, deps] of styleDependencyGraph) {
|
|
426
|
+
if (deps.has(target))
|
|
427
|
+
importers.push(entry);
|
|
428
|
+
}
|
|
429
|
+
return importers;
|
|
430
|
+
}, recordStyleOutput = (entry, css) => {
|
|
431
|
+
const key = resolve(entry);
|
|
432
|
+
const hash = createHash("sha1").update(css).digest("hex");
|
|
433
|
+
const previous = styleOutputHashes.get(key);
|
|
434
|
+
styleOutputHashes.set(key, hash);
|
|
435
|
+
return previous !== hash;
|
|
436
|
+
}, forgetStyleEntry = (entry) => {
|
|
437
|
+
const key = resolve(entry);
|
|
438
|
+
styleDependencyGraph.delete(key);
|
|
439
|
+
styleOutputHashes.delete(key);
|
|
374
440
|
}, compileStyleSource = async (filePath, source, languageHint, config) => {
|
|
375
441
|
const language = getStyleLanguage(languageHint ?? filePath);
|
|
376
442
|
const rawContents = source ?? await readFile(filePath, "utf-8");
|
|
443
|
+
const deps = new Set;
|
|
377
444
|
if (language === "scss" || language === "sass") {
|
|
378
445
|
const options = getSassOptions(config, language);
|
|
379
446
|
const packageName = options.implementation ?? "sass";
|
|
@@ -385,16 +452,22 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
385
452
|
}
|
|
386
453
|
const contents = withAdditionalData(rawContents, options.additionalData);
|
|
387
454
|
const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
455
|
+
try {
|
|
456
|
+
const result = sass.compileString(contents, {
|
|
457
|
+
importers: [
|
|
458
|
+
createSassImporter(filePath, loadPaths, language, config, deps)
|
|
459
|
+
],
|
|
460
|
+
loadPaths,
|
|
461
|
+
style: "expanded",
|
|
462
|
+
syntax: language === "sass" ? "indented" : "scss",
|
|
463
|
+
url: new URL(`file://${filePath}`)
|
|
464
|
+
});
|
|
465
|
+
const css = await runPostcss(result.css, filePath, config);
|
|
466
|
+
recordStyleDeps(filePath, deps);
|
|
467
|
+
return css;
|
|
468
|
+
} catch (error) {
|
|
469
|
+
throwPreprocessorError(error, filePath, language);
|
|
470
|
+
}
|
|
398
471
|
}
|
|
399
472
|
if (language === "less") {
|
|
400
473
|
const options = getLessOptions(config);
|
|
@@ -410,22 +483,34 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
410
483
|
throw missingDependencyError("less", filePath);
|
|
411
484
|
const contents = withAdditionalData(rawContents, options.additionalData);
|
|
412
485
|
const loadPaths = normalizeLoadPaths(filePath, options.paths);
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
486
|
+
try {
|
|
487
|
+
const result = await render(contents, {
|
|
488
|
+
...options.options ?? {},
|
|
489
|
+
filename: filePath,
|
|
490
|
+
paths: loadPaths,
|
|
491
|
+
plugins: [
|
|
492
|
+
...options.options?.plugins ?? [],
|
|
493
|
+
createLessFileManager(filePath, loadPaths, config, deps)
|
|
494
|
+
]
|
|
495
|
+
});
|
|
496
|
+
const css = await runPostcss(result.css, filePath, config);
|
|
497
|
+
recordStyleDeps(filePath, deps);
|
|
498
|
+
return css;
|
|
499
|
+
} catch (error) {
|
|
500
|
+
throwPreprocessorError(error, filePath, "less");
|
|
501
|
+
}
|
|
423
502
|
}
|
|
424
503
|
if (language === "stylus") {
|
|
425
504
|
const options = getStylusOptions(config);
|
|
426
505
|
const loadPaths = normalizeLoadPaths(filePath, options.paths);
|
|
427
506
|
const contents = withAdditionalData(preprocessLoadedStyle(rawContents, filePath, filePath, loadPaths, "stylus", config), options.additionalData);
|
|
428
|
-
|
|
507
|
+
try {
|
|
508
|
+
const css = await runPostcss(await renderStylus(contents, filePath, loadPaths, options, deps), filePath, config);
|
|
509
|
+
recordStyleDeps(filePath, deps);
|
|
510
|
+
return css;
|
|
511
|
+
} catch (error) {
|
|
512
|
+
throwPreprocessorError(error, filePath, "stylus");
|
|
513
|
+
}
|
|
429
514
|
}
|
|
430
515
|
return runPostcss(rawContents, filePath, config);
|
|
431
516
|
}, createStylePreprocessorPlugin = (config) => ({
|
|
@@ -530,6 +615,8 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
530
615
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
531
616
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
532
617
|
requireFromCwd = createRequire(join(process.cwd(), "package.json"));
|
|
618
|
+
styleDependencyGraph = new Map;
|
|
619
|
+
styleOutputHashes = new Map;
|
|
533
620
|
stylePreprocessorPlugin = createStylePreprocessorPlugin();
|
|
534
621
|
});
|
|
535
622
|
|
|
@@ -5421,7 +5508,7 @@ __export(exports_tailwindCompiler, {
|
|
|
5421
5508
|
extractCandidates: () => extractCandidates,
|
|
5422
5509
|
disposeTailwindCompiler: () => disposeTailwindCompiler
|
|
5423
5510
|
});
|
|
5424
|
-
import { createHash } from "crypto";
|
|
5511
|
+
import { createHash as createHash2 } from "crypto";
|
|
5425
5512
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
5426
5513
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
5427
5514
|
import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as resolve2 } from "path";
|
|
@@ -5513,7 +5600,7 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
5513
5600
|
out.add(match[0]);
|
|
5514
5601
|
}
|
|
5515
5602
|
return out;
|
|
5516
|
-
}, hashCss = (css) =>
|
|
5603
|
+
}, hashCss = (css) => createHash2("sha1").update(css).digest("hex"), fileMatchesSources = (file, sources) => {
|
|
5517
5604
|
if (sources.length === 0)
|
|
5518
5605
|
return true;
|
|
5519
5606
|
const absFile = resolve2(file);
|
|
@@ -8671,7 +8758,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
8671
8758
|
const pagesRelPath = relative4(resolve10(reactIndexesDirectory), resolve10(reactPagesDirectory)).split(sep).join("/");
|
|
8672
8759
|
const promises = files.map(async (file2) => {
|
|
8673
8760
|
const fileName = basename3(file2);
|
|
8674
|
-
const
|
|
8761
|
+
const componentName = fileName.split(".")[0];
|
|
8762
|
+
const pascalComponentName = toPascal(componentName);
|
|
8675
8763
|
const hmrPreamble = isDev2 ? [
|
|
8676
8764
|
`window.__HMR_FRAMEWORK__ = "react";`,
|
|
8677
8765
|
`window.__REACT_COMPONENT_KEY__ = "${componentName}Index";`,
|
|
@@ -8725,12 +8813,25 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
8725
8813
|
const content = [
|
|
8726
8814
|
...hmrPreamble,
|
|
8727
8815
|
...reactImports,
|
|
8728
|
-
`import
|
|
8816
|
+
`import * as PageModule from '${pagesRelPath}/${componentName}';
|
|
8729
8817
|
`,
|
|
8730
8818
|
...errorBoundaryDef,
|
|
8731
8819
|
`// Hydration with error handling and fallback`,
|
|
8732
8820
|
`const isDev = ${isDev2};`,
|
|
8733
8821
|
`const componentPath = '${pagesRelPath}/${componentName}';
|
|
8822
|
+
`,
|
|
8823
|
+
`function resolvePageComponent(module, candidateNames) {`,
|
|
8824
|
+
` for (const name of candidateNames) {`,
|
|
8825
|
+
` const value = module[name];`,
|
|
8826
|
+
` if (typeof value === 'function' || (value && typeof value === 'object')) return value;`,
|
|
8827
|
+
` }`,
|
|
8828
|
+
` for (const [name, value] of Object.entries(module)) {`,
|
|
8829
|
+
` if (!/^[A-Z]/.test(name)) continue;`,
|
|
8830
|
+
` if (typeof value === 'function' || (value && typeof value === 'object')) return value;`,
|
|
8831
|
+
` }`,
|
|
8832
|
+
` throw new Error('React page module ' + componentPath + ' does not export a component. Expected default, ${pascalComponentName}, ${componentName}, or any PascalCase export.');`,
|
|
8833
|
+
`}`,
|
|
8834
|
+
`const PageComponent = resolvePageComponent(PageModule, ['default', '${pascalComponentName}', '${componentName}']);
|
|
8734
8835
|
`,
|
|
8735
8836
|
`function isHydrationError(error) {`,
|
|
8736
8837
|
` if (!error) return false;`,
|
|
@@ -8802,7 +8903,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
8802
8903
|
`,
|
|
8803
8904
|
` // Render into the same root container when falling back to client-only`,
|
|
8804
8905
|
` const root = createRoot(container);`,
|
|
8805
|
-
` root.render(${isDev2 ? `createElement(ErrorBoundary, null, createElement(
|
|
8906
|
+
` root.render(${isDev2 ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
|
|
8806
8907
|
` window.__REACT_ROOT__ = root;`,
|
|
8807
8908
|
` window.__HMR_CLIENT_ONLY_MODE__ = true;`,
|
|
8808
8909
|
` } catch (fallbackError) {`,
|
|
@@ -8847,14 +8948,14 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
8847
8948
|
` // After HMR, SSR is skipped to avoid stale content flash \u2014 render client-only`,
|
|
8848
8949
|
` if (window.__SSR_DIRTY__) {`,
|
|
8849
8950
|
` root = createRoot(container);`,
|
|
8850
|
-
` root.render(${isDev2 ? `createElement(ErrorBoundary, null, createElement(
|
|
8951
|
+
` root.render(${isDev2 ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
|
|
8851
8952
|
` window.__REACT_ROOT__ = root;`,
|
|
8852
8953
|
` } else {`,
|
|
8853
8954
|
` try {`,
|
|
8854
8955
|
` // Use onRecoverableError to catch hydration errors (React 19)`,
|
|
8855
8956
|
` root = hydrateRoot(`,
|
|
8856
8957
|
` container,`,
|
|
8857
|
-
` ${isDev2 ? `createElement(ErrorBoundary, null, createElement(
|
|
8958
|
+
` ${isDev2 ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`},`,
|
|
8858
8959
|
` {`,
|
|
8859
8960
|
` onRecoverableError: (error) => {`,
|
|
8860
8961
|
` // Check if this is a hydration error (isHydrationError filters out whitespace-only head mismatches)`,
|
|
@@ -9659,7 +9760,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9659
9760
|
// src/build/angularLinkerPlugin.ts
|
|
9660
9761
|
import { existsSync as existsSync14, mkdirSync as mkdirSync5, readFileSync as readFileSync11, writeFileSync as writeFileSync6 } from "fs";
|
|
9661
9762
|
import { dirname as dirname9, join as join12, relative as relative5, resolve as resolve14 } from "path";
|
|
9662
|
-
import { createHash as
|
|
9763
|
+
import { createHash as createHash3 } from "crypto";
|
|
9663
9764
|
var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
9664
9765
|
name: "angular-linker",
|
|
9665
9766
|
setup(bld) {
|
|
@@ -9678,7 +9779,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9678
9779
|
if (!checkLink || !checkLink(args.path, source)) {
|
|
9679
9780
|
return;
|
|
9680
9781
|
}
|
|
9681
|
-
const hash =
|
|
9782
|
+
const hash = createHash3("md5").update(source).digest("hex");
|
|
9682
9783
|
const cachePath = join12(cacheDir, `${hash}.js`);
|
|
9683
9784
|
if (existsSync14(cachePath)) {
|
|
9684
9785
|
return {
|
|
@@ -16058,6 +16159,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16058
16159
|
await waitRound(round + 1);
|
|
16059
16160
|
};
|
|
16060
16161
|
await waitRound(0);
|
|
16162
|
+
}, enqueueImporter = (state, importer) => {
|
|
16163
|
+
const importerFramework = detectFramework(importer, state.resolvedPaths);
|
|
16164
|
+
if (importerFramework === "ignored")
|
|
16165
|
+
return;
|
|
16166
|
+
if (!state.fileChangeQueue.has(importerFramework)) {
|
|
16167
|
+
state.fileChangeQueue.set(importerFramework, []);
|
|
16168
|
+
}
|
|
16169
|
+
const importerQueue = state.fileChangeQueue.get(importerFramework);
|
|
16170
|
+
if (importerQueue && !importerQueue.includes(importer)) {
|
|
16171
|
+
importerQueue.push(importer);
|
|
16172
|
+
}
|
|
16173
|
+
}, enqueueStyleImporters = (state, changedStylePath) => {
|
|
16174
|
+
for (const importer of findStyleEntriesImporting(changedStylePath)) {
|
|
16175
|
+
enqueueImporter(state, importer);
|
|
16176
|
+
}
|
|
16061
16177
|
}, queueFileChange = async (state, filePath, config, onRebuildComplete) => {
|
|
16062
16178
|
const framework = detectFramework(filePath, state.resolvedPaths);
|
|
16063
16179
|
if (framework === "ignored") {
|
|
@@ -16080,6 +16196,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16080
16196
|
if (queue && !queue.includes(filePath)) {
|
|
16081
16197
|
queue.push(filePath);
|
|
16082
16198
|
}
|
|
16199
|
+
if (isStylePath(filePath)) {
|
|
16200
|
+
enqueueStyleImporters(state, filePath);
|
|
16201
|
+
}
|
|
16083
16202
|
if (state.isRebuilding) {
|
|
16084
16203
|
return;
|
|
16085
16204
|
}
|
|
@@ -18488,7 +18607,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
18488
18607
|
}
|
|
18489
18608
|
return links;
|
|
18490
18609
|
}, fetchRoute = async (baseUrl, path) => {
|
|
18491
|
-
const res = await fetch(`${baseUrl}${path}
|
|
18610
|
+
const res = await fetch(`${baseUrl}${path}`, { redirect: "manual" });
|
|
18492
18611
|
if (!res.ok)
|
|
18493
18612
|
return null;
|
|
18494
18613
|
const contentType = res.headers.get("content-type") ?? "";
|
|
@@ -18523,7 +18642,8 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
18523
18642
|
}, rerenderRoute = async (route, port, prerenderDir) => {
|
|
18524
18643
|
try {
|
|
18525
18644
|
const res = await fetch(`http://localhost:${port}${route}`, {
|
|
18526
|
-
headers: { [PRERENDER_BYPASS_HEADER]: "1" }
|
|
18645
|
+
headers: { [PRERENDER_BYPASS_HEADER]: "1" },
|
|
18646
|
+
redirect: "manual"
|
|
18527
18647
|
});
|
|
18528
18648
|
if (!res.ok)
|
|
18529
18649
|
return false;
|
|
@@ -18537,7 +18657,9 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
18537
18657
|
return false;
|
|
18538
18658
|
}
|
|
18539
18659
|
}, prerenderRoute = async (baseUrl, route, prerenderDir, result, log2) => {
|
|
18540
|
-
const res = await fetch(`${baseUrl}${route}
|
|
18660
|
+
const res = await fetch(`${baseUrl}${route}`, {
|
|
18661
|
+
redirect: "manual"
|
|
18662
|
+
}).catch(() => null);
|
|
18541
18663
|
if (!res) {
|
|
18542
18664
|
log2?.(` Failed to pre-render ${route}`);
|
|
18543
18665
|
return;
|
|
@@ -26410,5 +26532,5 @@ export {
|
|
|
26410
26532
|
ANGULAR_INIT_TIMEOUT_MS
|
|
26411
26533
|
};
|
|
26412
26534
|
|
|
26413
|
-
//# debugId=
|
|
26535
|
+
//# debugId=32C8636F582E470C64756E2164756E21
|
|
26414
26536
|
//# sourceMappingURL=index.js.map
|