Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/angular/ssr/node/src/common-engine/common-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,18 @@ export class CommonEngine {

if (pagePath === resolve(documentFilePath) || !(await exists(pagePath))) {
// View matches with prerender path or file does not exist.
this.pageIsSSG.set(pagePath, false);

return undefined;
}

// Static file exists.
const content = await fs.promises.readFile(pagePath, 'utf-8');
const isSSG = SSG_MARKER_REGEXP.test(content);
this.pageIsSSG.set(pagePath, isSSG);
if (isSSG) {
this.pageIsSSG.set(pagePath, true);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand, I don't see any use for it when is false. Additionally, I'm not sure if we would need a test, although I can't think of a way to perform one at the moment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.pageIsSSG.set(pagePath, true);
return content;

@SkyZeroZx SkyZeroZx Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alan-agius4
Q: The this.pageIsSSG.set(pagePath, true); is no longer necessary? or yes, as I understood it was necessary for this line

if (this.pageIsSSG.get(pagePath)) { 
// Serve pre-rendered page. 
return fs.promises.readFile(pagePath, 'utf-8'); 
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I mean return in the if statement not removing the `this.pageIsSSG.set’

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same thing, I had my doubts, it's already updated in the fixup!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A somewhat tangential request and sorry for the inconvenience.

I had two issue tracker reports that resulted in security advisories:

Both issues were closed (infeasible) , but since the corresponding advisories (including credits) were published, would it be possible to review them and update their status to Accepted/Fixed?

return content;
}

return isSSG ? content : undefined;
return undefined;
}

private async renderApplication(opts: CommonEngineRenderOptions): Promise<string> {
Expand Down
Loading