Deliver web apps with confidence 🚀
Find a file
Alan Agius 45a6ac09fd fix(http): force macro task creation during HTTP request (#49546)
This commit adds a background macrotask when an XHR request is performed. The macrotask is started during `loadstart` and ended during `loadend` event.

The macrotask is needed so that the application is not stabilized during HTTP calls. This is important for server rendering, as the application is rendering when the application is stabilized.
The application is stabilized when there are no longer pending Macro and Micro tasks intercepted by Zone.js, Since an XHR request is none of these, we create a background macrotask so that Zone.js is
made aware that there is something pending.

Prior to this change, we patched the `HttpHandler` in `@angular/platform-server` but this is not enough, as there can be multiple `HttpHandler` in an application, example when importing `HttpClient` in a lazy loaded component/module.
Which causes a new unpatched instance of `HttpHandler` to be created in the child injector which is not intercepted by Zone.js and thus the application is stabalized and rendered before the XHR request is finalized.

NB: Zone.js is fundamental for SSR and currently, it's not possible to do SSR without it.

Closes: #49425

PR Close #49546
2023-03-29 09:13:41 -07:00
.circleci ci: update github.com known host given recent RSA update (#49580) 2023-03-24 12:54:11 +00:00
.devcontainer build: Fix version of images in recommended-Dockerfile. node:14-browsers doesn't exist anymore in Dockerhub (#48803) 2023-01-24 16:38:32 +00:00
.github build: update actions/checkout digest to 8f4b7f8 (#49577) 2023-03-24 10:27:35 -07:00
.husky build: remove unnecessary husky gitignore file (#42870) 2021-07-19 17:31:55 -07:00
.ng-dev build: exclude draft PRs from triage queue (#49515) 2023-03-21 16:40:48 +01:00
.vscode build: update recommended launch vscode config to use proper bazel dist path (#47831) 2022-10-24 10:42:21 +02:00
.yarn build: update to yarn v1.22.17 (#44150) 2021-11-15 11:19:05 -08:00
aio docs: fixed grammar (#49560) 2023-03-28 10:14:44 -07:00
devtools feat(core): remove entryComponents (#49484) 2023-03-23 10:38:03 -07:00
docs refactor: remove Angular Compatibility Compiler (ngcc) (#49101) 2023-02-16 16:01:17 -08:00
goldens fix(http): force macro task creation during HTTP request (#49546) 2023-03-29 09:13:41 -07:00
integration fix(http): force macro task creation during HTTP request (#49546) 2023-03-29 09:13:41 -07:00
modules refactor(compiler): drop obsolete NgFactory and NgSummary config options (#48268) 2023-02-21 13:03:59 -08:00
packages fix(http): force macro task creation during HTTP request (#49546) 2023-03-29 09:13:41 -07:00
scripts build: continue publishing @angular/bazel snapshot builds (#49583) 2023-03-24 10:35:31 -07:00
third_party build: create NodeJS ESM loader for supporting Bazel setup (#48521) 2022-12-19 19:50:40 +00:00
tools build: force benchpress to be compiled with ES2020 (#49559) 2023-03-23 08:18:45 -07:00
.bazelignore refactor: remove Angular Compatibility Compiler (ngcc) (#49101) 2023-02-16 16:01:17 -08:00
.bazelrc build: avoid unnecessary re-evaluation of starlark code (#49106) 2023-02-16 15:31:55 -08:00
.bazelversion build: update to bazel v5 for new runfiles API used in dev-infra (#45407) 2022-03-21 16:55:36 -07:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.gitattributes build: cleanup .gitattributes file and remove outdated CRLF attribute (#46513) 2022-06-28 13:38:27 -07:00
.gitignore docs: update of landing page and backup pages (#47047) 2022-12-09 16:04:34 -08:00
.gitmessage build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.npmrc build: rely on engines to prevent using npm for dependency install (#41477) 2021-04-07 12:05:01 -07:00
.nvmrc feat(core): add support for Node.js version 18 (#47730) 2022-10-11 17:21:19 +00:00
.prettierrc ci: use prettier to format yml files (#42136) 2021-05-19 11:20:20 -07:00
.pullapprove.yml ci: update pullapprove config to reflect current availability (#49592) 2023-03-27 08:43:05 -07:00
.yarnrc build: update to yarn v1.22.17 (#44150) 2021-11-15 11:19:05 -08:00
browser-providers.conf.js ci: enable Android 12 for tests on CI (#45926) 2022-05-09 11:26:10 -07:00
BUILD.bazel build: bundle tests for karma web test suites (#48521) 2022-12-19 19:50:42 +00:00
CHANGELOG.md release: cut the v16.0.0-next.4 release 2023-03-22 13:28:34 -07:00
CHANGELOG_ARCHIVE.md docs: move old changelog entries to a separate file (#45638) 2022-04-14 15:01:21 -07:00
CODE_OF_CONDUCT.md build: update CODE_OF_CONDUCT.md to match the content of angular/.github 2023-03-13 21:07:51 +00:00
CONTRIBUTING.md refactor: remove Angular Compatibility Compiler (ngcc) (#49101) 2023-02-16 16:01:17 -08:00
gulpfile.js build: remove the unused source-map-test (#46518) 2022-06-27 15:42:43 -07:00
karma-js.conf.js build: remove core-js-bundle from dependencies (#49259) 2023-03-01 11:19:48 -08:00
LICENSE build: bump license year (#44590) 2022-01-04 12:05:25 -08:00
package.json build: update cross-repo angular dependencies (#49553) 2023-03-27 15:45:46 -07:00
packages.bzl fix(bazel): stop publishing @angular/bazel package to npm (#49093) 2023-02-16 11:04:00 -08:00
README.md docs(core): Improved README.md (#49171) 2023-02-23 10:35:42 -08:00
renovate.json ci: add several dependencies to renovate ignore list (#49258) 2023-02-28 08:15:04 -08:00
SECURITY.md build: update SECURITY.md to match the content of angular/.github 2023-01-06 08:51:29 +00:00
tsconfig-tslint.json refactor(devtools): run ng-dev format on angular devtools files 2022-01-26 16:35:30 -05:00
tslint.json build: update lint path for @angular/build-tooling rules (#49266) 2023-02-28 11:56:28 -08:00
WORKSPACE build: update io_bazel_rules_sass digest to 3d2ad47 (#49428) 2023-03-15 17:11:56 -07:00
yarn.bzl build(bazel): incrementally run aio example e2e tests 2022-11-22 13:51:16 -07:00
yarn.lock build: update cross-repo angular dependencies (#49553) 2023-03-27 15:45:46 -07:00
yarn.lock.readme.md build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00

Angular - The modern web developer's platform.

angular-logo
Angular is a development platform for building mobile and desktop web applications
using TypeScript/JavaScript and other languages.

www.angular.io

Contributing Guidelines · Submit an Issue · Blog

CI status   Angular on npm   Discord conversation

InsightsSnapshot


Documentation

Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.

Advanced

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules, and more.

Want to Help?

Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then 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.

Community

Join the conversation and help the community.

Love Angular badge

Love Angular? Give our repo a star ⬆️.