@angular/core 17.3.0-rc.0 → 17.3.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/esm2022/src/application/application_ref.mjs +14 -11
- package/esm2022/src/authoring/input/input.mjs +4 -1
- package/esm2022/src/authoring/output/output.mjs +2 -2
- package/esm2022/src/authoring/output/output_emitter_ref.mjs +14 -3
- package/esm2022/src/authoring/queries.mjs +7 -1
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +10 -4
- package/esm2022/src/core_private_export.mjs +2 -3
- package/esm2022/src/di/contextual.mjs +9 -3
- package/esm2022/src/event_emitter.mjs +6 -7
- package/esm2022/src/hydration/annotate.mjs +4 -2
- package/esm2022/src/hydration/api.mjs +27 -2
- package/esm2022/src/hydration/cleanup.mjs +18 -2
- package/esm2022/src/hydration/interfaces.mjs +1 -1
- package/esm2022/src/hydration/node_lookup_utils.mjs +59 -39
- package/esm2022/src/hydration/tokens.mjs +6 -1
- package/esm2022/src/i18n/utils.mjs +16 -0
- package/esm2022/src/render3/after_render_hooks.mjs +11 -8
- package/esm2022/src/render3/component_ref.mjs +1 -1
- package/esm2022/src/render3/i18n/i18n_apply.mjs +32 -7
- package/esm2022/src/render3/i18n/i18n_parse.mjs +50 -16
- package/esm2022/src/render3/instructions/control_flow.mjs +4 -2
- package/esm2022/src/render3/instructions/element.mjs +5 -3
- package/esm2022/src/render3/instructions/element_container.mjs +3 -2
- package/esm2022/src/render3/instructions/template.mjs +4 -2
- package/esm2022/src/render3/instructions/text.mjs +4 -2
- package/esm2022/src/render3/interfaces/i18n.mjs +1 -1
- package/esm2022/src/render3/node_manipulation.mjs +6 -2
- package/esm2022/src/render3/node_selector_matcher.mjs +37 -51
- package/esm2022/src/render3/queue_state_update.mjs +2 -4
- package/esm2022/src/render3/util/view_utils.mjs +2 -1
- package/esm2022/src/sanitization/html_sanitizer.mjs +54 -14
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/component_fixture.mjs +11 -66
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +629 -436
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +11 -66
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +96 -12
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +8 -2
- package/schematics/migrations/block-template-entities/bundle.js.map +2 -2
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +8 -2
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
- package/schematics/ng-generate/control-flow-migration/bundle.js +8 -2
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
- package/schematics/ng-generate/standalone-migration/bundle.js +356 -294
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/src/is_internal.mjs +0 -15
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.3.0
|
|
2
|
+
* @license Angular v17.3.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ɵDeferBlockState, ɵtriggerResourceLoading, ɵrenderDeferBlockState, ɵCONTAINER_HEADER_OFFSET, ɵgetDeferBlocks, ɵDeferBlockBehavior, InjectionToken, inject as inject$1, ɵNoopNgZone, NgZone, ɵEffectScheduler, ApplicationRef, getDebugNode, RendererFactory2, ɵPendingTasks,
|
|
7
|
+
import { ɵDeferBlockState, ɵtriggerResourceLoading, ɵrenderDeferBlockState, ɵCONTAINER_HEADER_OFFSET, ɵgetDeferBlocks, ɵDeferBlockBehavior, InjectionToken, inject as inject$1, ɵNoopNgZone, NgZone, ɵEffectScheduler, ApplicationRef, getDebugNode, RendererFactory2, ɵPendingTasks, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetAsyncClassMetadataFn, ɵgenerateStandaloneInDeclarationsError, ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ɵdepsTracker, ɵgetInjectableDef, resolveForwardRef, ɵNG_COMP_DEF, ɵisComponentDefPendingResolution, ɵresolveComponentResources, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, ɵclearResolutionOfComponentResourcesQueue, ɵrestoreComponentResolutionQueue, provideZoneChangeDetection, Compiler, ɵDEFER_BLOCK_CONFIG, COMPILER_OPTIONS, Injector, ɵisEnvironmentProviders, ɵNgModuleFactory, ModuleWithComponentFactories, ɵconvertToBitFlags, InjectFlags, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, runInInjectionContext, EnvironmentInjector, ɵChangeDetectionScheduler, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
export { ɵDeferBlockBehavior as DeferBlockBehavior, ɵDeferBlockState as DeferBlockState } from '@angular/core';
|
|
9
9
|
import { Subscription } from 'rxjs';
|
|
10
10
|
import { first } from 'rxjs/operators';
|
|
@@ -301,12 +301,6 @@ class PseudoApplicationComponentFixture extends ComponentFixture {
|
|
|
301
301
|
this.beforeRenderSubscription = undefined;
|
|
302
302
|
}
|
|
303
303
|
initialize() {
|
|
304
|
-
if (this._autoDetect) {
|
|
305
|
-
this.subscribeToAppRefEvents();
|
|
306
|
-
}
|
|
307
|
-
this.componentRef.hostView.onDestroy(() => {
|
|
308
|
-
this.unsubscribeFromAppRefEvents();
|
|
309
|
-
});
|
|
310
304
|
// Create subscriptions outside the NgZone so that the callbacks run outside
|
|
311
305
|
// of NgZone.
|
|
312
306
|
this._ngZone.runOutsideAngular(() => {
|
|
@@ -315,18 +309,15 @@ class PseudoApplicationComponentFixture extends ComponentFixture {
|
|
|
315
309
|
this._isStable = false;
|
|
316
310
|
},
|
|
317
311
|
}));
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
}));
|
|
329
|
-
}
|
|
312
|
+
this._subscriptions.add(this._ngZone.onMicrotaskEmpty.subscribe({
|
|
313
|
+
next: () => {
|
|
314
|
+
if (this._autoDetect) {
|
|
315
|
+
// Do a change detection run with checkNoChanges set to true to check
|
|
316
|
+
// there are no changes on the second run.
|
|
317
|
+
this.detectChanges(true);
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
}));
|
|
330
321
|
this._subscriptions.add(this._ngZone.onStable.subscribe({
|
|
331
322
|
next: () => {
|
|
332
323
|
this._isStable = true;
|
|
@@ -389,56 +380,10 @@ class PseudoApplicationComponentFixture extends ComponentFixture {
|
|
|
389
380
|
if (this._noZoneOptionIsSet) {
|
|
390
381
|
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set.');
|
|
391
382
|
}
|
|
392
|
-
if (autoDetect !== this._autoDetect) {
|
|
393
|
-
if (autoDetect) {
|
|
394
|
-
this.subscribeToAppRefEvents();
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
this.unsubscribeFromAppRefEvents();
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
383
|
this._autoDetect = autoDetect;
|
|
401
384
|
this.detectChanges();
|
|
402
385
|
}
|
|
403
|
-
subscribeToAppRefEvents() {
|
|
404
|
-
// TODO(atscott): Remove and make this a breaking change externally in v18
|
|
405
|
-
if (!ɵisG3) {
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
this._ngZone.runOutsideAngular(() => {
|
|
409
|
-
this.afterTickSubscription = this._testAppRef.afterTick.subscribe(() => {
|
|
410
|
-
this.checkNoChanges();
|
|
411
|
-
});
|
|
412
|
-
this.beforeRenderSubscription = this._testAppRef.beforeRender.subscribe((isFirstPass) => {
|
|
413
|
-
try {
|
|
414
|
-
ɵdetectChangesInViewIfRequired(this.componentRef.hostView._lView, isFirstPass, this.componentRef.hostView.notifyErrorHandler);
|
|
415
|
-
}
|
|
416
|
-
catch (e) {
|
|
417
|
-
// If an error ocurred during change detection, remove the test view from the application
|
|
418
|
-
// ref tracking. Note that this isn't exactly desirable but done this way because of how
|
|
419
|
-
// things used to work with `autoDetect` and uncaught errors. Ideally we would surface
|
|
420
|
-
// this error to the error handler instead and continue refreshing the view like
|
|
421
|
-
// what would happen in the application.
|
|
422
|
-
this.unsubscribeFromAppRefEvents();
|
|
423
|
-
throw e;
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
this._testAppRef.externalTestViews.add(this.componentRef.hostView);
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
unsubscribeFromAppRefEvents() {
|
|
430
|
-
// TODO(atscott): Remove and make this a breaking change externally in v18
|
|
431
|
-
if (!ɵisG3) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
this.afterTickSubscription?.unsubscribe();
|
|
435
|
-
this.beforeRenderSubscription?.unsubscribe();
|
|
436
|
-
this.afterTickSubscription = undefined;
|
|
437
|
-
this.beforeRenderSubscription = undefined;
|
|
438
|
-
this._testAppRef.externalTestViews.delete(this.componentRef.hostView);
|
|
439
|
-
}
|
|
440
386
|
destroy() {
|
|
441
|
-
this.unsubscribeFromAppRefEvents();
|
|
442
387
|
this._subscriptions.unsubscribe();
|
|
443
388
|
super.destroy();
|
|
444
389
|
}
|