mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(compiler-cli): implement ɵɵngDeclarePipe() (#40803)
This commit implements creating of `ɵɵngDeclarePipe()` calls in partial compilation, and processing of those calls in the linker and JIT compiler. See #40677 PR Close #40803
This commit is contained in:
committed by
Joey Perrott
parent
6425a6d543
commit
9cb43fb507
@@ -29,6 +29,8 @@ export interface ExportedCompilerFacade {
|
||||
export interface CompilerFacade {
|
||||
compilePipe(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3PipeMetadataFacade):
|
||||
any;
|
||||
compilePipeDeclaration(
|
||||
angularCoreEnv: CoreEnvironment, sourceMapUrl: string, declaration: R3DeclarePipeFacade): any;
|
||||
compileInjectable(
|
||||
angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectableMetadataFacade): any;
|
||||
compileInjector(
|
||||
@@ -255,6 +257,12 @@ export interface R3DeclareQueryMetadataFacade {
|
||||
emitDistinctChangesOnly?: boolean;
|
||||
}
|
||||
|
||||
export interface R3DeclarePipeFacade {
|
||||
type: Function;
|
||||
name: string;
|
||||
pure?: boolean;
|
||||
}
|
||||
|
||||
export interface ParseSourceSpan {
|
||||
start: any;
|
||||
end: any;
|
||||
|
||||
@@ -273,6 +273,7 @@ export {
|
||||
export {
|
||||
ɵɵngDeclareComponent,
|
||||
ɵɵngDeclareDirective,
|
||||
ɵɵngDeclarePipe,
|
||||
} from './render3/jit/partial';
|
||||
export {
|
||||
compilePipe as ɵcompilePipe,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {getCompilerFacade, R3DeclareComponentFacade, R3DeclareDirectiveFacade} from '../../compiler/compiler_facade';
|
||||
import {getCompilerFacade, R3DeclareComponentFacade, R3DeclareDirectiveFacade, R3DeclarePipeFacade} from '../../compiler/compiler_facade';
|
||||
import {angularCoreEnv} from './environment';
|
||||
|
||||
/**
|
||||
@@ -30,3 +30,13 @@ export function ɵɵngDeclareComponent(decl: R3DeclareComponentFacade): unknown
|
||||
return compiler.compileComponentDeclaration(
|
||||
angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles a partial pipe declaration object into a full pipe definition object.
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵngDeclarePipe(decl: R3DeclarePipeFacade): unknown {
|
||||
const compiler = getCompilerFacade();
|
||||
return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ const INTERFACE_EXCEPTIONS = new Set<string>([
|
||||
const PARTIAL_ONLY = new Set<string>([
|
||||
'ɵɵngDeclareDirective',
|
||||
'ɵɵngDeclareComponent',
|
||||
'ɵɵngDeclarePipe',
|
||||
'ChangeDetectionStrategy',
|
||||
'ViewEncapsulation',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user