@angular/upgrade 13.1.0-next.1 → 13.2.0-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/upgrade",
3
- "version": "13.1.0-next.1",
3
+ "version": "13.2.0-next.0",
4
4
  "description": "Angular - the library for easing update from v1 to v2",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -11,10 +11,10 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "13.1.0-next.1",
15
- "@angular/compiler": "13.1.0-next.1",
16
- "@angular/platform-browser": "13.1.0-next.1",
17
- "@angular/platform-browser-dynamic": "13.1.0-next.1"
14
+ "@angular/core": "13.2.0-next.0",
15
+ "@angular/compiler": "13.2.0-next.0",
16
+ "@angular/platform-browser": "13.2.0-next.0",
17
+ "@angular/platform-browser-dynamic": "13.2.0-next.0"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.1
2
+ * @license Angular v13.2.0-next.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -165,6 +165,8 @@ export declare function downgradeInjectable(token: any, downgradedModule?: strin
165
165
  * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:
166
166
  * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module
167
167
  * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.
168
+ * NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a
169
+ * bootstrap function instead.
168
170
  * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module
169
171
  * using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.
170
172
  * - `Function`: If you pass a function, it is expected to return a promise resolving to an
@@ -255,7 +257,125 @@ export declare function downgradeInjectable(token: any, downgradedModule?: strin
255
257
  *
256
258
  * @publicApi
257
259
  */
258
- export declare function downgradeModule<T>(moduleOrBootstrapFn: Type<T> | NgModuleFactory<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string;
260
+ export declare function downgradeModule<T>(moduleOrBootstrapFn: Type<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string;
261
+
262
+ /**
263
+ * @description
264
+ *
265
+ * A helper function for creating an AngularJS module that can bootstrap an Angular module
266
+ * "on-demand" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be
267
+ * instantiated.
268
+ *
269
+ * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that
270
+ * support AOT compilation.*
271
+ *
272
+ * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to
273
+ * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for
274
+ * specific routes and only instantiate the Angular modules if/when the user visits one of these
275
+ * routes.
276
+ *
277
+ * The Angular module will be bootstrapped once (when requested for the first time) and the same
278
+ * reference will be used from that point onwards.
279
+ *
280
+ * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:
281
+ * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module
282
+ * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.
283
+ * NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a
284
+ * bootstrap function instead.
285
+ * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module
286
+ * using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.
287
+ * - `Function`: If you pass a function, it is expected to return a promise resolving to an
288
+ * `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}
289
+ * that are expected to be available from the returned `NgModuleRef`'s `Injector`.
290
+ *
291
+ * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to
292
+ * declare a dependency in your main AngularJS module.
293
+ *
294
+ * {@example upgrade/static/ts/lite/module.ts region="basic-how-to"}
295
+ *
296
+ * For more details on how to use `downgradeModule()` see
297
+ * [Upgrading for Performance](guide/upgrade-performance).
298
+ *
299
+ * @usageNotes
300
+ *
301
+ * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to
302
+ * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be
303
+ * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded
304
+ * component.
305
+ *
306
+ * <div class="alert is-important">
307
+ *
308
+ * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />
309
+ * Use one or the other.
310
+ *
311
+ * </div>
312
+ *
313
+ * ### Differences with `UpgradeModule`
314
+ *
315
+ * Besides their different API, there are two important internal differences between
316
+ * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:
317
+ *
318
+ * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module
319
+ * inside the {@link NgZone Angular zone}.
320
+ * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a
321
+ * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are
322
+ * detected in the Angular part of the application.
323
+ *
324
+ * What this means is that applications using `UpgradeModule` will run change detection more
325
+ * frequently in order to ensure that both frameworks are properly notified about possible changes.
326
+ * This will inevitably result in more change detection runs than necessary.
327
+ *
328
+ * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as
329
+ * tightly, restricting the explicit change detection runs only to cases where it knows it is
330
+ * necessary (e.g. when the inputs of a downgraded component change). This improves performance,
331
+ * especially in change-detection-heavy applications, but leaves it up to the developer to manually
332
+ * notify each framework as needed.
333
+ *
334
+ * For a more detailed discussion of the differences and their implications, see
335
+ * [Upgrading for Performance](guide/upgrade-performance).
336
+ *
337
+ * <div class="alert is-helpful">
338
+ *
339
+ * You can manually trigger a change detection run in AngularJS using
340
+ * [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or
341
+ * [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).
342
+ *
343
+ * You can manually trigger a change detection run in Angular using {@link NgZone#run
344
+ * ngZone.run(...)}.
345
+ *
346
+ * </div>
347
+ *
348
+ * ### Downgrading multiple modules
349
+ *
350
+ * It is possible to downgrade multiple modules and include them in an AngularJS application. In
351
+ * that case, each downgraded module will be bootstrapped when an associated downgraded component or
352
+ * injectable needs to be instantiated.
353
+ *
354
+ * Things to keep in mind, when downgrading multiple modules:
355
+ *
356
+ * - Each downgraded component/injectable needs to be explicitly associated with a downgraded
357
+ * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.
358
+ *
359
+ * - If you want some injectables to be shared among all downgraded modules, you can provide them as
360
+ * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or
361
+ * `platformBrowserDynamic`).
362
+ *
363
+ * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or
364
+ * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the
365
+ * downgraded modules, each one is considered a "root" module. As a consequence, a new instance
366
+ * will be created for every injectable provided in `"root"` (via
367
+ * {@link Injectable#providedIn `providedIn`}).
368
+ * If this is not your intention, you can have a shared module (that will act as act as the "root"
369
+ * module) and create all downgraded modules using that module's injector:
370
+ *
371
+ * {@example upgrade/static/ts/lite-multi-shared/module.ts region="shared-root-module"}
372
+ *
373
+ * @publicApi
374
+ *
375
+ * @deprecated Passing `NgModuleFactory` as the `downgradeModule` function argument is deprecated,
376
+ * please pass an NgModule class reference instead.
377
+ */
378
+ export declare function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): string;
259
379
 
260
380
  /**
261
381
  * Returns the current AngularJS global.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.1
2
+ * @license Angular v13.2.0-next.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/upgrade.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.1
2
+ * @license Angular v13.2.0-next.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */