Angular
repository·main·Indexed 59 days ago
https://github.com/angular/angularA modern development platform for building mobile and desktop web applications using TypeScript, JavaScript, and other languages. Version 22.2.0-next.1 provides a comprehensive ecosystem including a CLI, component-based architecture, and official UI libraries like Angular Material.
What's inside Angular
- The Angular Router is a library designed to manage application state transitions and synchronize them with the browser URL. It allows you to declaratively specify application states, handle complex transitions, and implement lazy loading to split applications into multiple bundles that are loaded on demand.
What is the 'annotations' package?
mainThe
annotationspackage is responsible for compiling Angular-annotated classes, such as those using@Component,@NgModule, and other Angular decorators.It provides implementations of the
DecoratorHandlerabstraction (defined in the compiler'stransformpackage). EachDecoratorHandlerdefines the specific logic required to compile a class decorated with a particular Angular decorator, allowing the compiler to process these classes through its various compilation phases.Overview of the Angular application build system
mainStarting in v17, Angular introduced a new build system designed for improved performance and modern web standards. It replaces the deprecated webpack-based
browserbuilder.Key features include:
- Modern Output: Uses ESM with dynamic imports for lazy loading.
- Performance: Faster initial builds and incremental rebuilds using
esbuildandVite. - Integrated Capabilities: Built-in support for SSR (Server-Side Rendering) and prerendering.
- Developer Experience: Automatic hot replacement for global and component stylesheets.
Note: The existing webpack-based
browserbuilder is deprecated. While applications can temporarily continue using it, migrating to the new system is recommended.Overview of the Angular HttpClient service
mainAngular provides the
HttpClientservice, located in the@angular/common/httppackage, to facilitate communication between front-end applications and backend services via the HTTP protocol. It is used for downloading or uploading data and interacting with various back-end APIs.Key features of the
HttpClientservice include:- Typed response values: The ability to request data with specific TypeScript types.
- Streamlined error handling: Built-in mechanisms for managing request failures.
- Interception: The ability to intercept and modify outgoing requests and incoming responses using interceptors.
- Testing utilities: Robust tools designed for testing HTTP interactions in your application.
Overview of CliHelloWorldIvyI18n integration test
mainThe
CliHelloWorldIvyI18nproject is a specialized integration test suite designed to verify internationalization (i18n) workflows. It specifically tests the interaction between the Angular CLI and@angular/localizeto ensure that localization assets are correctly processed during the build pipeline.To ensure that
localeDatais correctly pulled into builds, the project utilizes aDatePipe, which triggers the necessary dependency on locale-specific data during the compilation and build phases.Overview of Signal Forms
mainSignal Forms is a library designed for managing form state in Angular applications using the reactive foundation of signals. It is intended for new applications built with signals.
Key features include:
- Automatic state synchronization: Automatically syncs the form data model with bound form fields.
- Type safety: Provides fully type-safe schemas and bindings between UI controls and the data model.
- Centralized validation: Allows defining all validation rules in a single schema.
Note: If you are working with an existing application using Reactive Forms or require specific production stability guarantees, Reactive Forms remain a valid choice.
Overview of the Large Form Benchmark
mainThe Large Form Benchmark is a specialized performance tracking tool designed to measure the impact of large-scale forms on an Angular application. It focuses on two primary metrics:
- Generated File Size: Monitors the total size of the files generated when building a large form.
- Lifecycle Performance: Tracks the time required for the creation and destruction of form widgets. This is critical because complex widgets often involve significant overhead from event listeners, host bindings, and other lifecycle hooks.
Overview of Autocomplete component
mainThe Autocomplete component is an accessible input field designed to filter and suggest options from a list as users type. It is a fully accessible combobox implementation that includes:
- Keyboard Navigation: Use arrow keys to navigate, Enter to select, and Escape to close.
- Screen Reader Support: Built-in ARIA attributes for assistive technologies.
- Dynamic Highlight Behavior: Support for inline selection suggestions.
- Signal-Based Reactivity: Uses Angular signals for state management.
- Popover API Integration: Uses the native HTML Popover API for positioning.
- Bidirectional Text Support: Automatically handles RTL (right-to-left) languages.
Overview of the generate-locales-tool
mainThe
generate-locales-toolis used by Angular to organize and optimize internationalization (i18n) data derived from CLDR (Common Locale Data Repository).Angular splits locale data into three distinct filesets:
- Default locale file: Located in
@angular/core, providing information for theenlocale (used commonly for local development). - Base currency information: Located in
@angular/common/src/i18n, containing currency symbols and fraction digits used by features like thecurrencypipe. - Locale files: Generated for all other locales, containing date/time settings, number settings, currency settings, currency symbols, and text directionality (RTL/LTR).
This tool ensures that locale data is optimized for payload size and remains strictly synchronized with CLDR data by generating files during the build process rather than storing them as static source files in Git.
- Default locale file: Located in
Understand the Hydration benchmark structure
mainThe hydration benchmark is designed to measure the performance of matching DOM nodes at runtime. It compares two distinct execution paths:
baseline: Renders a component without hydration. This serves as the control group to measure standard rendering performance.main: Uses the same code as the baseline, but enables Angular's hydration mechanism. Instead of creating new DOM nodes, Angular attempts to match and reuse existing DOM nodes.
These benchmarks are derived from the
largetablebenchmark suite.Use the logging abstraction for filtered console logs
mainThengtsclogging abstraction provides a simple way to interact with console logging while allowing logs to be filtered by severity level. This ensures that only relevant information is displayed based on the configured log level.Usage of Angular localize tools
mainThe Angular localize tools are primarily intended to be consumed via the Angular CLI.
While programmatic APIs exist, they are not officially supported and are not subject to SemVer (Semantic Versioning) breaking change guarantees. For stable production workflows, use the CLI-based interfaces provided by Angular.