File tree Expand file tree Collapse file tree
goldens/public-api/compiler-cli
packages/compiler-cli/src/ngtsc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export interface StrictTemplateOptions {
7373
7474// @public
7575export interface TargetOptions {
76- compilationMode? : ' full' | ' partial' ;
76+ compilationMode? : ' full' | ' partial' | ' experimental-local ' ;
7777}
7878
7979// (No @packageDocumentation comment for this package)
Original file line number Diff line number Diff line change @@ -383,10 +383,13 @@ export interface TargetOptions {
383383 * Specifies the compilation mode to use. The following modes are available:
384384 * - 'full': generates fully AOT compiled code using Ivy instructions.
385385 * - 'partial': generates code in a stable, but intermediate form suitable for publication to NPM.
386+ * - 'experimental-local': generates code based on each individual source file without using its
387+ * dependencies. This mode is suitable only for fast edit/refresh during development. It will be
388+ * eventually replaced by the value `local` once the feature is ready to be public.
386389 *
387390 * The default value is 'full'.
388391 */
389- compilationMode ?: 'full' | 'partial' ;
392+ compilationMode ?: 'full' | 'partial' | 'experimental-local' ;
390393}
391394
392395/**
Original file line number Diff line number Diff line change @@ -1006,9 +1006,20 @@ export class NgCompiler {
10061006 // Note: If this compilation builds `@angular/core`, we always build in full compilation
10071007 // mode. Code inside the core package is always compatible with itself, so it does not
10081008 // make sense to go through the indirection of partial compilation
1009- const compilationMode = this . options . compilationMode === 'partial' && ! isCore ?
1010- CompilationMode . PARTIAL :
1011- CompilationMode . FULL ;
1009+ let compilationMode : CompilationMode = CompilationMode . FULL ;
1010+ if ( ! isCore ) {
1011+ switch ( this . options . compilationMode ) {
1012+ case 'full' :
1013+ compilationMode = CompilationMode . FULL ;
1014+ break ;
1015+ case 'partial' :
1016+ compilationMode = CompilationMode . PARTIAL ;
1017+ break ;
1018+ case 'experimental-local' :
1019+ compilationMode = CompilationMode . LOCAL ;
1020+ break ;
1021+ }
1022+ }
10121023
10131024 // Cycles are handled in full compilation mode by "remote scoping".
10141025 // "Remote scoping" does not work well with tree shaking for libraries.
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ export enum CompilationMode {
3131 * Generates code using a stable, but intermediate format suitable to be published to NPM.
3232 */
3333 PARTIAL ,
34+
35+ /**
36+ * Generates code based on each individual source file without using its
37+ * dependencies (suitable for local dev edit/refresh workflow).
38+ */
39+ LOCAL ,
3440}
3541
3642export enum HandlerPrecedence {
You can’t perform that action at this time.
0 commit comments