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 4 times, most recently from 9a1031a to c2f03e8 Compare September 10, 2025 16:06
…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 c2f03e8 to 936b93b Compare September 10, 2025 16:30
@alan-agius4 alan-agius4 merged commit b3c1d72 into angular:20.3.x Sep 10, 2025
31 checks passed
@alan-agius4 alan-agius4 deleted the server-app-bootstrap-minor branch September 10, 2025 16:45
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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