@angular/core 20.3.1 → 20.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.d.ts +7 -4
- package/chrome_dev_tools_performance.d.d.ts +2 -2
- package/discovery.d.d.ts +7 -6
- package/effect.d.d.ts +2 -3
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/attribute.mjs.map +1 -1
- package/fesm2022/core.mjs +4 -4
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +31 -42
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/effect.mjs +3 -4
- package/fesm2022/effect.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/not_found.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +138 -6
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource.mjs +5 -4
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +2 -2
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal.mjs +8 -8
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/fesm2022/weak_ref.mjs.map +1 -1
- package/{graph.d.d.ts → formatter.d.d.ts} +14 -2
- package/index.d.ts +10 -8
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +3 -4
- package/rxjs-interop/index.d.ts +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/{apply_import_manager-C8vgfoJx.cjs → apply_import_manager-CUBvPp_2.cjs} +3 -3
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-DC7Yquzy.cjs → compiler_host-DJHZ7M9N.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +70 -38
- package/schematics/bundles/document-core.cjs +5 -5
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-B5lv9x1v.cjs → index-BZJ8bv9v.cjs} +50 -26
- package/schematics/bundles/{index-Bufm9_1r.cjs → index-DU_evmAi.cjs} +4 -4
- package/schematics/bundles/inject-flags.cjs +5 -5
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Ctl6-8qO.cjs → migrate_ts_type_references-58gA72Ti.cjs} +5 -5
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{project_paths-CIUSEdn4.cjs → project_paths-DcM18127.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-crm5NKE7.cjs → project_tsconfig_paths-Dqd0J7st.cjs} +50 -42
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/router-current-navigation.cjs +4 -4
- package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
- package/schematics/bundles/signal-input-migration.cjs +67 -8
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +70 -43
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -4
- package/testing/index.d.ts +2 -2
- package/weak_ref.d.d.ts +1 -1
package/fesm2022/weak_ref.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weak_ref.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"weak_ref.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/weak_ref.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport function setAlternateWeakRefImpl(impl: unknown) {\n // TODO: remove this function\n}\n"],"names":[],"mappings":";;;;;;AAQM,SAAU,uBAAuB,CAAC,IAAa,EAAA;;AAErD;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -198,5 +198,17 @@ declare function consumerDestroy(node: ReactiveNode): void;
|
|
|
198
198
|
declare function runPostProducerCreatedFn(node: ReactiveNode): void;
|
|
199
199
|
declare function setPostProducerCreatedFn(fn: ReactiveHookFn | null): ReactiveHookFn | null;
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
declare global {
|
|
202
|
+
var devtoolsFormatters: any[];
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Installs the custom formatter into custom formatting on Signals in the devtools.
|
|
206
|
+
*
|
|
207
|
+
* Supported by both Chrome and Firefox.
|
|
208
|
+
*
|
|
209
|
+
* @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html
|
|
210
|
+
*/
|
|
211
|
+
declare function installDevToolsSignalFormatter(): void;
|
|
212
|
+
|
|
213
|
+
export { REACTIVE_NODE, SIGNAL, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, installDevToolsSignalFormatter, isInNotificationPhase, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runPostProducerCreatedFn, setActiveConsumer, setPostProducerCreatedFn };
|
|
202
214
|
export type { Reactive, ReactiveHookFn, ReactiveNode, ValueEqualityFn };
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { SIGNAL, ValueEqualityFn as ValueEqualityFn$1 } from './
|
|
7
|
+
import { SIGNAL, ValueEqualityFn as ValueEqualityFn$1 } from './formatter.d.js';
|
|
8
8
|
import { Signal, WritableSignal, OutputRef, Provider, EnvironmentProviders, Type as Type$1, ModuleWithProviders, TypeProvider, ValueProvider, ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, ProviderToken, StaticProvider, Injector, ValueSansProvider, ExistingSansProvider, StaticClassSansProvider, ConstructorSansProvider, FactorySansProvider, ClassSansProvider, InjectionToken, InternalInjectFlags, InjectOptions, ValueEqualityFn, EventCallback, isSignal, enableProfiling as enableProfiling$1 } from './chrome_dev_tools_performance.d.js';
|
|
9
9
|
export { AbstractType, CreateSignalOptions, DestroyRef, DestroyableInjector, ImportedNgModuleProviders, OutputRefSubscription, signal, InternalEnvironmentProviders as ɵInternalEnvironmentProviders, JSACTION_EVENT_CONTRACT as ɵJSACTION_EVENT_CONTRACT, Writable as ɵWritable, isEnvironmentProviders as ɵisEnvironmentProviders, ɵunwrapWritableSignal } from './chrome_dev_tools_performance.d.js';
|
|
10
10
|
import { InputSignalNode, TypeDecorator, AfterRenderRef, EffectCleanupRegisterFn, SchemaMetadata, ComponentDef, DirectiveDef, CssSelectorList, DirectiveDefFeature, HostBindingsFunction, TAttributes, ContentQueriesFunction, ViewQueriesFunction, ComponentTemplate, TConstantsOrFactory, ComponentDefFeature, ViewEncapsulation as ViewEncapsulation$1, ChangeDetectionStrategy as ChangeDetectionStrategy$1, TypeOrFactory, DependencyTypeList, InputFlags, InputTransformFunction, EmbeddedViewRef, LView, ApplicationRef, ChangeDetectorRef, ComponentFactory as ComponentFactory$1, NgModuleRef as NgModuleRef$1, EnvironmentInjector, DirectiveWithBindings, Binding, ComponentRef as ComponentRef$1, ElementRef, ComponentFactoryResolver as ComponentFactoryResolver$1, InternalNgModuleRef, NgModuleFactory as NgModuleFactory$1, ViewRef as ViewRef$1, PlatformRef, NgZone, ChangeDetectionScheduler, NotificationSource, ɵɵFactoryDeclaration as __FactoryDeclaration, ɵɵInjectableDeclaration as __InjectableDeclaration, ɵɵNgModuleDeclaration as __NgModuleDeclaration, ɵɵInjectorDeclaration as __InjectorDeclaration, DeferBlockDependencyInterceptor, DeferBlockConfig, DeferBlockState, TNode, LContainer, TView, TDeferBlockDetails, RNode, Component, TrustedHTML, DehydratedDeferBlock, CompilerOptions, HostDirectiveConfig, ComponentType, NgModuleScopeInfoFromDecorator, DependencyResolverFn, TDeferDetailsFlags, SanitizerFn, AnimationFunction, LocalRefExtractor, OpaqueViewState, GlobalTargetResolver, ProjectionSlots, QueryFlags, QueryList, RElement, RawScopeInfoFromDecorator, ClassDebugInfo, Directive, NgModule, Pipe, TrustedScriptURL, TrustedScript, PipeType, DirectiveType } from './discovery.d.js';
|
|
@@ -2178,6 +2178,7 @@ declare function computed<T>(computation: () => T, options?: CreateComputedOptio
|
|
|
2178
2178
|
*/
|
|
2179
2179
|
declare function linkedSignal<D>(computation: () => D, options?: {
|
|
2180
2180
|
equal?: ValueEqualityFn<NoInfer<D>>;
|
|
2181
|
+
debugName?: string;
|
|
2181
2182
|
}): WritableSignal<D>;
|
|
2182
2183
|
/**
|
|
2183
2184
|
* Creates a writable signal whose value is initialized and reset by the linked, reactive computation.
|
|
@@ -2194,6 +2195,7 @@ declare function linkedSignal<S, D>(options: {
|
|
|
2194
2195
|
value: NoInfer<D>;
|
|
2195
2196
|
}) => D;
|
|
2196
2197
|
equal?: ValueEqualityFn<NoInfer<D>>;
|
|
2198
|
+
debugName?: string;
|
|
2197
2199
|
}): WritableSignal<D>;
|
|
2198
2200
|
|
|
2199
2201
|
/**
|
|
@@ -4870,7 +4872,7 @@ declare const enum RuntimeErrorCode {
|
|
|
4870
4872
|
INVALID_BINDING_TARGET = 316,
|
|
4871
4873
|
INVALID_SET_INPUT_CALL = 317,
|
|
4872
4874
|
MULTIPLE_PLATFORMS = 400,
|
|
4873
|
-
PLATFORM_NOT_FOUND = 401,
|
|
4875
|
+
PLATFORM_NOT_FOUND = -401,
|
|
4874
4876
|
MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
|
|
4875
4877
|
BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,
|
|
4876
4878
|
PLATFORM_ALREADY_DESTROYED = 404,
|
|
@@ -6442,12 +6444,12 @@ declare function ɵɵdeferHydrateOnViewport(): void;
|
|
|
6442
6444
|
declare function ɵɵadvance(delta?: number): void;
|
|
6443
6445
|
|
|
6444
6446
|
/**
|
|
6445
|
-
* Update an ARIA attribute
|
|
6447
|
+
* Update an ARIA attribute on a selected element.
|
|
6446
6448
|
*
|
|
6447
|
-
* If the
|
|
6448
|
-
* inputs will be set instead of the element
|
|
6449
|
+
* If the attribute name also exists as an input property on any of the element's directives, those
|
|
6450
|
+
* inputs will be set instead of the element attribute.
|
|
6449
6451
|
*
|
|
6450
|
-
* @param name Name of the ARIA attribute
|
|
6452
|
+
* @param name Name of the ARIA attribute (beginning with `aria-`).
|
|
6451
6453
|
* @param value New value to write.
|
|
6452
6454
|
* @returns This function returns itself so that it may be chained.
|
|
6453
6455
|
*
|
|
@@ -9201,7 +9203,7 @@ declare const depsTracker: DepsTracker;
|
|
|
9201
9203
|
* `[[element1, element2], [element3]]`: projects `element1` and `element2` into one `<ng-content>`,
|
|
9202
9204
|
* and `element3` into a separate `<ng-content>`.
|
|
9203
9205
|
* * `directives` (optional): Directives that should be applied to the component.
|
|
9204
|
-
* * `
|
|
9206
|
+
* * `bindings` (optional): Bindings to apply to the root component.
|
|
9205
9207
|
* @returns ComponentRef instance that represents a given Component.
|
|
9206
9208
|
*
|
|
9207
9209
|
* @publicApi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/core",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.3",
|
|
4
4
|
"description": "Angular - the core framework",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tslib": "^2.3.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/compiler": "20.3.
|
|
49
|
+
"@angular/compiler": "20.3.3",
|
|
50
50
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
51
51
|
"zone.js": "~0.15.0"
|
|
52
52
|
},
|
package/primitives/di/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ReactiveNode, ValueEqualityFn, SIGNAL } from '../../
|
|
8
|
-
export { REACTIVE_NODE, Reactive, ReactiveHookFn, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, isInNotificationPhase, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runPostProducerCreatedFn, setActiveConsumer, setPostProducerCreatedFn } from '../../
|
|
7
|
+
import { ReactiveNode, ValueEqualityFn, SIGNAL } from '../../formatter.d.js';
|
|
8
|
+
export { REACTIVE_NODE, Reactive, ReactiveHookFn, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, installDevToolsSignalFormatter, isInNotificationPhase, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runPostProducerCreatedFn, setActiveConsumer, setPostProducerCreatedFn } from '../../formatter.d.js';
|
|
9
9
|
import { SignalNode } from '../../effect.d.js';
|
|
10
10
|
export { BASE_EFFECT_NODE, BaseEffectNode, SIGNAL_NODE, SignalGetter, createSignal, runEffect, runPostSignalSetFn, setPostSignalSetFn, signalGetFn, signalSetFn, signalUpdateFn } from '../../effect.d.js';
|
|
11
11
|
export { setAlternateWeakRefImpl } from '../../weak_ref.d.js';
|
|
@@ -106,7 +106,6 @@ interface Watch {
|
|
|
106
106
|
[SIGNAL]: WatchNode;
|
|
107
107
|
}
|
|
108
108
|
interface WatchNode extends ReactiveNode {
|
|
109
|
-
hasRun: boolean;
|
|
110
109
|
fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null;
|
|
111
110
|
schedule: ((watch: Watch) => void) | null;
|
|
112
111
|
cleanupFn: WatchCleanupFn;
|
package/rxjs-interop/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { ValueEqualityFn } from '../formatter.d.js';
|
|
7
8
|
import { OutputRef, DestroyRef, Injector, Signal } from '../chrome_dev_tools_performance.d.js';
|
|
8
9
|
import { OutputOptions, BaseResourceOptions, ResourceLoaderParams, ResourceRef } from '../api.d.js';
|
|
9
10
|
import '../event_dispatcher.d.js';
|
|
10
11
|
import { Observable, MonoTypeOperatorFunction, Subscribable } from 'rxjs';
|
|
11
|
-
import { ValueEqualityFn } from '../graph.d.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Declares an Angular output that is using an RxJS observable as a source
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
require('@angular-devkit/core');
|
|
10
10
|
require('node:path/posix');
|
|
11
|
-
var project_paths = require('./project_paths-
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
11
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
13
13
|
var ts = require('typescript');
|
|
14
14
|
require('os');
|
|
15
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
16
|
-
require('./index-
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-CUBvPp_2.cjs');
|
|
16
|
+
require('./index-BZJ8bv9v.cjs');
|
|
17
17
|
require('path');
|
|
18
18
|
require('node:path');
|
|
19
19
|
require('@angular-devkit/schematics');
|
package/schematics/bundles/{apply_import_manager-C8vgfoJx.cjs → apply_import_manager-CUBvPp_2.cjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
12
|
-
var project_paths = require('./project_paths-
|
|
11
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
12
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Applies import manager changes, and writes them as replacements the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
require('@angular-devkit/core');
|
|
10
10
|
require('node:path/posix');
|
|
11
|
-
var project_paths = require('./project_paths-
|
|
11
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
12
12
|
var ts = require('typescript');
|
|
13
13
|
require('os');
|
|
14
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
15
|
-
var index = require('./index-
|
|
14
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
15
|
+
var index = require('./index-BZJ8bv9v.cjs');
|
|
16
16
|
require('path');
|
|
17
17
|
require('node:path');
|
|
18
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
18
|
+
var apply_import_manager = require('./apply_import_manager-CUBvPp_2.cjs');
|
|
19
19
|
require('@angular-devkit/schematics');
|
|
20
20
|
require('fs');
|
|
21
21
|
require('module');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
10
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
11
11
|
require('os');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var path = require('node:path');
|
|
11
|
-
var compiler_host = require('./compiler_host-
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
11
|
+
var compiler_host = require('./compiler_host-DJHZ7M9N.cjs');
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
13
13
|
var ts = require('typescript');
|
|
14
14
|
var p = require('path');
|
|
15
15
|
require('os');
|
|
@@ -410,6 +410,7 @@ const endMarkerRegex = new RegExp(endMarker, 'gm');
|
|
|
410
410
|
const startI18nMarkerRegex = new RegExp(startI18nMarker, 'gm');
|
|
411
411
|
const endI18nMarkerRegex = new RegExp(endI18nMarker, 'gm');
|
|
412
412
|
const replaceMarkerRegex = new RegExp(`${startMarker}|${endMarker}`, 'gm');
|
|
413
|
+
const PRIORITY_WEIGHT_TEMPLATE_REFERENCE_BY_OUTLET = 2;
|
|
413
414
|
/**
|
|
414
415
|
* Analyzes a source file to find file that need to be migrated and the text ranges within them.
|
|
415
416
|
* @param sourceFile File to be analyzed.
|
|
@@ -718,34 +719,6 @@ function getTemplates(template) {
|
|
|
718
719
|
}
|
|
719
720
|
return new Map();
|
|
720
721
|
}
|
|
721
|
-
function countTemplateUsage(nodes, templateName) {
|
|
722
|
-
let count = 0;
|
|
723
|
-
let isReferencedInTemplateOutlet = false;
|
|
724
|
-
for (const node of nodes) {
|
|
725
|
-
if (node.attrs) {
|
|
726
|
-
for (const attr of node.attrs) {
|
|
727
|
-
if (attr.name === '*ngTemplateOutlet' && attr.value === templateName.slice(1)) {
|
|
728
|
-
isReferencedInTemplateOutlet = true;
|
|
729
|
-
break;
|
|
730
|
-
}
|
|
731
|
-
if (attr.name.trim() === templateName) {
|
|
732
|
-
count++;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
if (node.children) {
|
|
737
|
-
if (node.name === 'for') {
|
|
738
|
-
for (const child of node.children) {
|
|
739
|
-
if (child.value?.includes(templateName.slice(1))) {
|
|
740
|
-
count++;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
count += countTemplateUsage(node.children, templateName);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
return isReferencedInTemplateOutlet ? count + 2 : count;
|
|
748
|
-
}
|
|
749
722
|
function updateTemplates(template, templates) {
|
|
750
723
|
const updatedTemplates = getTemplates(template);
|
|
751
724
|
for (let [key, tmpl] of updatedTemplates) {
|
|
@@ -769,9 +742,10 @@ function processNgTemplates(template, sourceFile) {
|
|
|
769
742
|
try {
|
|
770
743
|
const templates = getTemplates(template);
|
|
771
744
|
// swap placeholders and remove
|
|
772
|
-
for (const [
|
|
773
|
-
const
|
|
774
|
-
const
|
|
745
|
+
for (const [nameWithHash, t] of templates) {
|
|
746
|
+
const name = nameWithHash.slice(1);
|
|
747
|
+
const replaceRegex = new RegExp(getPlaceholder(name), 'g');
|
|
748
|
+
const forRegex = new RegExp(getPlaceholder(nameWithHash.slice(1), PlaceholderKind.Alternate), 'g');
|
|
775
749
|
const forMatches = [...template.matchAll(forRegex)];
|
|
776
750
|
const matches = [...forMatches, ...template.matchAll(replaceRegex)];
|
|
777
751
|
let safeToRemove = true;
|
|
@@ -796,7 +770,12 @@ function processNgTemplates(template, sourceFile) {
|
|
|
796
770
|
template = template.replace(replaceRegex, t.children);
|
|
797
771
|
}
|
|
798
772
|
const dist = matches.filter((obj, index, self) => index === self.findIndex((t) => t.input === obj.input));
|
|
799
|
-
|
|
773
|
+
// Check if template is used by ngTemplateOutlet in addition to control flow
|
|
774
|
+
const hasTemplateOutletUsage = checkForTemplateOutletUsage(template, nameWithHash.slice(1));
|
|
775
|
+
// Only remove template if it's safe to do so AND not used by ngTemplateOutlet
|
|
776
|
+
if ((t.count === dist.length || t.count - matches.length === 1) &&
|
|
777
|
+
safeToRemove &&
|
|
778
|
+
!hasTemplateOutletUsage) {
|
|
800
779
|
const refsInComponentFile = getViewChildOrViewChildrenNames(sourceFile);
|
|
801
780
|
if (refsInComponentFile?.length > 0) {
|
|
802
781
|
const templateRefs = getTemplateReferences(template);
|
|
@@ -826,6 +805,59 @@ function processNgTemplates(template, sourceFile) {
|
|
|
826
805
|
return { migrated: template, err: err };
|
|
827
806
|
}
|
|
828
807
|
}
|
|
808
|
+
function analyzeTemplateUsage(nodes, templateName) {
|
|
809
|
+
let count = 0;
|
|
810
|
+
let isReferencedInTemplateOutlet = false;
|
|
811
|
+
const templateNameWithHash = `#${templateName}`;
|
|
812
|
+
function traverseNodes(nodeList) {
|
|
813
|
+
for (const node of nodeList) {
|
|
814
|
+
if (node.attrs) {
|
|
815
|
+
for (const attr of node.attrs) {
|
|
816
|
+
if ((attr.name === '*ngTemplateOutlet' || attr.name === '[ngTemplateOutlet]') &&
|
|
817
|
+
attr.value === templateName) {
|
|
818
|
+
isReferencedInTemplateOutlet = true;
|
|
819
|
+
}
|
|
820
|
+
if (attr.name.trim() === templateNameWithHash) {
|
|
821
|
+
count++;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (node.children) {
|
|
826
|
+
if (node.name === 'for') {
|
|
827
|
+
for (const child of node.children) {
|
|
828
|
+
if (child.value?.includes(templateName)) {
|
|
829
|
+
count++;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
traverseNodes(node.children);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
traverseNodes(nodes);
|
|
838
|
+
return {
|
|
839
|
+
isReferencedInTemplateOutlet,
|
|
840
|
+
totalCount: isReferencedInTemplateOutlet
|
|
841
|
+
? count + PRIORITY_WEIGHT_TEMPLATE_REFERENCE_BY_OUTLET
|
|
842
|
+
: count,
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Checks if a template is used by ngTemplateOutlet directive
|
|
847
|
+
*/
|
|
848
|
+
function checkForTemplateOutletUsage(template, templateName) {
|
|
849
|
+
const parsed = parseTemplate(template);
|
|
850
|
+
if (parsed.tree === undefined) {
|
|
851
|
+
return false;
|
|
852
|
+
}
|
|
853
|
+
const result = analyzeTemplateUsage(parsed.tree.rootNodes, templateName);
|
|
854
|
+
return result.isReferencedInTemplateOutlet;
|
|
855
|
+
}
|
|
856
|
+
function countTemplateUsage(nodes, templateNameWithHash) {
|
|
857
|
+
const templateName = templateNameWithHash.slice(1);
|
|
858
|
+
const result = analyzeTemplateUsage(nodes, templateName);
|
|
859
|
+
return result.totalCount;
|
|
860
|
+
}
|
|
829
861
|
function getViewChildOrViewChildrenNames(sourceFile) {
|
|
830
862
|
const names = [];
|
|
831
863
|
function visit(node) {
|
|
@@ -850,11 +882,11 @@ function getTemplateReferences(template) {
|
|
|
850
882
|
if (parsed.tree === undefined) {
|
|
851
883
|
return [];
|
|
852
884
|
}
|
|
853
|
-
const
|
|
885
|
+
const templateNameRefWithoutHash = [];
|
|
854
886
|
function visitNodes(nodes) {
|
|
855
887
|
for (const node of nodes) {
|
|
856
888
|
if (node?.name === 'ng-template') {
|
|
857
|
-
|
|
889
|
+
templateNameRefWithoutHash.push(...node.attrs?.map((ref) => ref?.name?.slice(1)));
|
|
858
890
|
}
|
|
859
891
|
if (node.children) {
|
|
860
892
|
visitNodes(node.children);
|
|
@@ -862,7 +894,7 @@ function getTemplateReferences(template) {
|
|
|
862
894
|
}
|
|
863
895
|
}
|
|
864
896
|
visitNodes(parsed.tree.rootNodes);
|
|
865
|
-
return
|
|
897
|
+
return templateNameRefWithoutHash;
|
|
866
898
|
}
|
|
867
899
|
function replaceRemainingPlaceholders(template) {
|
|
868
900
|
const pattern = '.*';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
9
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
10
10
|
require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
13
|
-
require('./index-
|
|
12
|
+
var apply_import_manager = require('./apply_import_manager-CUBvPp_2.cjs');
|
|
13
|
+
require('./index-BZJ8bv9v.cjs');
|
|
14
14
|
require('path');
|
|
15
15
|
require('node:path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
16
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
17
17
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
19
19
|
require('node:path/posix');
|