angular/.github
Alan Agius 70d0639bc1
fix(core): introduce BootstrapContext for improved server bootstrapping (#63639)
* fix(core): introduce `BootstrapContext` for improved server bootstrapping

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);
```

A schematic is provided to automatically update `main.server.ts` files to pass the `BootstrapContext` to the `bootstrapApplication` call.

In addition, `getPlatform()` and `destroyPlatform()` will now return `null` and be a no-op respectively when running in a server environment.
2025-09-09 10:56:38 -07:00
..
actions ci: update to latest version of dev-infra actions (#61991) 2025-06-10 15:50:46 -07:00
ISSUE_TEMPLATE refactor: change security issue redirect to angular.dev (#58070) 2024-10-04 10:57:42 -07:00
workflows fix(core): introduce BootstrapContext for improved server bootstrapping (#63639) 2025-09-09 10:56:38 -07:00
angular-robot.yml ci: remove circleci required status from angular robot 2023-10-11 13:19:51 +02:00
ISSUE_TEMPLATE.md build: remove emojis from github issue templates (#41902) 2021-05-04 08:09:20 -07:00
PULL_REQUEST_TEMPLATE.md docs: move commit message guidelies to a separate file (#58786) 2025-03-04 19:35:54 +00:00