-
Notifications
You must be signed in to change notification settings - Fork 26.6k
fix(core): introduce BootstrapContext
for improved server bootstrapping
#63640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7d57459
to
b9aeba2
Compare
d68caf2
to
4bc5fba
Compare
6e61a1a
to
928aa8f
Compare
bab9312
to
fb203df
Compare
c89fefa
to
b708d1b
Compare
Use a more recent SHA, to fix issues with Chrome sandboxing.
b708d1b
to
92f791c
Compare
The `ng_update_migrations` integration test is consistently failing due to Node.js engine incompatibilities. The test attempts to install an old version of `@angular/cli` (v12) which requires a Node.js version that is no longer available in our CI environment. This test has already been removed in the v19 branch. To align with that precedent and remove a failing test that is difficult to maintain, this commit removes the test entirely.
This commit separates the integration tests into their own CI job. This change aims to speed up the overall CI process by allowing integration tests to run independently. This also aligns the CI configuration with the v19 branch.
92f791c
to
91b1d83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewed-for: dev-infra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewed-for: global-approvers
…ping (#63640) 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. (cherry picked from commit 8bf80c9) PR Close #63640
This commit updates all usages of `angular/dev-infra/github-actions` to their latest SHA. This is necessary to ensure that all workflows are using the most up-to-date versions of the actions, which can include bug fixes, performance improvements, or new features. PR Close #63640
Use a more recent SHA, to fix issues with Chrome sandboxing. PR Close #63640
The `ng_update_migrations` integration test is consistently failing due to Node.js engine incompatibilities. The test attempts to install an old version of `@angular/cli` (v12) which requires a Node.js version that is no longer available in our CI environment. This test has already been removed in the v19 branch. To align with that precedent and remove a failing test that is difficult to maintain, this commit removes the test entirely. PR Close #63640
This PR was merged into the repository. The changes were merged into the following branches:
|
This commit separates the integration tests into their own CI job. This change aims to speed up the overall CI process by allowing integration tests to run independently. This also aligns the CI configuration with the v19 branch. PR Close #63640
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 thebootstrapApplication
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:
After:
A schematic is provided to automatically update
main.server.ts
files to pass theBootstrapContext
to thebootstrapApplication
call.In addition,
getPlatform()
anddestroyPlatform()
will now returnnull
and be a no-op respectively when running in a server environment.(cherry picked from commit 8bf80c9)