Skip to content

Conversation

alan-agius4
Copy link
Collaborator

This commit introduces a number of changes to the server bootstrapping process to make it more robust and less error-prone, especially for concurrent requests.

Previously, the server rendering process relied on a module-level global platform injector. This could lead to issues in server-side rendering environments where multiple requests are processed concurrently, as they could inadvertently share or overwrite the global injector state.

The new approach introduces a BootstrapContext that is passed to the bootstrapApplication function. This context provides a platform reference that is scoped to the individual request, ensuring that each server-side render has an isolated platform injector. This prevents state leakage between concurrent requests and makes the overall process more reliable.

BREAKING CHANGE:
The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

Before:

const bootstrap = () => bootstrapApplication(AppComponent, config);

After:

const bootstrap = (context: BootstrapContext) =>
  bootstrapApplication(AppComponent, config, context);

@alan-agius4 alan-agius4 added state: blocked target: patch This PR is targeted for the next patch release labels Sep 9, 2025
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit labels Sep 9, 2025
@alan-agius4 alan-agius4 requested a review from jkrems September 9, 2025 17:24
@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Sep 9, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Sep 10, 2025
@alan-agius4 alan-agius4 force-pushed the server-app-bootstrap-minor branch from f9cde8f to 4d30952 Compare September 10, 2025 15:11
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed state: blocked labels Sep 10, 2025
@alan-agius4 alan-agius4 force-pushed the server-app-bootstrap-minor branch 2 times, most recently from 3325de7 to c5ebe9c Compare September 10, 2025 15:27
…de rendering

This commit introduces a number of changes to the server bootstrapping process to make it more robust and less error-prone, especially for concurrent requests.

Previously, the server rendering process relied on a module-level global platform injector. This could lead to issues in server-side rendering environments where multiple requests are processed concurrently, as they could inadvertently share or overwrite the global injector state.

The new approach introduces a `BootstrapContext` that is passed to the `bootstrapApplication` function. This context provides a platform reference that is scoped to the individual request, ensuring that each server-side render has an isolated platform injector. This prevents state leakage between concurrent requests and makes the overall process more reliable.

BREAKING CHANGE:
The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

Before:
```ts
const bootstrap = () => bootstrapApplication(AppComponent, config);
```

After:
```ts
const bootstrap = (context: BootstrapContext) =>
  bootstrapApplication(AppComponent, config, context);
```
Update FW packages to latest minor.
@alan-agius4 alan-agius4 force-pushed the server-app-bootstrap-minor branch from c5ebe9c to 9a1031a Compare September 10, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: @angular/ssr area: build & ci Related the build and CI infrastructure of the project detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants