Skip to content

Commit 04bd523

Browse files
35165d1 fix(migrations): inject migration dropping code if everything except super is removed (#58959)
1 parent 9d99d54 commit 04bd523

File tree

5 files changed

+24
-42
lines changed

5 files changed

+24
-42
lines changed

BUILD_INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Fri Nov 29 14:01:56 UTC 2024
2-
ed965bdc0f295c00fdb17a546d59aae39f59a11b
1+
Mon Dec 2 08:01:30 UTC 2024
2+
35165d152d7f9c3c8789ebdf792037aafdc1cc66

fesm2022/compiler.mjs

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v19.1.0-next.0+sha-ed965bd
2+
* @license Angular v19.1.0-next.0+sha-35165d1
33
* (c) 2010-2024 Google LLC. https://angular.io/
44
* License: MIT
55
*/
@@ -26642,13 +26642,11 @@ class BindingParser {
2664226642
_interpolationConfig;
2664326643
_schemaRegistry;
2664426644
errors;
26645-
_allowInvalidAssignmentEvents;
26646-
constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors, _allowInvalidAssignmentEvents = false) {
26645+
constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
2664726646
this._exprParser = _exprParser;
2664826647
this._interpolationConfig = _interpolationConfig;
2664926648
this._schemaRegistry = _schemaRegistry;
2665026649
this.errors = errors;
26651-
this._allowInvalidAssignmentEvents = _allowInvalidAssignmentEvents;
2665226650
}
2665326651
get interpolationConfig() {
2665426652
return this._interpolationConfig;
@@ -27032,16 +27030,7 @@ class BindingParser {
2703227030
if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
2703327031
return true;
2703427032
}
27035-
// TODO(crisbeto): this logic is only here to support the automated migration away
27036-
// from invalid bindings. It should be removed once the migration is deleted.
27037-
if (!this._allowInvalidAssignmentEvents) {
27038-
return false;
27039-
}
27040-
if (ast instanceof Binary) {
27041-
return ((ast.operation === '&&' || ast.operation === '||' || ast.operation === '??') &&
27042-
(ast.right instanceof PropertyRead || ast.right instanceof KeyedRead));
27043-
}
27044-
return ast instanceof Conditional || ast instanceof PrefixNot;
27033+
return false;
2704527034
}
2704627035
}
2704727036
class PipeCollector extends RecursiveAstVisitor {
@@ -28674,8 +28663,8 @@ const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
2867428663
* @param options options to modify how the template is parsed
2867528664
*/
2867628665
function parseTemplate(template, templateUrl, options = {}) {
28677-
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat, allowInvalidAssignmentEvents, } = options;
28678-
const bindingParser = makeBindingParser(interpolationConfig, allowInvalidAssignmentEvents);
28666+
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
28667+
const bindingParser = makeBindingParser(interpolationConfig);
2867928668
const htmlParser = new HtmlParser();
2868028669
const parseResult = htmlParser.parse(template, templateUrl, {
2868128670
leadingTriviaChars: LEADING_TRIVIA_CHARS,
@@ -28781,8 +28770,8 @@ const elementRegistry = new DomElementSchemaRegistry();
2878128770
/**
2878228771
* Construct a `BindingParser` with a default configuration.
2878328772
*/
28784-
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, allowInvalidAssignmentEvents = false) {
28785-
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, [], allowInvalidAssignmentEvents);
28773+
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
28774+
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, []);
2878628775
}
2878728776

2878828777
const COMPONENT_VARIABLE = '%COMP%';
@@ -30894,7 +30883,7 @@ function publishFacade(global) {
3089430883
* @description
3089530884
* Entry point for all public APIs of the compiler package.
3089630885
*/
30897-
const VERSION = new Version('19.1.0-next.0+sha-ed965bd');
30886+
const VERSION = new Version('19.1.0-next.0+sha-35165d1');
3089830887

3089930888
class CompilerConfig {
3090030889
defaultEncapsulation;
@@ -32746,7 +32735,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
3274632735
function compileDeclareClassMetadata(metadata) {
3274732736
const definitionMap = new DefinitionMap();
3274832737
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
32749-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
32738+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3275032739
definitionMap.set('ngImport', importExpr(Identifiers.core));
3275132740
definitionMap.set('type', metadata.type);
3275232741
definitionMap.set('decorators', metadata.decorators);
@@ -32764,7 +32753,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
3276432753
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
3276532754
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
3276632755
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
32767-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
32756+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3276832757
definitionMap.set('ngImport', importExpr(Identifiers.core));
3276932758
definitionMap.set('type', metadata.type);
3277032759
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -32859,7 +32848,7 @@ function createDirectiveDefinitionMap(meta) {
3285932848
const definitionMap = new DefinitionMap();
3286032849
const minVersion = getMinimumVersionForPartialOutput(meta);
3286132850
definitionMap.set('minVersion', literal(minVersion));
32862-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
32851+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3286332852
// e.g. `type: MyDirective`
3286432853
definitionMap.set('type', meta.type.value);
3286532854
if (meta.isStandalone !== undefined) {
@@ -33278,7 +33267,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
3327833267
function compileDeclareFactoryFunction(meta) {
3327933268
const definitionMap = new DefinitionMap();
3328033269
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
33281-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
33270+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3328233271
definitionMap.set('ngImport', importExpr(Identifiers.core));
3328333272
definitionMap.set('type', meta.type.value);
3328433273
definitionMap.set('deps', compileDependencies(meta.deps));
@@ -33313,7 +33302,7 @@ function compileDeclareInjectableFromMetadata(meta) {
3331333302
function createInjectableDefinitionMap(meta) {
3331433303
const definitionMap = new DefinitionMap();
3331533304
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
33316-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
33305+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3331733306
definitionMap.set('ngImport', importExpr(Identifiers.core));
3331833307
definitionMap.set('type', meta.type.value);
3331933308
// Only generate providedIn property if it has a non-null value
@@ -33364,7 +33353,7 @@ function compileDeclareInjectorFromMetadata(meta) {
3336433353
function createInjectorDefinitionMap(meta) {
3336533354
const definitionMap = new DefinitionMap();
3336633355
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
33367-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
33356+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3336833357
definitionMap.set('ngImport', importExpr(Identifiers.core));
3336933358
definitionMap.set('type', meta.type.value);
3337033359
definitionMap.set('providers', meta.providers);
@@ -33397,7 +33386,7 @@ function createNgModuleDefinitionMap(meta) {
3339733386
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
3339833387
}
3339933388
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
33400-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
33389+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3340133390
definitionMap.set('ngImport', importExpr(Identifiers.core));
3340233391
definitionMap.set('type', meta.type.value);
3340333392
// We only generate the keys in the metadata if the arrays contain values.
@@ -33448,7 +33437,7 @@ function compileDeclarePipeFromMetadata(meta) {
3344833437
function createPipeDefinitionMap(meta) {
3344933438
const definitionMap = new DefinitionMap();
3345033439
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
33451-
definitionMap.set('version', literal('19.1.0-next.0+sha-ed965bd'));
33440+
definitionMap.set('version', literal('19.1.0-next.0+sha-35165d1'));
3345233441
definitionMap.set('ngImport', importExpr(Identifiers.core));
3345333442
// e.g. `type: MyPipe`
3345433443
definitionMap.set('type', meta.type.value);

fesm2022/compiler.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v19.1.0-next.0+sha-ed965bd
2+
* @license Angular v19.1.0-next.0+sha-35165d1
33
* (c) 2010-2024 Google LLC. https://angular.io/
44
* License: MIT
55
*/
@@ -363,8 +363,7 @@ declare class BindingParser {
363363
private _interpolationConfig;
364364
private _schemaRegistry;
365365
errors: ParseError[];
366-
private _allowInvalidAssignmentEvents;
367-
constructor(_exprParser: Parser, _interpolationConfig: InterpolationConfig, _schemaRegistry: ElementSchemaRegistry, errors: ParseError[], _allowInvalidAssignmentEvents?: boolean);
366+
constructor(_exprParser: Parser, _interpolationConfig: InterpolationConfig, _schemaRegistry: ElementSchemaRegistry, errors: ParseError[]);
368367
get interpolationConfig(): InterpolationConfig;
369368
createBoundHostProperties(properties: HostProperties, sourceSpan: ParseSourceSpan): ParsedProperty[] | null;
370369
createDirectiveHostEventAsts(hostListeners: HostListeners, sourceSpan: ParseSourceSpan): ParsedEvent[] | null;
@@ -2027,7 +2026,7 @@ declare function localizedString(metaBlock: I18nMeta, messageParts: LiteralPiece
20272026
/**
20282027
* Construct a `BindingParser` with a default configuration.
20292028
*/
2030-
export declare function makeBindingParser(interpolationConfig?: InterpolationConfig, allowInvalidAssignmentEvents?: boolean): BindingParser;
2029+
export declare function makeBindingParser(interpolationConfig?: InterpolationConfig): BindingParser;
20312030

20322031
export declare class MapType extends Type {
20332032
valueType: Type | null;
@@ -2702,12 +2701,6 @@ export declare interface ParseTemplateOptions {
27022701
enableBlockSyntax?: boolean;
27032702
/** Whether the `@let` syntax is enabled. */
27042703
enableLetSyntax?: boolean;
2705-
/**
2706-
* Whether the parser should allow invalid two-way bindings.
2707-
*
2708-
* This option is only present to support an automated migration away from the invalid syntax.
2709-
*/
2710-
allowInvalidAssignmentEvents?: boolean;
27112704
}
27122705

27132706
export declare class ParseTreeResult {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/compiler",
3-
"version": "19.1.0-next.0+sha-ed965bd",
3+
"version": "19.1.0-next.0+sha-35165d1",
44
"description": "Angular - the compiler library",
55
"author": "angular",
66
"license": "MIT",
@@ -11,7 +11,7 @@
1111
"tslib": "^2.3.0"
1212
},
1313
"peerDependencies": {
14-
"@angular/core": "19.1.0-next.0+sha-ed965bd"
14+
"@angular/core": "19.1.0-next.0+sha-35165d1"
1515
},
1616
"peerDependenciesMeta": {
1717
"@angular/core": {

0 commit comments

Comments
 (0)