Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@angular/compiler
Advanced tools
Package description
The @angular/compiler package is a core part of the Angular framework that is responsible for compiling Angular templates into JavaScript code that can be executed by the browser. It takes the templates and annotations provided in Angular components and generates code that represents the structure and behavior of the application.
Template Compilation
This feature allows you to compile Angular components and modules dynamically at runtime. The code sample demonstrates how to use the JIT compiler to compile a module and its components asynchronously.
import { Compiler, COMPILER_OPTIONS, CompilerFactory } from '@angular/core';
import { JitCompilerFactory } from '@angular/platform-browser-dynamic';
// Get a reference to the JIT compiler factory
const compilerFactory: CompilerFactory = platformBrowserDynamic().injector.get(CompilerFactory);
const compiler = compilerFactory.createCompiler();
// Compile a component dynamically
compiler.compileModuleAndAllComponentsAsync(DynamicModule)
.then(compiled => {
const moduleRef = compiled.ngModuleFactory.create(this.injector);
const componentFactory = compiled.componentFactories[0];
this.container.createComponent(componentFactory);
});
AOT Compilation
Ahead-of-Time (AOT) compilation converts Angular HTML and TypeScript code into efficient JavaScript code during the build process, before the browser downloads and runs the code. This code sample shows how to bootstrap an Angular application using the AOT-compiled module factory.
import { enableProdMode } from '@angular/core';
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from './app/app.module.ngfactory';
enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
Babel is a JavaScript compiler that converts ECMAScript 2015+ code into a backwards-compatible version of JavaScript that can be run by older JavaScript engines. Babel is similar to @angular/compiler in that it performs code transformation, but it is not specific to Angular and does not compile Angular templates.
TypeScript is a superset of JavaScript that compiles to plain JavaScript. It is similar to @angular/compiler in that it performs a compilation step, but TypeScript focuses on type-checking and converting TypeScript code to JavaScript, rather than compiling framework-specific templates.
The vue-template-compiler package is used to compile Vue.js templates into render functions. It is similar to @angular/compiler as both are used for compiling framework-specific templates, but they target different frameworks (Vue.js vs Angular).
Changelog
18.1.0-next.2 (2024-06-12)
| Commit | Type | Description | | -- | -- | -- | | 31d9fa40bdb | fix | adjust supported browser names for headless chrome (#56360) |
| Commit | Type | Description |
| -- | -- | -- |
| ea3c8020565 | feat | Add a schematic to migrate afterRender phase flag (#55648) |
| a655e464479 | feat | Redesign the afterRender
& afterNextRender
phases API (#55648) |
| 38effcc63ee | fix | Add back phase flag option as a deprecated API (#55648) |
| d5c6ee432fc | fix | async EventEmitter should contribute to app stability (#56308) |
| 4c7d5d8acd8 | fix | signals should be tracked when embeddedViewRef.detectChanges is called (#55719) |
| Commit | Type | Description | | -- | -- | -- | | b400e2e4d4c | feat | autocompletion for the component not imported (#55595) |
| Commit | Type | Description |
| -- | -- | -- |
| 81486c2f477 | fix | add @angular/localize/init
as polyfill in angular.json
(#56300) |
| Commit | Type | Description | | -- | -- | -- | | 96aa5c8a2c9 | fix | resolve error in standalone migration (#56302) |
| Commit | Type | Description |
| -- | -- | -- |
| a13f5da7730 | feat | Allow UrlTree
as an input to routerLink
(#56265) |
<a name="18.0.3"></a>
Readme
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
FAQs
Angular - the compiler library
The npm package @angular/compiler receives a total of 2,678,718 weekly downloads. As such, @angular/compiler popularity was classified as popular.
We found that @angular/compiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.