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 8bf80c9d2314b4f2bcf3df83ae01552a6fc49834) PR Close #63640 |
||
|---|---|---|
| .. | ||
| scripts/update-cli-help | ||
| shared-docs | ||
| src | ||
| tools | ||
| angular.json | ||
| BUILD.bazel | ||
| firebase.json | ||
| karma.conf.js | ||
| README.md | ||
| test-main.ts | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.spec.json | ||
| tsconfig.worker.json | ||
| tslint.json | ||
Angular.dev
This site is built with Angular.
The content is written primarily in Markdown format located in src/content. For simple edits, you can directly edit the file on GitHub and generate a Pull Request.
Local Development
For local development, yarn is the preferred package manager. You can setup a local environment with the following commands :
# Clone Angular repo
git clone https://github.com/angular/angular.git
# Navigate to project directory
cd angular
# Install dependencies
yarn
# Build and run local dev server
# Note: Initial build will take some time
yarn docs
If you are having issues with the docs building, see the FAQs section.
Contributing
Want to report a bug, contribute some code, or improve the documentation? Excellent!
Read through our contributing guidelines to learn about our submission process, coding rules, and more.
And if you're new, check out one of our issues labeled as help wanted or good first issue.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
FAQs
The build is failing and I'm seeing bazel:bazel failed: missing input file messages.
This is most likely due to a bazel dependency / caching issue. To resolve this, run the following command:
# Try this first
yarn bazel clean
# If that doesn't work, try it with the expunge flag
yarn bazel clean --expunge