@angular/upgrade 19.0.0-next.9 → 19.0.0-rc.0

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.0.0-next.9
2
+ * @license Angular v19.0.0-rc.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -17,7 +17,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
17
17
  /**
18
18
  * @publicApi
19
19
  */
20
- const VERSION = new Version('19.0.0-next.9');
20
+ const VERSION = new Version('19.0.0-rc.0');
21
21
 
22
22
  function noNg() {
23
23
  throw new Error('AngularJS v1.x is not loaded!');
@@ -118,6 +118,14 @@ const UPGRADE_MODULE_NAME = '$$UpgradeModule';
118
118
  * and attribute have the same identifier.
119
119
  */
120
120
  class PropertyBinding {
121
+ prop;
122
+ attr;
123
+ bracketAttr;
124
+ bracketParenAttr;
125
+ parenAttr;
126
+ onAttr;
127
+ bindAttr;
128
+ bindonAttr;
121
129
  constructor(prop, attr) {
122
130
  this.prop = prop;
123
131
  this.attr = attr;
@@ -235,6 +243,9 @@ function validateInjectionKey($injector, downgradedModule, injectionKey, attempt
235
243
  }
236
244
  }
237
245
  class Deferred {
246
+ promise;
247
+ resolve;
248
+ reject;
238
249
  constructor() {
239
250
  this.promise = new Promise((res, rej) => {
240
251
  this.resolve = res;
@@ -276,6 +287,20 @@ const INITIAL_VALUE$1 = {
276
287
  __UNINITIALIZED__: true,
277
288
  };
278
289
  class DowngradeComponentAdapter {
290
+ element;
291
+ attrs;
292
+ scope;
293
+ ngModel;
294
+ parentInjector;
295
+ $compile;
296
+ $parse;
297
+ componentFactory;
298
+ wrapCallback;
299
+ unsafelyOverwriteSignalInputs;
300
+ implementsOnChanges = false;
301
+ inputChangeCount = 0;
302
+ inputChanges = {};
303
+ componentScope;
279
304
  constructor(element, attrs, scope, ngModel, parentInjector, $compile, $parse, componentFactory, wrapCallback, unsafelyOverwriteSignalInputs) {
280
305
  this.element = element;
281
306
  this.attrs = attrs;
@@ -287,9 +312,6 @@ class DowngradeComponentAdapter {
287
312
  this.componentFactory = componentFactory;
288
313
  this.wrapCallback = wrapCallback;
289
314
  this.unsafelyOverwriteSignalInputs = unsafelyOverwriteSignalInputs;
290
- this.implementsOnChanges = false;
291
- this.inputChangeCount = 0;
292
- this.inputChanges = {};
293
315
  this.componentScope = scope.$new();
294
316
  }
295
317
  compileContents() {
@@ -559,10 +581,9 @@ function isThenable(obj) {
559
581
  * Synchronous, promise-like object.
560
582
  */
561
583
  class SyncPromise {
562
- constructor() {
563
- this.resolved = false;
564
- this.callbacks = [];
565
- }
584
+ value;
585
+ resolved = false;
586
+ callbacks = [];
566
587
  static all(valuesOrPromises) {
567
588
  const aggrPromise = new SyncPromise();
568
589
  let resolvedCount = 0;
@@ -777,10 +798,11 @@ function downgradeComponent(info) {
777
798
  * to preserve the synchronous nature of AngularJS's `$compile`.
778
799
  */
779
800
  class ParentInjectorPromise extends SyncPromise {
801
+ element;
802
+ injectorKey = controllerKey(INJECTOR_KEY);
780
803
  constructor(element) {
781
804
  super();
782
805
  this.element = element;
783
- this.injectorKey = controllerKey(INJECTOR_KEY);
784
806
  // Store the promise on the element.
785
807
  element.data(this.injectorKey, this);
786
808
  }
@@ -917,6 +939,13 @@ function trustedHTMLFromLegacyTemplate(html) {
917
939
  const REQUIRE_PREFIX_RE = /^(\^\^?)?(\?)?(\^\^?)?/;
918
940
  // Classes
919
941
  class UpgradeHelper {
942
+ name;
943
+ $injector;
944
+ element;
945
+ $element;
946
+ directive;
947
+ $compile;
948
+ $controller;
920
949
  constructor(injector, name, elementRef, directive) {
921
950
  this.name = name;
922
951
  this.$injector = injector.get($INJECTOR);
@@ -1159,27 +1188,30 @@ function getOutputPropertyMapName(name) {
1159
1188
  return `output_${name}`;
1160
1189
  }
1161
1190
  class UpgradeNg1ComponentAdapterBuilder {
1191
+ name;
1192
+ type;
1193
+ inputs = [];
1194
+ inputsRename = [];
1195
+ outputs = [];
1196
+ outputsRename = [];
1197
+ propertyOutputs = [];
1198
+ checkProperties = [];
1199
+ propertyMap = {};
1200
+ directive = null;
1201
+ template;
1162
1202
  constructor(name) {
1163
1203
  this.name = name;
1164
- this.inputs = [];
1165
- this.inputsRename = [];
1166
- this.outputs = [];
1167
- this.outputsRename = [];
1168
- this.propertyOutputs = [];
1169
- this.checkProperties = [];
1170
- this.propertyMap = {};
1171
- this.directive = null;
1172
1204
  const selector = name.replace(CAMEL_CASE, (all, next) => '-' + next.toLowerCase());
1173
1205
  const self = this;
1174
1206
  let MyClass = class MyClass extends UpgradeNg1ComponentAdapter {
1175
1207
  constructor(scope, injector, elementRef) {
1176
1208
  super(new UpgradeHelper(injector, name, elementRef, self.directive || undefined), scope, self.template, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap);
1177
1209
  }
1178
- static { this.ctorParameters = () => [
1210
+ static ctorParameters = () => [
1179
1211
  { type: undefined, decorators: [{ type: Inject, args: [$SCOPE,] }] },
1180
1212
  { type: Injector },
1181
1213
  { type: ElementRef }
1182
- ]; }
1214
+ ];
1183
1215
  };
1184
1216
  MyClass = __decorate([
1185
1217
  Directive({
@@ -1187,6 +1219,7 @@ class UpgradeNg1ComponentAdapterBuilder {
1187
1219
  selector: selector,
1188
1220
  inputs: this.inputsRename,
1189
1221
  outputs: this.outputsRename,
1222
+ standalone: false,
1190
1223
  }),
1191
1224
  __metadata("design:paramtypes", [Object, Injector, ElementRef])
1192
1225
  ], MyClass);
@@ -1252,6 +1285,20 @@ class UpgradeNg1ComponentAdapterBuilder {
1252
1285
  }
1253
1286
  }
1254
1287
  class UpgradeNg1ComponentAdapter {
1288
+ helper;
1289
+ template;
1290
+ inputs;
1291
+ outputs;
1292
+ propOuts;
1293
+ checkProperties;
1294
+ propertyMap;
1295
+ controllerInstance = null;
1296
+ destinationObj = null;
1297
+ checkLastValues = [];
1298
+ directive;
1299
+ element;
1300
+ $element = null;
1301
+ componentScope;
1255
1302
  constructor(helper, scope, template, inputs, outputs, propOuts, checkProperties, propertyMap) {
1256
1303
  this.helper = helper;
1257
1304
  this.template = template;
@@ -1260,10 +1307,6 @@ class UpgradeNg1ComponentAdapter {
1260
1307
  this.propOuts = propOuts;
1261
1308
  this.checkProperties = checkProperties;
1262
1309
  this.propertyMap = propertyMap;
1263
- this.controllerInstance = null;
1264
- this.destinationObj = null;
1265
- this.checkLastValues = [];
1266
- this.$element = null;
1267
1310
  this.directive = helper.directive;
1268
1311
  this.element = helper.element;
1269
1312
  this.$element = helper.$element;
@@ -1355,10 +1398,10 @@ class UpgradeNg1ComponentAdapter {
1355
1398
  setComponentProperty(name, value) {
1356
1399
  this.destinationObj[this.propertyMap[name]] = value;
1357
1400
  }
1358
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.9", ngImport: i0, type: UpgradeNg1ComponentAdapter, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
1359
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.9", type: UpgradeNg1ComponentAdapter, usesOnChanges: true, ngImport: i0 }); }
1401
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: UpgradeNg1ComponentAdapter, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
1402
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.0", type: UpgradeNg1ComponentAdapter, isStandalone: true, usesOnChanges: true, ngImport: i0 });
1360
1403
  }
1361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9", ngImport: i0, type: UpgradeNg1ComponentAdapter, decorators: [{
1404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: UpgradeNg1ComponentAdapter, decorators: [{
1362
1405
  type: Directive
1363
1406
  }], ctorParameters: () => [{ type: UpgradeHelper }, { type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }] });
1364
1407
 
@@ -1446,22 +1489,24 @@ let upgradeCount = 0;
1446
1489
  * @publicApi
1447
1490
  */
1448
1491
  class UpgradeAdapter {
1492
+ ng2AppModule;
1493
+ compilerOptions;
1494
+ idPrefix = `NG2_UPGRADE_${upgradeCount++}_`;
1495
+ downgradedComponents = [];
1496
+ /**
1497
+ * An internal map of ng1 components which need to up upgraded to ng2.
1498
+ *
1499
+ * We can't upgrade until injector is instantiated and we can retrieve the component metadata.
1500
+ * For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.
1501
+ *
1502
+ * @internal
1503
+ */
1504
+ ng1ComponentsToBeUpgraded = {};
1505
+ upgradedProviders = [];
1506
+ moduleRef = null;
1449
1507
  constructor(ng2AppModule, compilerOptions) {
1450
1508
  this.ng2AppModule = ng2AppModule;
1451
1509
  this.compilerOptions = compilerOptions;
1452
- this.idPrefix = `NG2_UPGRADE_${upgradeCount++}_`;
1453
- this.downgradedComponents = [];
1454
- /**
1455
- * An internal map of ng1 components which need to up upgraded to ng2.
1456
- *
1457
- * We can't upgrade until injector is instantiated and we can retrieve the component metadata.
1458
- * For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.
1459
- *
1460
- * @internal
1461
- */
1462
- this.ng1ComponentsToBeUpgraded = {};
1463
- this.upgradedProviders = [];
1464
- this.moduleRef = null;
1465
1510
  if (!ng2AppModule) {
1466
1511
  throw new Error('UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.');
1467
1512
  }
@@ -1968,14 +2013,12 @@ class UpgradeAdapter {
1968
2013
  * @publicApi
1969
2014
  */
1970
2015
  class UpgradeAdapterRef {
1971
- constructor() {
1972
- /* @internal */
1973
- this._readyFn = null;
1974
- this.ng1RootScope = null;
1975
- this.ng1Injector = null;
1976
- this.ng2ModuleRef = null;
1977
- this.ng2Injector = null;
1978
- }
2016
+ /* @internal */
2017
+ _readyFn = null;
2018
+ ng1RootScope = null;
2019
+ ng1Injector = null;
2020
+ ng2ModuleRef = null;
2021
+ ng2Injector = null;
1979
2022
  /* @internal */
1980
2023
  _bootstrapDone(ngModuleRef, ng1Injector) {
1981
2024
  this.ng2ModuleRef = ngModuleRef;