@angular/ssr 17.0.0-rc.3 → 17.0.0-rc.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/esm2022/src/common-engine.mjs +25 -37
- package/fesm2022/ssr.mjs +25 -37
- package/fesm2022/ssr.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { renderApplication, renderModule, ɵSERVER_CONTEXT } from '@angular/platform-server';
|
|
9
9
|
import * as fs from 'node:fs';
|
|
10
|
-
import { dirname, resolve } from 'node:path';
|
|
10
|
+
import { dirname, join, normalize, resolve } from 'node:path';
|
|
11
11
|
import { URL } from 'node:url';
|
|
12
12
|
import { InlineCriticalCssProcessor } from './inline-css-processor';
|
|
13
13
|
import { noopRunMethodAndMeasurePerf, printPerformanceLogs, runMethodAndMeasurePerf, } from './peformance-profiler';
|
|
@@ -31,8 +31,8 @@ export class CommonEngine {
|
|
|
31
31
|
* render options
|
|
32
32
|
*/
|
|
33
33
|
async render(opts) {
|
|
34
|
-
const
|
|
35
|
-
const runMethod =
|
|
34
|
+
const enablePerformanceProfiler = this.options?.enablePerformanceProfiler;
|
|
35
|
+
const runMethod = enablePerformanceProfiler
|
|
36
36
|
? runMethodAndMeasurePerf
|
|
37
37
|
: noopRunMethodAndMeasurePerf;
|
|
38
38
|
let html = await runMethod('Retrieve SSG Page', () => this.retrieveSSGPage(opts));
|
|
@@ -49,7 +49,7 @@ export class CommonEngine {
|
|
|
49
49
|
errors?.forEach((m) => console.error(m));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
if (
|
|
52
|
+
if (enablePerformanceProfiler) {
|
|
53
53
|
printPerformanceLogs();
|
|
54
54
|
}
|
|
55
55
|
return html;
|
|
@@ -64,31 +64,28 @@ export class CommonEngine {
|
|
|
64
64
|
if (!publicPath || !documentFilePath || url === undefined) {
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
|
-
const pathname =
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.pageIsSSG.set(pagePath, false);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else if (pageIsSSG) {
|
|
87
|
-
// Serve pre-rendered page.
|
|
88
|
-
return fs.promises.readFile(pagePath, 'utf-8');
|
|
89
|
-
}
|
|
67
|
+
const { pathname } = new URL(url, 'resolve://');
|
|
68
|
+
// Do not use `resolve` here as otherwise it can lead to path traversal vulnerability.
|
|
69
|
+
// See: https://portswigger.net/web-security/file-path-traversal
|
|
70
|
+
const pagePath = join(publicPath, pathname, 'index.html');
|
|
71
|
+
if (this.pageIsSSG.get(pagePath)) {
|
|
72
|
+
// Serve pre-rendered page.
|
|
73
|
+
return fs.promises.readFile(pagePath, 'utf-8');
|
|
74
|
+
}
|
|
75
|
+
if (!pagePath.startsWith(normalize(publicPath))) {
|
|
76
|
+
// Potential path traversal detected.
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
if (pagePath === resolve(documentFilePath) || !(await exists(pagePath))) {
|
|
80
|
+
// View matches with prerender path or file does not exist.
|
|
81
|
+
this.pageIsSSG.set(pagePath, false);
|
|
82
|
+
return undefined;
|
|
90
83
|
}
|
|
91
|
-
|
|
84
|
+
// Static file exists.
|
|
85
|
+
const content = await fs.promises.readFile(pagePath, 'utf-8');
|
|
86
|
+
const isSSG = SSG_MARKER_REGEXP.test(content);
|
|
87
|
+
this.pageIsSSG.set(pagePath, isSSG);
|
|
88
|
+
return isSSG ? content : undefined;
|
|
92
89
|
}
|
|
93
90
|
async renderApplication(opts) {
|
|
94
91
|
const moduleOrFactory = this.options?.bootstrap ?? opts.bootstrap;
|
|
@@ -138,12 +135,3 @@ function isBootstrapFn(value) {
|
|
|
138
135
|
// We can differentiate between a module and a bootstrap function by reading compiler-generated `ɵmod` static property:
|
|
139
136
|
return typeof value === 'function' && !('ɵmod' in value);
|
|
140
137
|
}
|
|
141
|
-
// The below can be removed in favor of URL.canParse() when Node.js 18 is dropped
|
|
142
|
-
function canParseUrl(url) {
|
|
143
|
-
try {
|
|
144
|
-
return !!new URL(url);
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
}
|
package/fesm2022/ssr.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ɵSERVER_CONTEXT, renderApplication, renderModule } from '@angular/platform-server';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { dirname, join, normalize, resolve } from 'node:path';
|
|
4
4
|
import { URL } from 'node:url';
|
|
5
5
|
import Critters from 'critters';
|
|
6
6
|
import { readFile } from 'node:fs/promises';
|
|
@@ -234,8 +234,8 @@ class CommonEngine {
|
|
|
234
234
|
* render options
|
|
235
235
|
*/
|
|
236
236
|
async render(opts) {
|
|
237
|
-
const
|
|
238
|
-
const runMethod =
|
|
237
|
+
const enablePerformanceProfiler = this.options?.enablePerformanceProfiler;
|
|
238
|
+
const runMethod = enablePerformanceProfiler
|
|
239
239
|
? runMethodAndMeasurePerf
|
|
240
240
|
: noopRunMethodAndMeasurePerf;
|
|
241
241
|
let html = await runMethod('Retrieve SSG Page', () => this.retrieveSSGPage(opts));
|
|
@@ -252,7 +252,7 @@ class CommonEngine {
|
|
|
252
252
|
errors?.forEach((m) => console.error(m));
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
255
|
+
if (enablePerformanceProfiler) {
|
|
256
256
|
printPerformanceLogs();
|
|
257
257
|
}
|
|
258
258
|
return html;
|
|
@@ -267,31 +267,28 @@ class CommonEngine {
|
|
|
267
267
|
if (!publicPath || !documentFilePath || url === undefined) {
|
|
268
268
|
return undefined;
|
|
269
269
|
}
|
|
270
|
-
const pathname =
|
|
271
|
-
//
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
this.pageIsSSG.set(pagePath, false);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
else if (pageIsSSG) {
|
|
290
|
-
// Serve pre-rendered page.
|
|
291
|
-
return fs.promises.readFile(pagePath, 'utf-8');
|
|
292
|
-
}
|
|
270
|
+
const { pathname } = new URL(url, 'resolve://');
|
|
271
|
+
// Do not use `resolve` here as otherwise it can lead to path traversal vulnerability.
|
|
272
|
+
// See: https://portswigger.net/web-security/file-path-traversal
|
|
273
|
+
const pagePath = join(publicPath, pathname, 'index.html');
|
|
274
|
+
if (this.pageIsSSG.get(pagePath)) {
|
|
275
|
+
// Serve pre-rendered page.
|
|
276
|
+
return fs.promises.readFile(pagePath, 'utf-8');
|
|
277
|
+
}
|
|
278
|
+
if (!pagePath.startsWith(normalize(publicPath))) {
|
|
279
|
+
// Potential path traversal detected.
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
if (pagePath === resolve(documentFilePath) || !(await exists(pagePath))) {
|
|
283
|
+
// View matches with prerender path or file does not exist.
|
|
284
|
+
this.pageIsSSG.set(pagePath, false);
|
|
285
|
+
return undefined;
|
|
293
286
|
}
|
|
294
|
-
|
|
287
|
+
// Static file exists.
|
|
288
|
+
const content = await fs.promises.readFile(pagePath, 'utf-8');
|
|
289
|
+
const isSSG = SSG_MARKER_REGEXP.test(content);
|
|
290
|
+
this.pageIsSSG.set(pagePath, isSSG);
|
|
291
|
+
return isSSG ? content : undefined;
|
|
295
292
|
}
|
|
296
293
|
async renderApplication(opts) {
|
|
297
294
|
const moduleOrFactory = this.options?.bootstrap ?? opts.bootstrap;
|
|
@@ -341,15 +338,6 @@ function isBootstrapFn(value) {
|
|
|
341
338
|
// We can differentiate between a module and a bootstrap function by reading compiler-generated `ɵmod` static property:
|
|
342
339
|
return typeof value === 'function' && !('ɵmod' in value);
|
|
343
340
|
}
|
|
344
|
-
// The below can be removed in favor of URL.canParse() when Node.js 18 is dropped
|
|
345
|
-
function canParseUrl(url) {
|
|
346
|
-
try {
|
|
347
|
-
return !!new URL(url);
|
|
348
|
-
}
|
|
349
|
-
catch {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
341
|
|
|
354
342
|
export { CommonEngine };
|
|
355
343
|
//# sourceMappingURL=ssr.mjs.map
|
package/fesm2022/ssr.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.mjs","sources":["../../../../../../k8-fastbuild-ST-70f2edae98f4/bin/packages/angular/ssr/src/inline-css-processor.mjs","../../../../../../k8-fastbuild-ST-70f2edae98f4/bin/packages/angular/ssr/src/peformance-profiler.mjs","../../../../../../k8-fastbuild-ST-70f2edae98f4/bin/packages/angular/ssr/src/common-engine.mjs"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport Critters from 'critters';\nimport { readFile } from 'node:fs/promises';\n/**\n * Pattern used to extract the media query set by Critters in an `onload` handler.\n */\nconst MEDIA_SET_HANDLER_PATTERN = /^this\\.media=[\"'](.*)[\"'];?$/;\n/**\n * Name of the attribute used to save the Critters media query so it can be re-assigned on load.\n */\nconst CSP_MEDIA_ATTR = 'ngCspMedia';\n/**\n * Script text used to change the media value of the link tags.\n */\nconst LINK_LOAD_SCRIPT_CONTENT = [\n `(() => {`,\n // Save the `children` in a variable since they're a live DOM node collection.\n // We iterate over the direct descendants, instead of going through a `querySelectorAll`,\n // because we know that the tags will be directly inside the `head`.\n ` const children = document.head.children;`,\n // Declare `onLoad` outside the loop to avoid leaking memory.\n // Can't be an arrow function, because we need `this` to refer to the DOM node.\n ` function onLoad() {this.media = this.getAttribute('${CSP_MEDIA_ATTR}');}`,\n // Has to use a plain for loop, because some browsers don't support\n // `forEach` on `children` which is a `HTMLCollection`.\n ` for (let i = 0; i < children.length; i++) {`,\n ` const child = children[i];`,\n ` child.hasAttribute('${CSP_MEDIA_ATTR}') && child.addEventListener('load', onLoad);`,\n ` }`,\n `})();`,\n].join('\\n');\nclass CrittersExtended extends Critters {\n optionsExtended;\n resourceCache;\n warnings = [];\n errors = [];\n initialEmbedLinkedStylesheet;\n addedCspScriptsDocuments = new WeakSet();\n documentNonces = new WeakMap();\n constructor(optionsExtended, resourceCache) {\n super({\n logger: {\n warn: (s) => this.warnings.push(s),\n error: (s) => this.errors.push(s),\n info: () => { },\n },\n logLevel: 'warn',\n path: optionsExtended.outputPath,\n publicPath: optionsExtended.deployUrl,\n compress: !!optionsExtended.minify,\n pruneSource: false,\n reduceInlineStyles: false,\n mergeStylesheets: false,\n // Note: if `preload` changes to anything other than `media`, the logic in\n // `embedLinkedStylesheetOverride` will have to be updated.\n preload: 'media',\n noscriptFallback: true,\n inlineFonts: true,\n });\n this.optionsExtended = optionsExtended;\n this.resourceCache = resourceCache;\n // We can't use inheritance to override `embedLinkedStylesheet`, because it's not declared in\n // the `Critters` .d.ts which means that we can't call the `super` implementation. TS doesn't\n // allow for `super` to be cast to a different type.\n this.initialEmbedLinkedStylesheet = this.embedLinkedStylesheet;\n this.embedLinkedStylesheet = this.embedLinkedStylesheetOverride;\n }\n async readFile(path) {\n let resourceContent = this.resourceCache.get(path);\n if (resourceContent === undefined) {\n resourceContent = await readFile(path, 'utf-8');\n this.resourceCache.set(path, resourceContent);\n }\n return resourceContent;\n }\n /**\n * Override of the Critters `embedLinkedStylesheet` method\n * that makes it work with Angular's CSP APIs.\n */\n embedLinkedStylesheetOverride = async (link, document) => {\n if (link.getAttribute('media') === 'print' && link.next?.name === 'noscript') {\n // Workaround for https://github.com/GoogleChromeLabs/critters/issues/64\n // NB: this is only needed for the webpack based builders.\n const media = link.getAttribute('onload')?.match(MEDIA_SET_HANDLER_PATTERN);\n if (media) {\n link.removeAttribute('onload');\n link.setAttribute('media', media[1]);\n link?.next?.remove();\n }\n }\n const returnValue = await this.initialEmbedLinkedStylesheet(link, document);\n const cspNonce = this.findCspNonce(document);\n if (cspNonce) {\n const crittersMedia = link.getAttribute('onload')?.match(MEDIA_SET_HANDLER_PATTERN);\n if (crittersMedia) {\n // If there's a Critters-generated `onload` handler and the file has an Angular CSP nonce,\n // we have to remove the handler, because it's incompatible with CSP. We save the value\n // in a different attribute and we generate a script tag with the nonce that uses\n // `addEventListener` to apply the media query instead.\n link.removeAttribute('onload');\n link.setAttribute(CSP_MEDIA_ATTR, crittersMedia[1]);\n this.conditionallyInsertCspLoadingScript(document, cspNonce);\n }\n // Ideally we would hook in at the time Critters inserts the `style` tags, but there isn't\n // a way of doing that at the moment so we fall back to doing it any time a `link` tag is\n // inserted. We mitigate it by only iterating the direct children of the `<head>` which\n // should be pretty shallow.\n document.head.children.forEach((child) => {\n if (child.tagName === 'style' && !child.hasAttribute('nonce')) {\n child.setAttribute('nonce', cspNonce);\n }\n });\n }\n return returnValue;\n };\n /**\n * Finds the CSP nonce for a specific document.\n */\n findCspNonce(document) {\n if (this.documentNonces.has(document)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.documentNonces.get(document);\n }\n // HTML attribute are case-insensitive, but the parser used by Critters is case-sensitive.\n const nonceElement = document.querySelector('[ngCspNonce], [ngcspnonce]');\n const cspNonce = nonceElement?.getAttribute('ngCspNonce') || nonceElement?.getAttribute('ngcspnonce') || null;\n this.documentNonces.set(document, cspNonce);\n return cspNonce;\n }\n /**\n * Inserts the `script` tag that swaps the critical CSS at runtime,\n * if one hasn't been inserted into the document already.\n */\n conditionallyInsertCspLoadingScript(document, nonce) {\n if (this.addedCspScriptsDocuments.has(document)) {\n return;\n }\n if (document.head.textContent.includes(LINK_LOAD_SCRIPT_CONTENT)) {\n // Script was already added during the build.\n this.addedCspScriptsDocuments.add(document);\n return;\n }\n const script = document.createElement('script');\n script.setAttribute('nonce', nonce);\n script.textContent = LINK_LOAD_SCRIPT_CONTENT;\n // Append the script to the head since it needs to\n // run as early as possible, after the `link` tags.\n document.head.appendChild(script);\n this.addedCspScriptsDocuments.add(document);\n }\n}\nexport class InlineCriticalCssProcessor {\n options;\n resourceCache = new Map();\n constructor(options) {\n this.options = options;\n }\n async process(html, options) {\n const critters = new CrittersExtended({ ...this.options, ...options }, this.resourceCache);\n const content = await critters.process(html);\n return {\n content,\n errors: critters.errors.length ? critters.errors : undefined,\n warnings: critters.warnings.length ? critters.warnings : undefined,\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst PERFORMANCE_MARK_PREFIX = '🅰️';\nexport function printPerformanceLogs() {\n let maxWordLength = 0;\n const benchmarks = [];\n for (const { name, duration } of performance.getEntriesByType('measure')) {\n if (!name.startsWith(PERFORMANCE_MARK_PREFIX)) {\n continue;\n }\n // `🅰️:Retrieve SSG Page` -> `Retrieve SSG Page:`\n const step = name.slice(PERFORMANCE_MARK_PREFIX.length + 1) + ':';\n if (step.length > maxWordLength) {\n maxWordLength = step.length;\n }\n benchmarks.push([step, `${duration.toFixed(1)}ms`]);\n performance.clearMeasures(name);\n }\n /* eslint-disable no-console */\n console.log('********** Performance results **********');\n for (const [step, value] of benchmarks) {\n const spaces = maxWordLength - step.length + 5;\n console.log(step + ' '.repeat(spaces) + value);\n }\n console.log('*****************************************');\n /* eslint-enable no-console */\n}\nexport async function runMethodAndMeasurePerf(label, asyncMethod) {\n const labelName = `${PERFORMANCE_MARK_PREFIX}:${label}`;\n const startLabel = `start:${labelName}`;\n const endLabel = `end:${labelName}`;\n try {\n performance.mark(startLabel);\n return await asyncMethod();\n }\n finally {\n performance.mark(endLabel);\n performance.measure(labelName, startLabel, endLabel);\n performance.clearMarks(startLabel);\n performance.clearMarks(endLabel);\n }\n}\nexport function noopRunMethodAndMeasurePerf(label, asyncMethod) {\n return asyncMethod();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { renderApplication, renderModule, ɵSERVER_CONTEXT } from '@angular/platform-server';\nimport * as fs from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { URL } from 'node:url';\nimport { InlineCriticalCssProcessor } from './inline-css-processor';\nimport { noopRunMethodAndMeasurePerf, printPerformanceLogs, runMethodAndMeasurePerf, } from './peformance-profiler';\nconst SSG_MARKER_REGEXP = /ng-server-context=[\"']\\w*\\|?ssg\\|?\\w*[\"']/;\n/**\n * A common engine to use to server render an application.\n */\nexport class CommonEngine {\n options;\n templateCache = new Map();\n inlineCriticalCssProcessor;\n pageIsSSG = new Map();\n constructor(options) {\n this.options = options;\n this.inlineCriticalCssProcessor = new InlineCriticalCssProcessor({\n minify: false,\n });\n }\n /**\n * Render an HTML document for a specific URL with specified\n * render options\n */\n async render(opts) {\n const enablePeformanceProfiler = this.options?.enablePeformanceProfiler;\n const runMethod = enablePeformanceProfiler\n ? runMethodAndMeasurePerf\n : noopRunMethodAndMeasurePerf;\n let html = await runMethod('Retrieve SSG Page', () => this.retrieveSSGPage(opts));\n if (html === undefined) {\n html = await runMethod('Render Page', () => this.renderApplication(opts));\n if (opts.inlineCriticalCss !== false) {\n const { content, errors, warnings } = await runMethod('Inline Critical CSS', () => \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.inlineCriticalCss(html, opts));\n html = content;\n // eslint-disable-next-line no-console\n warnings?.forEach((m) => console.warn(m));\n // eslint-disable-next-line no-console\n errors?.forEach((m) => console.error(m));\n }\n }\n if (enablePeformanceProfiler) {\n printPerformanceLogs();\n }\n return html;\n }\n inlineCriticalCss(html, opts) {\n return this.inlineCriticalCssProcessor.process(html, {\n outputPath: opts.publicPath ?? (opts.documentFilePath ? dirname(opts.documentFilePath) : ''),\n });\n }\n async retrieveSSGPage(opts) {\n const { publicPath, documentFilePath, url } = opts;\n if (!publicPath || !documentFilePath || url === undefined) {\n return undefined;\n }\n const pathname = canParseUrl(url) ? new URL(url).pathname : url;\n // Remove leading forward slash.\n const pagePath = resolve(publicPath, pathname.substring(1), 'index.html');\n if (pagePath !== resolve(documentFilePath)) {\n // View path doesn't match with prerender path.\n const pageIsSSG = this.pageIsSSG.get(pagePath);\n if (pageIsSSG === undefined) {\n if (await exists(pagePath)) {\n const content = await fs.promises.readFile(pagePath, 'utf-8');\n const isSSG = SSG_MARKER_REGEXP.test(content);\n this.pageIsSSG.set(pagePath, isSSG);\n if (isSSG) {\n return content;\n }\n }\n else {\n this.pageIsSSG.set(pagePath, false);\n }\n }\n else if (pageIsSSG) {\n // Serve pre-rendered page.\n return fs.promises.readFile(pagePath, 'utf-8');\n }\n }\n return undefined;\n }\n async renderApplication(opts) {\n const moduleOrFactory = this.options?.bootstrap ?? opts.bootstrap;\n if (!moduleOrFactory) {\n throw new Error('A module or bootstrap option must be provided.');\n }\n const extraProviders = [\n { provide: ɵSERVER_CONTEXT, useValue: 'ssr' },\n ...(opts.providers ?? []),\n ...(this.options?.providers ?? []),\n ];\n let document = opts.document;\n if (!document && opts.documentFilePath) {\n document = await this.getDocument(opts.documentFilePath);\n }\n const commonRenderingOptions = {\n url: opts.url,\n document,\n };\n return isBootstrapFn(moduleOrFactory)\n ? renderApplication(moduleOrFactory, {\n platformProviders: extraProviders,\n ...commonRenderingOptions,\n })\n : renderModule(moduleOrFactory, { extraProviders, ...commonRenderingOptions });\n }\n /** Retrieve the document from the cache or the filesystem */\n async getDocument(filePath) {\n let doc = this.templateCache.get(filePath);\n if (!doc) {\n doc = await fs.promises.readFile(filePath, 'utf-8');\n this.templateCache.set(filePath, doc);\n }\n return doc;\n }\n}\nasync function exists(path) {\n try {\n await fs.promises.access(path, fs.constants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isBootstrapFn(value) {\n // We can differentiate between a module and a bootstrap function by reading compiler-generated `ɵmod` static property:\n return typeof value === 'function' && !('ɵmod' in value);\n}\n// The below can be removed in favor of URL.canParse() when Node.js 18 is dropped\nfunction canParseUrl(url) {\n try {\n return !!new URL(url);\n }\n catch {\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;;;AASA;AACA;AACA;AACA,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AACjE;AACA;AACA;AACA,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC;AACA;AACA;AACA,MAAM,wBAAwB,GAAG;AACjC,IAAI,CAAC,QAAQ,CAAC;AACd;AACA;AACA;AACA,IAAI,CAAC,0CAA0C,CAAC;AAChD;AACA;AACA,IAAI,CAAC,qDAAqD,EAAE,cAAc,CAAC,IAAI,CAAC;AAChF;AACA;AACA,IAAI,CAAC,6CAA6C,CAAC;AACnD,IAAI,CAAC,8BAA8B,CAAC;AACpC,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC,6CAA6C,CAAC;AAC5F,IAAI,CAAC,GAAG,CAAC;AACT,IAAI,CAAC,KAAK,CAAC;AACX,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACb,MAAM,gBAAgB,SAAS,QAAQ,CAAC;AACxC,IAAI,eAAe,CAAC;AACpB,IAAI,aAAa,CAAC;AAClB,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,MAAM,GAAG,EAAE,CAAC;AAChB,IAAI,4BAA4B,CAAC;AACjC,IAAI,wBAAwB,GAAG,IAAI,OAAO,EAAE,CAAC;AAC7C,IAAI,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AACnC,IAAI,WAAW,CAAC,eAAe,EAAE,aAAa,EAAE;AAChD,QAAQ,KAAK,CAAC;AACd,YAAY,MAAM,EAAE;AACpB,gBAAgB,IAAI,EAAE,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or.mjs","../../../../../../k8-fastbuild-ST-70f2edae98f4/bin/packages/angular/ssr/src/peformance-profiler.mjs","../../../../../../k8-fastbuild-ST-70f2edae98f4/bin/packages/angular/ssr/src/common-engine.mjs"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport Critters from 'critters';\nimport { readFile } from 'node:fs/promises';\n/**\n * Pattern used to extract the media query set by Critters in an `onload` handler.\n */\nconst MEDIA_SET_HANDLER_PATTERN = /^this\\.media=[\"'](.*)[\"'];?$/;\n/**\n * Name of the attribute used to save the Critters media query so it can be re-assigned on load.\n */\nconst CSP_MEDIA_ATTR = 'ngCspMedia';\n/**\n * Script text used to change the media value of the link tags.\n */\nconst LINK_LOAD_SCRIPT_CONTENT = [\n `(() => {`,\n // Save the `children` in a variable since they're a live DOM node collection.\n // We iterate over the direct descendants, instead of going through a `querySelectorAll`,\n // because we know that the tags will be directly inside the `head`.\n ` const children = document.head.children;`,\n // Declare `onLoad` outside the loop to avoid leaking memory.\n // Can't be an arrow function, because we need `this` to refer to the DOM node.\n ` function onLoad() {this.media = this.getAttribute('${CSP_MEDIA_ATTR}');}`,\n // Has to use a plain for loop, because some browsers don't support\n // `forEach` on `children` which is a `HTMLCollection`.\n ` for (let i = 0; i < children.length; i++) {`,\n ` const child = children[i];`,\n ` child.hasAttribute('${CSP_MEDIA_ATTR}') && child.addEventListener('load', onLoad);`,\n ` }`,\n `})();`,\n].join('\\n');\nclass CrittersExtended extends Critters {\n optionsExtended;\n resourceCache;\n warnings = [];\n errors = [];\n initialEmbedLinkedStylesheet;\n addedCspScriptsDocuments = new WeakSet();\n documentNonces = new WeakMap();\n constructor(optionsExtended, resourceCache) {\n super({\n logger: {\n warn: (s) => this.warnings.push(s),\n error: (s) => this.errors.push(s),\n info: () => { },\n },\n logLevel: 'warn',\n path: optionsExtended.outputPath,\n publicPath: optionsExtended.deployUrl,\n compress: !!optionsExtended.minify,\n pruneSource: false,\n reduceInlineStyles: false,\n mergeStylesheets: false,\n // Note: if `preload` changes to anything other than `media`, the logic in\n // `embedLinkedStylesheetOverride` will have to be updated.\n preload: 'media',\n noscriptFallback: true,\n inlineFonts: true,\n });\n this.optionsExtended = optionsExtended;\n this.resourceCache = resourceCache;\n // We can't use inheritance to override `embedLinkedStylesheet`, because it's not declared in\n // the `Critters` .d.ts which means that we can't call the `super` implementation. TS doesn't\n // allow for `super` to be cast to a different type.\n this.initialEmbedLinkedStylesheet = this.embedLinkedStylesheet;\n this.embedLinkedStylesheet = this.embedLinkedStylesheetOverride;\n }\n async readFile(path) {\n let resourceContent = this.resourceCache.get(path);\n if (resourceContent === undefined) {\n resourceContent = await readFile(path, 'utf-8');\n this.resourceCache.set(path, resourceContent);\n }\n return resourceContent;\n }\n /**\n * Override of the Critters `embedLinkedStylesheet` method\n * that makes it work with Angular's CSP APIs.\n */\n embedLinkedStylesheetOverride = async (link, document) => {\n if (link.getAttribute('media') === 'print' && link.next?.name === 'noscript') {\n // Workaround for https://github.com/GoogleChromeLabs/critters/issues/64\n // NB: this is only needed for the webpack based builders.\n const media = link.getAttribute('onload')?.match(MEDIA_SET_HANDLER_PATTERN);\n if (media) {\n link.removeAttribute('onload');\n link.setAttribute('media', media[1]);\n link?.next?.remove();\n }\n }\n const returnValue = await this.initialEmbedLinkedStylesheet(link, document);\n const cspNonce = this.findCspNonce(document);\n if (cspNonce) {\n const crittersMedia = link.getAttribute('onload')?.match(MEDIA_SET_HANDLER_PATTERN);\n if (crittersMedia) {\n // If there's a Critters-generated `onload` handler and the file has an Angular CSP nonce,\n // we have to remove the handler, because it's incompatible with CSP. We save the value\n // in a different attribute and we generate a script tag with the nonce that uses\n // `addEventListener` to apply the media query instead.\n link.removeAttribute('onload');\n link.setAttribute(CSP_MEDIA_ATTR, crittersMedia[1]);\n this.conditionallyInsertCspLoadingScript(document, cspNonce);\n }\n // Ideally we would hook in at the time Critters inserts the `style` tags, but there isn't\n // a way of doing that at the moment so we fall back to doing it any time a `link` tag is\n // inserted. We mitigate it by only iterating the direct children of the `<head>` which\n // should be pretty shallow.\n document.head.children.forEach((child) => {\n if (child.tagName === 'style' && !child.hasAttribute('nonce')) {\n child.setAttribute('nonce', cspNonce);\n }\n });\n }\n return returnValue;\n };\n /**\n * Finds the CSP nonce for a specific document.\n */\n findCspNonce(document) {\n if (this.documentNonces.has(document)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.documentNonces.get(document);\n }\n // HTML attribute are case-insensitive, but the parser used by Critters is case-sensitive.\n const nonceElement = document.querySelector('[ngCspNonce], [ngcspnonce]');\n const cspNonce = nonceElement?.getAttribute('ngCspNonce') || nonceElement?.getAttribute('ngcspnonce') || null;\n this.documentNonces.set(document, cspNonce);\n return cspNonce;\n }\n /**\n * Inserts the `script` tag that swaps the critical CSS at runtime,\n * if one hasn't been inserted into the document already.\n */\n conditionallyInsertCspLoadingScript(document, nonce) {\n if (this.addedCspScriptsDocuments.has(document)) {\n return;\n }\n if (document.head.textContent.includes(LINK_LOAD_SCRIPT_CONTENT)) {\n // Script was already added during the build.\n this.addedCspScriptsDocuments.add(document);\n return;\n }\n const script = document.createElement('script');\n script.setAttribute('nonce', nonce);\n script.textContent = LINK_LOAD_SCRIPT_CONTENT;\n // Append the script to the head since it needs to\n // run as early as possible, after the `link` tags.\n document.head.appendChild(script);\n this.addedCspScriptsDocuments.add(document);\n }\n}\nexport class InlineCriticalCssProcessor {\n options;\n resourceCache = new Map();\n constructor(options) {\n this.options = options;\n }\n async process(html, options) {\n const critters = new CrittersExtended({ ...this.options, ...options }, this.resourceCache);\n const content = await critters.process(html);\n return {\n content,\n errors: critters.errors.length ? critters.errors : undefined,\n warnings: critters.warnings.length ? critters.warnings : undefined,\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst PERFORMANCE_MARK_PREFIX = '🅰️';\nexport function printPerformanceLogs() {\n let maxWordLength = 0;\n const benchmarks = [];\n for (const { name, duration } of performance.getEntriesByType('measure')) {\n if (!name.startsWith(PERFORMANCE_MARK_PREFIX)) {\n continue;\n }\n // `🅰️:Retrieve SSG Page` -> `Retrieve SSG Page:`\n const step = name.slice(PERFORMANCE_MARK_PREFIX.length + 1) + ':';\n if (step.length > maxWordLength) {\n maxWordLength = step.length;\n }\n benchmarks.push([step, `${duration.toFixed(1)}ms`]);\n performance.clearMeasures(name);\n }\n /* eslint-disable no-console */\n console.log('********** Performance results **********');\n for (const [step, value] of benchmarks) {\n const spaces = maxWordLength - step.length + 5;\n console.log(step + ' '.repeat(spaces) + value);\n }\n console.log('*****************************************');\n /* eslint-enable no-console */\n}\nexport async function runMethodAndMeasurePerf(label, asyncMethod) {\n const labelName = `${PERFORMANCE_MARK_PREFIX}:${label}`;\n const startLabel = `start:${labelName}`;\n const endLabel = `end:${labelName}`;\n try {\n performance.mark(startLabel);\n return await asyncMethod();\n }\n finally {\n performance.mark(endLabel);\n performance.measure(labelName, startLabel, endLabel);\n performance.clearMarks(startLabel);\n performance.clearMarks(endLabel);\n }\n}\nexport function noopRunMethodAndMeasurePerf(label, asyncMethod) {\n return asyncMethod();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { renderApplication, renderModule, ɵSERVER_CONTEXT } from '@angular/platform-server';\nimport * as fs from 'node:fs';\nimport { dirname, join, normalize, resolve } from 'node:path';\nimport { URL } from 'node:url';\nimport { InlineCriticalCssProcessor } from './inline-css-processor';\nimport { noopRunMethodAndMeasurePerf, printPerformanceLogs, runMethodAndMeasurePerf, } from './peformance-profiler';\nconst SSG_MARKER_REGEXP = /ng-server-context=[\"']\\w*\\|?ssg\\|?\\w*[\"']/;\n/**\n * A common engine to use to server render an application.\n */\nexport class CommonEngine {\n options;\n templateCache = new Map();\n inlineCriticalCssProcessor;\n pageIsSSG = new Map();\n constructor(options) {\n this.options = options;\n this.inlineCriticalCssProcessor = new InlineCriticalCssProcessor({\n minify: false,\n });\n }\n /**\n * Render an HTML document for a specific URL with specified\n * render options\n */\n async render(opts) {\n const enablePerformanceProfiler = this.options?.enablePerformanceProfiler;\n const runMethod = enablePerformanceProfiler\n ? runMethodAndMeasurePerf\n : noopRunMethodAndMeasurePerf;\n let html = await runMethod('Retrieve SSG Page', () => this.retrieveSSGPage(opts));\n if (html === undefined) {\n html = await runMethod('Render Page', () => this.renderApplication(opts));\n if (opts.inlineCriticalCss !== false) {\n const { content, errors, warnings } = await runMethod('Inline Critical CSS', () => \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.inlineCriticalCss(html, opts));\n html = content;\n // eslint-disable-next-line no-console\n warnings?.forEach((m) => console.warn(m));\n // eslint-disable-next-line no-console\n errors?.forEach((m) => console.error(m));\n }\n }\n if (enablePerformanceProfiler) {\n printPerformanceLogs();\n }\n return html;\n }\n inlineCriticalCss(html, opts) {\n return this.inlineCriticalCssProcessor.process(html, {\n outputPath: opts.publicPath ?? (opts.documentFilePath ? dirname(opts.documentFilePath) : ''),\n });\n }\n async retrieveSSGPage(opts) {\n const { publicPath, documentFilePath, url } = opts;\n if (!publicPath || !documentFilePath || url === undefined) {\n return undefined;\n }\n const { pathname } = new URL(url, 'resolve://');\n // Do not use `resolve` here as otherwise it can lead to path traversal vulnerability.\n // See: https://portswigger.net/web-security/file-path-traversal\n const pagePath = join(publicPath, pathname, 'index.html');\n if (this.pageIsSSG.get(pagePath)) {\n // Serve pre-rendered page.\n return fs.promises.readFile(pagePath, 'utf-8');\n }\n if (!pagePath.startsWith(normalize(publicPath))) {\n // Potential path traversal detected.\n return undefined;\n }\n if (pagePath === resolve(documentFilePath) || !(await exists(pagePath))) {\n // View matches with prerender path or file does not exist.\n this.pageIsSSG.set(pagePath, false);\n return undefined;\n }\n // Static file exists.\n const content = await fs.promises.readFile(pagePath, 'utf-8');\n const isSSG = SSG_MARKER_REGEXP.test(content);\n this.pageIsSSG.set(pagePath, isSSG);\n return isSSG ? content : undefined;\n }\n async renderApplication(opts) {\n const moduleOrFactory = this.options?.bootstrap ?? opts.bootstrap;\n if (!moduleOrFactory) {\n throw new Error('A module or bootstrap option must be provided.');\n }\n const extraProviders = [\n { provide: ɵSERVER_CONTEXT, useValue: 'ssr' },\n ...(opts.providers ?? []),\n ...(this.options?.providers ?? []),\n ];\n let document = opts.document;\n if (!document && opts.documentFilePath) {\n document = await this.getDocument(opts.documentFilePath);\n }\n const commonRenderingOptions = {\n url: opts.url,\n document,\n };\n return isBootstrapFn(moduleOrFactory)\n ? renderApplication(moduleOrFactory, {\n platformProviders: extraProviders,\n ...commonRenderingOptions,\n })\n : renderModule(moduleOrFactory, { extraProviders, ...commonRenderingOptions });\n }\n /** Retrieve the document from the cache or the filesystem */\n async getDocument(filePath) {\n let doc = this.templateCache.get(filePath);\n if (!doc) {\n doc = await fs.promises.readFile(filePath, 'utf-8');\n this.templateCache.set(filePath, doc);\n }\n return doc;\n }\n}\nasync function exists(path) {\n try {\n await fs.promises.access(path, fs.constants.F_OK);\n return true;\n }\n catch {\n return false;\n }\n}\nfunction isBootstrapFn(value) {\n // We can differentiate between a module and a bootstrap function by reading compiler-generated `ɵmod` static property:\n return typeof value === 'function' && !('ɵmod' in value);\n}\n"],"names":[],"mappings":";;;;;;;AASA;AACA;AACA;AACA,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AACjE;AACA;AACA;AACA,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC;AACA;AACA;AACA,MAAM,wBAAwB,GAAG;AACjC,IAAI,CAAC,QAAQ,CAAC;AACd;AACA;AACA;AACA,IAAI,CAAC,0CAA0C,CAAC;AAChD;AACA;AACA,IAAI,CAAC,qDAAqD,EAAE,cAAc,CAAC,IAAI,CAAC;AAChF;AACA;AACA,IAAI,CAAC,6CAA6C,CAAC;AACnD,IAAI,CAAC,8BA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,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,CAAC;AACD,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B;AACA,IAAI,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC;AAC7D;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare interface CommonEngineOptions {
|
|
|
29
29
|
/** A set of platform level providers for all requests. */
|
|
30
30
|
providers?: StaticProvider[];
|
|
31
31
|
/** Enable request performance profiling data collection and printing the results in the server console. */
|
|
32
|
-
|
|
32
|
+
enablePerformanceProfiler?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export declare interface CommonEngineRenderOptions {
|