Files
Paul Gschwendtner 12bad6576d fix(compiler-cli): libraries compiled with v16.1+ breaking with Angular framework v16.0.x (#50714)
If a library is compiling with Angular v16.1.0, the library will break
for users that are still on Angular v16.0.x. This happens because the
`DirectiveDeclaration` or `ComponentDeclaration` types are not expecting
an extra field for `signals` metadata. This field was only added to the
generic types in `16.1.0`- so compilations fail with errors like this:

```
Error: node_modules/@angular/material/icon/index.d.ts:204:18 -
  error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 9 type arguments.
```

To fix this, we quickly roll back the code for inserting this metadata
field. That way, libraries remain compatible with all v16.x framework
versions.

We continue to include the `signals` metadata if `signals: true` is set.
This is not public API anyway right now- so cannot happen- but imagine
we expose some signal APIs in e.g. 16.2.x, then we'd need this metadata
and can reasonably expect signal-component library users to use a more
recent framework core version.

PR Close #50714
2023-06-14 16:27:59 +02:00

2.9 KiB

API Report File for "@angular/upgrade_static"

Do not edit this file. It is a report generated by API Extractor.


import { DoCheck } from '@angular/core';
import { ElementRef } from '@angular/core';
import * as i0 from '@angular/core';
import { Injector } from '@angular/core';
import { NgModuleFactory } from '@angular/core';
import { NgModuleRef } from '@angular/core';
import { NgZone } from '@angular/core';
import { OnChanges } from '@angular/core';
import { OnDestroy } from '@angular/core';
import { OnInit } from '@angular/core';
import { PlatformRef } from '@angular/core';
import { SimpleChanges } from '@angular/core';
import { StaticProvider } from '@angular/core';
import { Type } from '@angular/core';
import { Version } from '@angular/core';

// @public
export function downgradeComponent(info: {
    component: Type<any>;
    downgradedModule?: string;
    propagateDigest?: boolean;
    inputs?: string[];
    outputs?: string[];
    selectors?: string[];
}): any;

// @public
export function downgradeInjectable(token: any, downgradedModule?: string): Function;

// @public
export function downgradeModule<T>(moduleOrBootstrapFn: Type<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string;

// @public @deprecated
export function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): string;

// @public
export function getAngularJSGlobal(): any;

// @public @deprecated (undocumented)
export function getAngularLib(): any;

// @public
export function setAngularJSGlobal(ng: any): void;

// @public @deprecated (undocumented)
export function setAngularLib(ng: any): void;

// @public
export class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {
    constructor(name: string, elementRef: ElementRef, injector: Injector);
    // (undocumented)
    ngDoCheck(): void;
    // (undocumented)
    ngOnChanges(changes: SimpleChanges): void;
    // (undocumented)
    ngOnDestroy(): void;
    // (undocumented)
    ngOnInit(): void;
    // (undocumented)
    static ɵdir: i0.ɵɵDirectiveDeclaration<UpgradeComponent, never, never, {}, {}, never, never, false, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<UpgradeComponent, never>;
}

// @public
export class UpgradeModule {
    $injector: any;
    constructor(
    injector: Injector,
    ngZone: NgZone,
    platformRef: PlatformRef);
    bootstrap(element: Element, modules?: string[], config?: any): any;
    injector: Injector;
    ngZone: NgZone;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<UpgradeModule, never>;
    // (undocumented)
    static ɵinj: i0.ɵɵInjectorDeclaration<UpgradeModule>;
    // (undocumented)
    static ɵmod: i0.ɵɵNgModuleDeclaration<UpgradeModule, never, never, never>;
}

// @public (undocumented)
export const VERSION: Version;

// (No @packageDocumentation comment for this package)