Deliver web apps with confidence 🚀
Find a file
Paul Gschwendtner 62510a7b4d refactor(compiler-cli): update type check generation code to use new import manager (#54983)
Updates the type-check block generation code (also for inline type check
blocks) to use the new import manager.

This is now a requirement because the translator utilities from the
reference emit environment expect an import manager that follows the
new contract established via `ImportGenerator<TFile, TExpression>`.

For type check files, we can simply print new imports as we don't expect
existing imports to be updated. That is because type check files do not
have any _original_ source files (or in practice— those are empty).

For type check blocks inline, or constructors, imports _may_ be re-used.
This is great as it helps fixing some incrementality bugs that we were
seeing in the type check code. That is, sometimes the type check block
code may generate imports conditionally for e.g. `TemplateRef`, or
animations. Those then **prevent** incremental re-use if TCB code
switches between those continously. We tried to account for that with
signal inputs by always pre-generating such imports. This fixed the
issue for type-check files, but for inline type check blocks this is
different as we would introduce new imports in user code that would then
be changed back in subsequential edit iterations. See:
https://github.com/angular/angular/pull/53521#pullrequestreview-1778130879.

In practice, the assumption was that we would be fine since user code is
most likely containing imports to `@angular/core` already. That is a
true assumption, but unfortunately it doesn't help with incremental
re-use because TypeScript's structural change detection does not dedupe
and expects 1:1 exact imports from their old source files.

https://github.com/microsoft/TypeScript/pull/56845

To improve incremental re-use for the type check integration, we should
re-use original source file imports when possible. This commit enables
this.

To update imports and execute inline operations, we are now uisng
`magic-string` (which is then bundled) as it simplifies the string
manipulatuons.

PR Close #54983
2024-03-27 10:18:29 -07:00
.circleci ci: migrate snapshot publishing from CircleCI to GHA (#51957) 2023-10-05 10:53:22 -07:00
.devcontainer build: upgrade node version for .devcontainer example file (#53157) 2023-11-27 15:49:35 +01:00
.github build: update github/codeql-action action to v3.24.8 (#54932) 2024-03-19 16:59:49 +00:00
.husky build: simplify husky setup (#54315) 2024-02-07 16:34:13 +00:00
.ng-dev ci: Add primitives configurations for ng-dev tools (#54662) 2024-03-04 17:41:17 +01:00
.vscode docs: minor update to modify the Bazel extension url (#51925) 2023-09-27 09:21:33 -07:00
.yarn build: update yarn (#50732) 2023-06-16 10:51:09 +02:00
adev docs: update compat table with 17.3 (#54882) 2024-03-27 09:58:11 -07:00
aio [17.3.x]: build: follow-up fixes for AIO lighthouse checks (#55065) 2024-03-27 15:46:46 +01:00
devtools release: bump Angular DevTools version to 1.0.12 (#55056) 2024-03-27 09:55:41 -07:00
docs docs: add process documentation to CARETAKER.md (#54664) 2024-03-05 19:11:41 +01:00
goldens [17.3.x]: build: follow-up fixes for AIO lighthouse checks (#55065) 2024-03-27 15:46:46 +01:00
integration build: update to TypeScript 5.4 stable (#54743) 2024-03-11 09:16:55 -07:00
modules refactor: standardize doctype declaration to <!DOCTYPE html> (#51052) 2024-02-01 19:29:46 +00:00
packages refactor(compiler-cli): update type check generation code to use new import manager (#54983) 2024-03-27 10:18:29 -07:00
scripts refactor: migrate scripts to prettier formatting (#53976) 2024-01-19 10:22:06 +01:00
third_party build: create NodeJS ESM loader for supporting Bazel setup (#48521) 2022-12-19 19:50:40 +00:00
tools docs: revise documentation for @for control flow, 'track $index' performance issues explanation, and confusing 'trackBy' mention (#53806) 2024-03-04 11:37:37 +01:00
.bazelignore test: add integration test for signal inputs in CLI (#53808) 2024-01-10 12:21:05 +00:00
.bazelrc refactor: add --spawn_strategy local to --config debug (#54167) 2024-02-26 18:36:38 -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 refactor(docs-infra): refactor adev to build using architect (#53497) 2023-12-11 19:21:07 +00: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 build: update node (#54399) 2024-02-12 15:36:19 -08:00
.prettierrc refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
.pullapprove.yml docs: add updating to v17 guide (#52410) 2024-02-28 14:19:45 +01:00
.yarnrc build: update yarn (#50732) 2023-06-16 10:51:09 +02:00
browser-providers.conf.d.ts build: share Saucelabs browsers between karma test targets using background Saucelabs daemon and custom karma launcher (#49200) 2023-05-15 09:21:46 -07:00
browser-providers.conf.js ci: enable Android 12 for tests on CI (#45926) 2022-05-09 11:26:10 -07:00
BUILD.bazel refactor(docs-infra): refactor adev to build using architect (#53497) 2023-12-11 19:21:07 +00:00
CHANGELOG.md release: cut the v17.3.1 release 2024-03-20 12:49:30 -07:00
CHANGELOG_ARCHIVE.md docs: fix typos 2023-06-22 12:56:49 +02: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 docs: Fix misspelling in note of git commit --all (#51735) 2023-09-12 12:25:42 -07:00
gulpfile.js build: remove the unused source-map-test (#46518) 2022-06-27 15:42:43 -07:00
karma-js.conf.js build: share Saucelabs browsers between karma test targets using background Saucelabs daemon and custom karma launcher (#49200) 2023-05-15 09:21:46 -07:00
LICENSE docs: bump to 2024 for copyright text (#54822) 2024-03-11 13:39:49 -07:00
package.json refactor(compiler-cli): update type check generation code to use new import manager (#54983) 2024-03-27 10:18:29 -07:00
packages.bzl refactor(docs-infra): build adev application using local generated assets (#53511) 2023-12-20 14:49:31 -08:00
README.md docs: add documentation and script for local docs dev environment (#54038) 2024-01-25 18:02:27 +00:00
renovate.json ci: change label set by renovate to be merge ready immediately (#54947) 2024-03-21 22:11:10 -07: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: configure tslint to ban performance.mark usages (#52505) 2023-11-03 07:43:36 -07:00
WORKSPACE build: update io_bazel_rules_sass digest to 79bd239 (#54887) 2024-03-15 17:16:23 +00:00
yarn.bzl build: update yarn (#50732) 2023-06-16 10:51:09 +02:00
yarn.lock refactor(compiler-cli): update type check generation code to use new import manager (#54983) 2024-03-27 10:18:29 -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.

angular.dev

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

Local Development

To contribute to Angular docs, 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

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 ⬆️.