Skip to content

Commit abe9691

Browse files
committed
build: remove unnecessary feature detection that breaks with shared chunks (angular#60825)
Since APF can contain shared chunks, where e.g. `eetemplate` lives, the `coreHasSymbol` check is no longer reliable. Right now it even prevents the version range check (that is reliably working) from running because we detect a `index.d.ts` file but simply don't find the requested symbol in there (we don't expand exports via type checker). PR Close angular#60825
1 parent 7fc14d7 commit abe9691

File tree

2 files changed

+5
-43
lines changed

2 files changed

+5
-43
lines changed

packages/compiler-cli/src/ngtsc/core/src/compiler.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ import {SourceFileValidator} from '../../validation';
122122
import {Xi18nContext} from '../../xi18n';
123123
import {DiagnosticCategoryLabel, NgCompilerAdapter, NgCompilerOptions} from '../api';
124124

125-
import {coreHasSymbol} from './core_version';
126125
import {coreVersionSupportsFeature} from './feature_detection';
127126
import {angularJitApplicationTransform} from '../../transform/jit';
128127
import {untagAllTsFiles} from '../../shims';
@@ -1035,14 +1034,12 @@ export class NgCompiler {
10351034
const checkTwoWayBoundEvents = this.options['_checkTwoWayBoundEvents'] ?? false;
10361035

10371036
// Check whether the loaded version of `@angular/core` in the `ts.Program` supports unwrapping
1038-
// writable signals for type-checking. If this check fails to find a suitable .d.ts file, fall
1039-
// back to version detection. Only Angular versions greater than 17.2 have the necessary symbols
1040-
// to type check signals in two-way bindings. We also allow version 0.0.0 in case somebody is
1037+
// writable signals for type-checking. Only Angular versions greater than 17.2 have the necessary
1038+
// symbols to type check signals in two-way bindings. We also allow version 0.0.0 in case somebody is
10411039
// using Angular at head.
1042-
let allowSignalsInTwoWayBindings =
1043-
coreHasSymbol(this.inputProgram, R3Identifiers.unwrapWritableSignal) ??
1044-
(this.angularCoreVersion === null ||
1045-
coreVersionSupportsFeature(this.angularCoreVersion, '>= 17.2.0'));
1040+
const allowSignalsInTwoWayBindings =
1041+
this.angularCoreVersion === null ||
1042+
coreVersionSupportsFeature(this.angularCoreVersion, '>= 17.2.0-0');
10461043

10471044
// First select a type-checking configuration, based on whether full template type-checking is
10481045
// requested.

packages/compiler-cli/src/ngtsc/core/src/core_version.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)